Page 2 of 3

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 3:47 pm
by Shivaramakrishnan
Just a correction
while test -n "$1"; do
case "$1" in
--help)
print_help
exit $STATE_OK
;;
-h)
print_help
exit $STATE_OK
;;
-w)
warnlevel=$1
shift
;;
-c)
critlevel=$2
shift
;;
esac
shift
done

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:11 pm
by agriffin
What happens if you run this command:

Code: Select all

su nagios -s /bin/bash -c "/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular"
The part between quotes is straight from your plugin, and it seems that the result should be an integer of some kind after some filtering. This is true when you run it as root, but for some reason when you run it as nagios it's not a well-formed integer. I'm thinking maybe it prints an error of some kind instead.

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:17 pm
by Shivaramakrishnan
su nagios -s /bin/bash -c "/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular"
Could not open log file: /var/log/UcliEvt.log
Controllers found: 0
Invalid controller number.
Could not open log file: /var/log/UcliEvt.log


Permissions set on the UcliEvt.log

-rwxr-xr-x 1 root root 37942 May 16 21:14 UcliEvt.log

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:20 pm
by Shivaramakrishnan
and when I change the permissions to 777
su nagios -s /bin/bash -c "/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular"
Controllers found: 0
Invalid controller number.

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:29 pm
by agriffin
Now that you've changed the permissions, does the plugin work? If it does, then instead of changing permissions on it to 777, you could set it to 775 and change its group to nagios. Then the permissions will behave exactly as before except that nagios will have access to it (instead of absolutely anybody being able to change it).

Code: Select all

chmod 775 /var/log/UcliEvt.log
chgrp nagios /var/log/UcliEvt.log

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:32 pm
by Shivaramakrishnan
samething


[root@dbs01-ple03 StorMan]# cd /var/log
[root@dbs01-ple03 log]# chmod 775 /var/log/UcliEvt.log
[root@dbs01-ple03 log]# chgrp nagios /var/log/UcliEvt.log
[root@dbs01-ple03 log]# su nagios -s /bin/bash -c "/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular"
Controllers found: 0
Invalid controller number.

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:34 pm
by Shivaramakrishnan
And the command works fine.

/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular
Controllers found: 1

ControllerLog
controllerID .................................... 0
type ............................................ 0
time ............................................ 1337204043
version ......................................... 3
tableFull ....................................... false

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ4Y4XM
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 1(1:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 9075
mediumErrors .................................... 22
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ5S7MB
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 0(0:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 309
mediumErrors .................................... 0
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ58T8W
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 7(7:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 212
mediumErrors .................................... 0
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ55KN5
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 4(4:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 21
mediumErrors .................................... 0
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ517TD
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 9(9:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 592
mediumErrors .................................... 0
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ5737E
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 13(13:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 200
mediumErrors .................................... 0
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... true
vendorID ........................................
serialNumber .................................... 9QJ5RKSL
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 3(3:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 7801
mediumErrors .................................... 46
smartWarning .................................... 0

driveErrorEntry
smartError ...................................... false
vendorID ........................................
serialNumber .................................... 9QJ5RNVG
wwn ............................................. 0000000000000000
deviceID(T:L) ............................ 2(2:0)
productID ....................................... ST310003
numParityErrors ................................. 0
linkFailures .................................... 0
hwErrors ........................................ 0
abortedCmds ..................................... 231
mediumErrors .................................... 0
smartWarning .................................... 0

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:39 pm
by agriffin
Sorry, I wasn't clear. I was asking you to run the nagios check again:

Code: Select all

su nagios -s /bin/bash -c "/usr/lib/nagios/plugins/check_arcconf.sh -w 50 -c 70"
Does it work with the new permissions?

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:42 pm
by Shivaramakrishnan
same old error

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 56: [: : integer expression expected
/usr/lib/nagios/plugins/check_arcconf.sh: line 60: [: : integer expression expected
RAID OK, numParityErrors, hwErrors, mediumErrors

Re: Nagios Server- Remote Plugin "Incorrect Values"

Posted: Wed May 16, 2012 4:54 pm
by agriffin
Hmm... are you sure it worked at all when run as root? I can't see anything else that would have caused that error, if I understood you correctly.