Page 3 of 3
Re: Nagios Server- Remote Plugin "Incorrect Values"
Posted: Wed May 16, 2012 5:04 pm
by Shivaramakrishnan
This is what I get:
[root@dbs01-ple03 tmp]# whoami
root
[root@dbs01-ple03 tmp]# /usr/lib/nagios/plugins/check_arcconf.sh -w 50 -c 70
RAID WARNING, 0 numParityErrors, 0 hwErrors, 68 mediumErrors
[root@dbs01-ple03 tmp]# su nagios -s /bin/bash -c "/usr/lib/nagios/plugins/check_arcconf.sh -w 50 -c 70"
(standard_in) 1: parse error
/usr/lib/nagios/plugins/check_arcconf.sh: line 55: [: : integer expression expected
/usr/lib/nagios/plugins/check_arcconf.sh: line 59: [: : integer expression expected
RAID OK, numParityErrors, hwErrors, mediumErrors
Re: Nagios Server- Remote Plugin "Incorrect Values"
Posted: Wed May 16, 2012 6:13 pm
by Shivaramakrishnan
Just figured out that this might be causing the problem:
if [ -n $library ]
then
TMP=`mktemp -t numerrors.XXXXXX` # Create a tmpfile to store the full test result
HTMP=`mktemp -t hwerrors.XXXXXX` # Create a tmpfile to store the full test result
MTMP=`mktemp -t mediumerrors.XXXXXX` # Create a tmpfile to store the full test result
$ARCONFLISTSTATE | grep Err | grep -v smart | grep -v drive | grep numParityErrors| awk '{print $3}' > $TMP
$ARCONFLISTSTATE | grep Err | grep -v smart | grep -v drive | grep hwErrors | awk '{print $3}' > $HTMP
$ARCONFLISTSTATE | grep Err | grep -v smart | grep -v drive | grep mediumErrors | awk '{print $3}' > $MTMP
numParityErrors=`a=$(cat $TMP) ; echo $a | tr ' ' '+'| bc`
hwErrors=`a=$(cat $HTMP) ; echo $a | tr ' ' '+'| bc`
mediumErrors=`a=$(cat $MTMP) ; echo $a | tr ' ' '+'| bc`
allerrors=`echo "$numParityErrors + $hwErrors + $mediumErrors" | bc`
check_error_count
rm -rf $TMP
rm -rf $HTMP
rm -rf $MTMP
Since I am creating a temp file to store the result ,May be the file permissions of the temp file is causing the causing the problem.Can u please let me know if there is any other bug or modifications that needs to be made?
Also wanted to know if there is a possibility of running the script from the nagios server on the remote client as root itself,If so,what are the changes that needs to be made?
In that case the problem would be solved.
Re: Nagios Server- Remote Plugin "Incorrect Values"
Posted: Fri May 18, 2012 10:25 am
by agriffin
What are the permissions on your /tmp directory?
Also, you could run the script as root by using sudo. In this case, you would prepend /usr/bin/sudo to the command definition and add something like this to your sudoers file:
Code: Select all
nagios ALL = NOPASSWD:/usr/lib/nagios/plugins/check_arcconf.sh *