Skip to content

Instantly share code, notes, and snippets.

@egrieco
Created January 13, 2010 03:04
Show Gist options
  • Save egrieco/275883 to your computer and use it in GitHub Desktop.
Save egrieco/275883 to your computer and use it in GitHub Desktop.
# check command
define command {
command_name check_remote_disk
command_line $USER1$/check_by_ssh -p $ARG1$ -l nagios -i /usr/local/rep/nagios/auth/keys/nagios-utility-key -H $HOSTADDRESS$ -C 'check_disk -w $ARG2$ -c $ARG3$ -p $ARG4$'
}
# service definition
# contact groups are defined, I just have not included that here
define service {
service_description Partition Root
check_command check_remote_disk!22!20%!10%!/
}
# status information in nagios from the above
DISK CRITICAL - free space: / 319 MB (3% inode=67%):
# local command being run on the server
$ /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
# return status is 2, status output follows
DISK CRITICAL - free space: / 318 MB (3% inode=67%);| /=9248MB;8063;9071;0;10079
# so this is clearly an issue with check_by_ssh
# further evidence
# 'check_remote_dummy' command definition
define command {
command_name check_remote_dummy
command_line $USER1$/check_by_ssh -p $ARG1$ -l nagios -i /usr/local/rep/nagios/auth/keys/nagios-utility-key -H $HOSTADDRESS$ -C 'check_dummy $ARG2$ $ARG3$'
}
# Define a service to always fail, this should help diagnose the check_by_ssh bug
define service {
use fam-service
service_description Always Critical Test
check_command check_remote_dummy!22!2!"CRITICAL: This should always be CRITICAL"
notifications_enabled 0
}
# the above always shows up as ok even though it should only be in a critical state
Here are the versions of the three nagios plugins I have tested. All show the same behavior.
[root]# /usr/lib/nagios/plugins/check_by_ssh -V
check_by_ssh v2002 (nagios-plugins 1.4.12)
[root]# /usr/local/nagios/libexec/check_by_ssh -V
check_by_ssh v1.4.14 (nagios-plugins 1.4.14)
[root]# /usr/local/nagios-head/libexec/check_by_ssh -V
check_by_ssh v1.4.14-61-g45e2 (nagios-plugins 1.4.14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment