What is the "-d" flag? I don't see this as a option in the usage page... It seems like that if the thresholds are placed AFTER the path in the command, they are not being considered... For example:
This will should work correctly:
Code: Select all
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk -w 20% -c 10% /"
DISK OK - free space: / 6983 MB (41% inode=86%);| /=9796MB;14137;15904;0;17672
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk -w 45% -c 35% /"
DISK WARNING - free space: / 6983 MB (41% inode=86%);| /=9796MB;9719;11486;0;17672
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk -w 60% -c 50% /"
DISK CRITICAL - free space: / 6983 MB (41% inode=86%);| /=9796MB;7068;8836;0;17672
but this won't (it will always show "OK"):
Code: Select all
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk / -w 20% -c 10%"
DISK OK - free space: / 6983 MB (41% inode=86%);| /=9796MB;;;0;17672
You have new mail in /var/spool/mail/root
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk / -w 45% -c 35%"
DISK OK - free space: / 6982 MB (41% inode=86%);| /=9796MB;;;0;17672
[nagios@testbox libexec]$ ./check_by_ssh -H 192.168.x.x -C "/usr/local/nagios/libexec/check_disk / -w 60% -c 50%"
DISK OK - free space: / 6982 MB (41% inode=86%);| /=9796MB;;;0;17672
Don't worry about this output:
OUTPUT: Remote command execution failed: Could not create directory '/var/www/.ssh'.
Testing from the CCM is not 100% reliable (it doesn't work with all checks) and it's not supposed to be a substitute for testing from the CLI.
Go to the CCM->Services, and modify the text in the $ARG1$ field as such:
Code: Select all
-C "/opt/nagios/libexec/check_disk -w 20 -c 10 /export/home"
Save and Apply Configuration. Go to Home->Service Detail, click on the service and schedule an immediate check to see if you are going to get the correct output this time.
Note: You can use whatever thresholds you need to. This is just an example.