From aa41f16b6e25b6d455aa9213bcb621388d3ff42e Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Fri, 16 Mar 2012 11:17:48 +0000 Subject: [PATCH] check_rhcs_fence added for rhel6 compatibility --- check_rhcs/check_rhcs_fence | 22 ++++++++++++++++++++++ check_rhcs/nagios-okplugin-check_rhcs.spec | 1 + check_rhcs/nrpe.d/check_rhcs.cfg | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 check_rhcs/check_rhcs_fence diff --git a/check_rhcs/check_rhcs_fence b/check_rhcs/check_rhcs_fence new file mode 100644 index 0000000..952484e --- /dev/null +++ b/check_rhcs/check_rhcs_fence @@ -0,0 +1,22 @@ +#!/bin/sh + + + +OK=0 +WARNING=1 +CRITICAL=2 +UNKNOWN=3 + +STATUS=$UNKNOWN + +OUTPUT=`fence_tool ls | grep "wait state" | awk '{ print $3}' ` + +if [ "$OUTPUT" = "none" ]; then + STATUS=$OK +fi + + +echo "Fence wait state (fence_tool ls) is: $OUTPUT" +exit $STATUS + + diff --git a/check_rhcs/nagios-okplugin-check_rhcs.spec b/check_rhcs/nagios-okplugin-check_rhcs.spec index 32a5432..1f23566 100644 --- a/check_rhcs/nagios-okplugin-check_rhcs.spec +++ b/check_rhcs/nagios-okplugin-check_rhcs.spec @@ -31,6 +31,7 @@ rm -rf %{buildroot} install -D -p -m 0755 check_rhcs %{buildroot}%{_libdir}/nagios/plugins/check_rhcs install -D -p -m 0755 check_rhcs_cman_group.sh %{buildroot}%{_libdir}/nagios/plugins/check_rhcs_cman_group.sh install -D -p -m 0755 check_rhcs_manualfencing.sh %{buildroot}%{_libdir}/nagios/plugins/check_rhcs_manualfencing.sh +install -D -p -m 0755 check_rhcs_fence %{buildroot}%{_libdir}/nagios/plugins/check_rhcs_fence install -D -p -m 0755 nrpe.d/%{plugin_name}.cfg %{buildroot}/etc/nrpe.d/%{plugin_name}.cfg diff --git a/check_rhcs/nrpe.d/check_rhcs.cfg b/check_rhcs/nrpe.d/check_rhcs.cfg index 3e9a71d..ef714d9 100644 --- a/check_rhcs/nrpe.d/check_rhcs.cfg +++ b/check_rhcs/nrpe.d/check_rhcs.cfg @@ -14,3 +14,7 @@ command[check_rhcs_cman_group]=/usr/lib64/nagios/plugins/check_rhcs_cman_group.s command[check_rhcs_cman_group_default]=/usr/lib64/nagios/plugins/check_rhcs_cman_group.sh --level 0 --group default command[check_rhcs_cman_group_rgmanager]=/usr/lib64/nagios/plugins/check_rhcs_cman_group.sh --level 1 --group rgmanager + +# RHEL 6 specific +command[check_rhcs6_fencing]=/usr/lib64/nagios/plugins/check_rhcs_fence +