summaryrefslogtreecommitdiffstats
path: root/plugins/check_proc_status.py
diff options
context:
space:
mode:
authorRamesh Nachimuthu <rnachimu@redhat.com>2014-04-29 14:11:41 +0530
committerSahina Bose <sabose@redhat.com>2014-04-29 06:26:30 -0700
commitb67af78d5f230cf64faa85812d1c8eb32994ecd4 (patch)
tree8db93b9048478ecf617b52f72e4f9827bc5695c0 /plugins/check_proc_status.py
parentb6bebfdb5c3c845fa2489cd613a1b342ff92202e (diff)
brickstatus: Use only brick path in brick status service
Change the brick status service descrption to "Brick Status - <brick-path>". Currently it is "Brick Status - <hostaddress>:<brick-path>". Change-Id: Ib6ca14447756ef96bff65f5732699ac5842eabce Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7596 Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/check_proc_status.py')
-rwxr-xr-xplugins/check_proc_status.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/check_proc_status.py b/plugins/check_proc_status.py
index 47cf71e..2ac1bc3 100755
--- a/plugins/check_proc_status.py
+++ b/plugins/check_proc_status.py
@@ -56,7 +56,8 @@ def sendBrickStatus(hostName, volInfo):
for brick in volumeInfo['bricksInfo']:
if brick.get('hostUuid') != hostUuid:
continue
- brickService = "Brick Status - %s" % brick['name']
+ brickPath = brick['name'].split(':')[1]
+ brickService = "Brick Status - %s" % brickPath
pidFile = brick['name'].replace(
":/", "-").replace("/", "-") + ".pid"
try:
@@ -71,12 +72,12 @@ def sendBrickStatus(hostName, volInfo):
status = utils.PluginStatusCode.CRITICAL
else:
status = utils.PluginStatusCode.UNKNOWN
- msg = "UNKNOWN: Brick %s: %s" % (brick['name'], str(e))
+ msg = "UNKNOWN: Brick %s: %s" % (brickPath, str(e))
finally:
if status == utils.PluginStatusCode.OK:
- msg = "OK: Brick %s" % brick['name']
+ msg = "OK: Brick %s" % brickPath
elif status != utils.PluginStatusCode.UNKNOWN:
- msg = "CRITICAL: Brick %s is down" % brick['name']
+ msg = "CRITICAL: Brick %s is down" % brickPath
nscautils.send_to_nsca(hostName, brickService, status, msg)