summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-05-26 20:01:44 +0530
committerSahina Bose <sabose@redhat.com>2014-06-04 03:36:48 -0700
commit58138dcd260104a24e9f1e6c417f0cff8dafb990 (patch)
tree7d7862a7ba0787f40b4f228cd39fb5c5094784a9
parentda2722d315a0866c52f425f176d3a1aa2b651a0e (diff)
gluster-nagios-addons:volume status based on volume type
Added the volume type in the plugin output The logic of determining the volume status changed based on the volume type. Added the volume type and the list of bricks down in the plugin output Change-Id: Ib999fc78059c725a29f4f7bc3b3328c34b6a6b33 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1096159 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1096169 Signed-off-by: Nishanth Thomas <nthomas@redhat.com> Reviewed-on: http://review.gluster.org/7878 Reviewed-by: Sahina Bose <sabose@redhat.com> Tested-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-xplugins/check_volume_status.py6
-rwxr-xr-xplugins/discover_volumes.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/check_volume_status.py b/plugins/check_volume_status.py
index 4812e99..77168f3 100755
--- a/plugins/check_volume_status.py
+++ b/plugins/check_volume_status.py
@@ -34,11 +34,13 @@ def getVolumeStatus(args):
elif volumes[args.volume]["volumeStatus"] == (glustercli.
VolumeStatus.ONLINE):
exitstatus = utils.PluginStatusCode.OK
- message = "OK: Volume is up"
+ message = "OK: Volume : %s type - Volume is up" % \
+ (volumes[args.volume]["volumeType"])
elif volumes[args.volume]["volumeStatus"] == (glustercli.
VolumeStatus.OFFLINE):
exitstatus = utils.PluginStatusCode.CRITICAL
- message = "CRITICAL: Volume is stopped"
+ message = "CRITICAL: Volume : %s type is stopped" % \
+ (volumes[args.volume]["volumeType"])
except glustercli.GlusterCmdFailedException as e:
out = ("UNKNOWN: Command execution failed %s" % e.message)
return utils.PluginStatusCode.UNKNOWN, out
diff --git a/plugins/discover_volumes.py b/plugins/discover_volumes.py
index ba48532..5d1d463 100755
--- a/plugins/discover_volumes.py
+++ b/plugins/discover_volumes.py
@@ -65,10 +65,12 @@ def discoverVolumes(volumeName, list):
if geoRepStatus == "on":
volDict['geo-rep'] = geoRepStatus
+ volDict['replicaCount'] = volume['replicaCount']
volDict['bricks'] = []
for brick in volume['bricksInfo']:
brickproplist = brick['name'].split(':')
- volDict['bricks'].append({'brickpath': brickproplist[1],
+ volDict['bricks'].append({'brickaddress': brickproplist[0],
+ 'brickpath': brickproplist[1],
'hostUuid': brick['hostUuid']})
resultlist[key] = volDict
resultString = json.dumps(resultlist)