summaryrefslogtreecommitdiffstats
path: root/plugins/check_remote_host.py.in
diff options
context:
space:
mode:
authorShubhendu Tripathi <shtripat@redhat.com>2014-04-10 11:41:32 +0530
committerBala.FA <barumuga@redhat.com>2014-04-29 10:21:37 +0530
commite45624a580ce809d0a51698a4b38d882a1e86640 (patch)
tree43786f4448cd235f9c303e8e373c50e40e41a5f5 /plugins/check_remote_host.py.in
parent917c0284f2d48f17a5be79d64978281687552e21 (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>
Diffstat (limited to 'plugins/check_remote_host.py.in')
-rwxr-xr-xplugins/check_remote_host.py.in4
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)