Reads the process configuration from the config file. Config file contains the processes to be monitored.
( config_file_path = "/etc/monitor.conf" )
| 57 | FAILING_CHECKS_FILE = 'failing_health_checks' |
| 58 | |
| 59 | def getServicesConfig( config_file_path = "/etc/monitor.conf" ): |
| 60 | """ |
| 61 | Reads the process configuration from the config file. |
| 62 | Config file contains the processes to be monitored. |
| 63 | |
| 64 | """ |
| 65 | process_dict = {} |
| 66 | parser = ConfigParser() |
| 67 | parser.read( config_file_path ) |
| 68 | |
| 69 | |
| 70 | for section in parser.sections(): |
| 71 | process_dict[section] = {} |
| 72 | |
| 73 | for name, value in parser.items(section): |
| 74 | process_dict[section][name] = value |
| 75 | printd (" %s = %r" % (name, value)) |
| 76 | |
| 77 | return process_dict |
| 78 | |
| 79 | def printd (msg): |
| 80 | """ |