summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarshan N <dnarayan@redhat.com>2015-07-02 12:40:49 +0530
committerSahina Bose <sabose@redhat.com>2015-08-16 23:04:04 -0700
commit6759965ca3df5aca51c248a016688646e63497fc (patch)
tree8878156c3802bd38e22d79de98f6e5d4728e63c6
parentcee095666f1d120c7e7d0a0dba3085e870d0b6b5 (diff)
nagios-addons: added disperse vol details to discover_volumes pluginv1.1.0
This patch adds disperse volume related details like redundancy count and disperse count to discover_volumes plugin. It is needed to monitor status of disperse volume. Change-Id: I1c5d7d85e6fe7b0efdcd75fd562507dd1f9ce906 Bug-Url: https://bugzilla.redhat.com/1235651 Signed-off-by: Darshan N <dnarayan@redhat.com> Reviewed-on: http://review.gluster.org/11500 Reviewed-by: Ramesh N <rnachimu@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-xplugins/discover_volumes.py2
-rw-r--r--tests/test_discover_volumes.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/discover_volumes.py b/plugins/discover_volumes.py
index c175247..e8633e0 100755
--- a/plugins/discover_volumes.py
+++ b/plugins/discover_volumes.py
@@ -75,6 +75,8 @@ def discoverVolumes(volumeName, list):
volDict['replicaCount'] = volume['replicaCount']
volDict['bricks'] = []
+ volDict['disperseCount'] = volume['disperseCount']
+ volDict['redundancyCount'] = volume['redundancyCount']
for brick in volume['bricksInfo']:
brickproplist = brick['name'].split(':')
volDict['bricks'].append({'brickaddress': brickproplist[0],
diff --git a/tests/test_discover_volumes.py b/tests/test_discover_volumes.py
index e5d15b7..b10dd56 100644
--- a/tests/test_discover_volumes.py
+++ b/tests/test_discover_volumes.py
@@ -29,11 +29,13 @@ class TestDiscoverVolumes(TestCaseBase):
result['V1'] = {"bricksInfo": [{"name": "172.16.53.1:/bricks/v1-1",
"hostUuid": "0000-1111"}],
"volumeType": "DISTRIBUTE", "volumeName": "V1",
- "replicaCount": "1"}
+ "replicaCount": "1", "disperseCount": "4",
+ "redundancyCount": "2"}
result['V2'] = {"bricksInfo": [{"name": "172.16.53.2:/bricks/v2-1",
"hostUuid": "0000-1112"}],
"volumeType": "DISTRIBUTE", "volumeName": "V2",
- "replicaCount": "1"}
+ "replicaCount": "1", "disperseCount": "4",
+ "redundancyCount": "2"}
return result
def _mockGetVolumeInfo(self, volumeName):