From e45624a580ce809d0a51698a4b38d882a1e86640 Mon Sep 17 00:00:00 2001 From: Shubhendu Tripathi Date: Thu, 10 Apr 2014 11:41:32 +0530 Subject: 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 --- plugins/check_remote_host.py.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins') 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) -- cgit