NRPE Problems
Mark Campbell
mark at redbrick.dcu.ie
Wed Mar 17 21:30:49 CET 2004
Hey Guys,
First off great work on Nagios, top notch work.
I'm having a slight problem though. I'm developing a few inhouse
monitoring scripts to keep the bean counters happy :) They're going fine
expect for this one which is giving me a strange error.
./check_nrpe -H hungary -c check_oracle_net ; echo $?
NRPE: Unable to read output
3
I'm able to runother scripts remotely on the same machine....
./check_nrpe -H hungary -c oracle_inst_up ; echo $?
Oracle CRITICAL: Oracle instance testiset is not available.
2
And I'm able to run the script fine on the local machine:
./check_oracle_net ; echo $?
Oracle OK.
0
This is the source to the ksh script I'm using... any ideas are appricated..
-[code]-
#!/bin/ksh
#
# Verify if all oracle instances are up - tnsnames.ora entries should be
# uniform
cat /etc/nagiosoracheck | while read LINE ; do
case $LINE in
\#*) ;; #comment-line in oratab
*)
# Proceed only if third field is 'Y'.
if [ "`echo $LINE | awk -F: '{print $3}' -`" = "Y" ] ;
then
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if [ "$ORACLE_SID" = '*' ] ; then
ORACLE_SID=""
fi
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
TNS_DIR=$ORACLE_HOME/network/admin/$ORACLE_SID'_'`hostname`
. $ORACLE_HOME/$ORACLE_SID'_'`hostname`.env
# Read file and test all entries...
grep -v -e '^ ' -e'^\t' -e'^$' -e '^#' -e'^)'
${TNS_DIR}/tnsnames.ora | awk '{sub("=", "", $1); print $1}' | grep -v 'IFILE' |
while read NAME ; do
devnull=`${ORACLE_HOME}/bin/tnsping
$NAME`
if [ "${?}" = "1" ]; then
echo "Oracle CRITICAL: Unable to ping ${NAME}."
return 2
fi
done
fi
esac
done
if [ $? -ne 0 ] ; then
return $retval
else
echo "Oracle OK."
return 0
fi
Thanks in advance
--
regards,
-mark
-
Mark Campbell <mark_campbell at redbrick.dcu.ie>
http://mark.redbrick.dcu.ie
-
"Trying is the first step towards Failure"- Homer J. Simpson
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list