diff options
author | Shubhendu Tripathi <shtripat@redhat.com> | 2014-04-10 11:41:32 +0530 |
---|---|---|
committer | Bala.FA <barumuga@redhat.com> | 2014-04-29 10:21:37 +0530 |
commit | e45624a580ce809d0a51698a4b38d882a1e86640 (patch) | |
tree | 43786f4448cd235f9c303e8e373c50e40e41a5f5 | |
parent | 917c0284f2d48f17a5be79d64978281687552e21 (diff) |
rhsc-nagios-addon: Chnaged the logic to report host status
Modified to check the list of critical services to decide
on the host status.
Change-Id: I6629abdd575e2fe92ea133a57d329e04fbd3b052
Signed-off-by: Shubhendu Tripathi <shtripat@redhat.com>
-rwxr-xr-x | plugins/check_remote_host.py.in | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/check_remote_host.py.in b/plugins/check_remote_host.py.in index 0ef101e..0e7508c 100755 --- a/plugins/check_remote_host.py.in +++ b/plugins/check_remote_host.py.in @@ -89,16 +89,14 @@ if __name__ == "__main__": # Calculate the consolidated status for the host based on above # status of individual services - finalStatus = utils.PluginStatusCode.OK criticalSrvcs = [] for srvc in _getHostMonitoringSrvcList(): srvc_status = checkLiveStatus(hostAddr, srvc) - finalStatus = finalStatus | srvc_status if srvc_status == utils.PluginStatusCode.CRITICAL: criticalSrvcs.append(str(srvc)) # Return the status - if finalStatus == utils.PluginStatusCode.CRITICAL: + if len(criticalSrvcs) > 0: print "Host Status %s - Service(s) %s in CRITICAL state" % \ (utils.PluginStatus.WARNING, criticalSrvcs) sys.exit(utils.PluginStatusCode.WARNING) |