Nagios Server- Remote Plugin "Incorrect Values"
-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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
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"
What happens if you run this command:
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.
Code: Select all
su nagios -s /bin/bash -c "/usr/StorMan/arcconf GETLOGS 1 DEVICE tabular"-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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
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
-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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.
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"
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-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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.
[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.
-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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
/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"
Sorry, I wasn't clear. I was asking you to run the nagios check again:
Does it work with the new permissions?
Code: Select all
su nagios -s /bin/bash -c "/usr/lib/nagios/plugins/check_arcconf.sh -w 50 -c 70"-
Shivaramakrishnan
- Posts: 71
- Joined: Tue May 15, 2012 10:11 pm
Re: Nagios Server- Remote Plugin "Incorrect Values"
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
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"
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.