summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-06-18 17:40:55 +0530
committerSahina Bose <sabose@redhat.com>2014-10-13 04:39:08 -0700
commitf6c4a6b4fac009f2b4ca738066b7ba9858ec9dec (patch)
tree5e793eec738448f9248d948cd6dd743070f9dff7
parenteab2ca4f26adb9b661fbad855a9b46f308fc5911 (diff)
nagios-server-addons:executeRandomHost to send request with correct host address
When the inital request fails, executeRandomHost is supposed to iterate over the list of avialable hosts and resend the request until get a successful response. This part of code was falty, where the request was send without getting the proper ipaddress/hostname Change-Id: I1f1c7a5bccba3bd601c9e3241083784f15a2c4b6 Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=1109843 Signed-off-by: Nishanth Thomas <nthomas@redhat.com> Reviewed-on: http://review.gluster.org/8101 Reviewed-by: Sahina Bose <sabose@redhat.com> Tested-by: Nishanth Thomas <nishusemail@gmail.com>
-rwxr-xr-xplugins/check_vol_server.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py
index 8263e6d..cabc1bc 100755
--- a/plugins/check_vol_server.py
+++ b/plugins/check_vol_server.py
@@ -206,13 +206,17 @@ def _executeRandomHost(hostgroup, command):
if status != utils.PluginStatusCode.UNKNOWN:
return status, output
- # random host is not able to execute the command
- # Now try to iterate through the list of hosts
- # in the host group and send the command until
- # the command is successful
+ #random host is not able to execute the command
+ #Now try to iterate through the list of hosts
+ #in the host group and send the command until
+ #the command is successful
+
+ #No need to send it to host which we already sent
+ list_hosts.remove(host)
for host in list_hosts:
+ host_address = _getHostAddress(host)
status, output = execNRPECommand(server_utils.getNRPEBaseCommand(
- host,
+ host_address,
timeout=args.timeout) + command)
if status != utils.PluginStatusCode.UNKNOWN:
return status, output