From 72b5d2418549b2f3af4cea91e6cf978a25db1dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Fri, 29 Oct 2010 15:30:34 +0000 Subject: [PATCH] --- check_time/trunk/check_time | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/check_time/trunk/check_time b/check_time/trunk/check_time index 5d609c5..70605c1 100755 --- a/check_time/trunk/check_time +++ b/check_time/trunk/check_time @@ -1,6 +1,8 @@ #!/bin/sh +export PATH=$PATH:/usr/lib/nagios/plugins/:/usr/lib64/nagios/plugins/ + # Nagios exit codes OK=0 @@ -59,7 +61,15 @@ do done LOCALTIME=`/bin/date +%s` -REMOTETIME=`/usr/lib/nagios/plugins/check_nrpe -H $hostaddress -c get_time` +REMOTETIME=`check_nrpe -H $hostaddress -c get_time 2>&1` +RESULT=$? + +if [ $RESULT -gt 0 ]; then + echo "Unknown - Could not execute check_nrpe" + echo "Error was:" + echo $REMOTETIME + exit 3 +fi for i in $warning $critical ; do if [ ! $i -ge 0 ]; then