ganglia/ganglia-nagios-bridge — pull request #1 by nshn (2013-11-11 09:33:54+00:00)
Title: convert to daemon process, instead of cron job

I have changed the code, to be run as a daemon process instead of cron job. As it was mentioned in the README file, it can be run every 1 or 5 minutes typically; therefore I have used 60 seconds sleep time between its runs. The second part of the program, which is listening on sockets, is repeated forever (with 60 seconds delay), and the first part of the program which is reading configuration file, is only done one time, initially. If there is some exception in the first part (reading configuration file), the exception is catched, and it does not enter the second part “listening on socket connection” {it gives “Failed to read configuration file” message.}; Therefore, the second part is only repeated when there has been no exception in the first part. This way, unnecessary repeating of the second part (when the first part has exception) has been omitted.