summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-05-01 20:28:54 +0530
committerTimothy Asir <tim.gluster@gmail.com>2014-05-05 22:25:39 -0700
commit10c9f0bca8afa33810cc30873efeb1f82d3bea4e (patch)
tree7597b85872d8d249814261cbcb490c02abb99097
parent255dbf79a9c987d354c5d27ea6af88dacfa54427 (diff)
gluster-nagios-addons: check disk status along with brick status
Modifed the check_proc_status plugin to check the disk status as well for the brick and accordingly report the status to brick service in nagios server. Change-Id: Ie9c59382e5926682254eff1c89e3a992deda6a38 Signed-off-by: Nishanth Thomas <nthomas@redhat.com> Reviewed-on: http://review.gluster.org/7634 Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Tested-by: Nishanth Thomas <nishusemail@gmail.com> Reviewed-by: Timothy Asir <tim.gluster@gmail.com>
-rwxr-xr-xplugins/check_proc_status.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/check_proc_status.py b/plugins/check_proc_status.py
index b331006..a899d0f 100755
--- a/plugins/check_proc_status.py
+++ b/plugins/check_proc_status.py
@@ -29,6 +29,7 @@ import glusternagios
from glusternagios import utils
from glusternagios import glustercli
+from glusternagios import storage
_checkProc = utils.CommandPath('check_proc',
@@ -51,6 +52,8 @@ _brickService = "Brick - "
_glusterdService = "Gluster Management"
_quotadService = "Quota"
_ctdbdService = "CTDB"
+checkIdeSmartCmdPath = utils.CommandPath(
+ 'check_ide_smart', '/usr/lib64/nagios/plugins/check_ide_smart')
def getBrickStatus(volInfo):
@@ -72,6 +75,18 @@ def getBrickStatus(volInfo):
_glusterVolPath, volumeName, pidFile)) as f:
if psutil.pid_exists(int(f.read().strip())):
status = utils.PluginStatusCode.OK
+ #Now check the status of the underlying physical disk
+ brickDevice = storage.getBrickDeviceName(
+ brick['name'].split(":")[1])
+ disk = storage.getDisksForBrick(
+ brickDevice)
+ cmd = [checkIdeSmartCmdPath.cmd, "-d", disk, "-n"]
+ rc, out, err = utils.execCmd(cmd)
+ if rc == utils.PluginStatusCode.CRITICAL and \
+ "tests failed" in out[0]:
+ status = utils.PluginStatusCode.WARNING
+ msg = "WARNING: Brick %s: %s" % (
+ brick['name'], out[0])
else:
status = utils.PluginStatusCode.CRITICAL
except IOError, e: