[Nagiosplug-help] check_by_ssh
Gavin Snelgrove
gavin.snelgrove at gmail.com
Thu Apr 24 22:40:56 CEST 2008
Hello,
I am trying to get the check_by_ssh plug-in to work but seem to be having
some issues
Nagios is working fine and I followed this guide to get it working in Ubuntu
7.10
https://help.ubuntu.com/community/Nagios2
I have been following this link as my guide for check_by_ssh.
https://services.ibb.gatech.edu/wiki/index.php/Howto:Software:Nagios:Check_By_SSH
The Remote server is running CentOS 5. I used the RPM package on the
following link to install the plug-ins on the remote server. (Do I need the
check_by_ssh plug-in to be installed on the remote server as well?)
http://dag.wieers.com/rpm/packages/nagios-plugins/
I have gotten the SSH public key working so that I can connect via SSH as
the Nagios user without a password.
In the Nagios Web interface I see the following error:
(Return code of 127 is out of bounds - plugin may be missing)
In the Nagios logs I see the following error:
[1209068727] Warning: Return code of 127 for check of service 'SSH Check
Disk' on host 'host.domainname.com' was out of bounds. Make sure the plugin
you're trying to run actually exists.
I don't want to provide too much information right off the start. Let me
know what else you need or if you have any suggestions as to what I should
try.
Thank You,
Gavin
>From the check_by_ssh guide in the link above this is my altered version of
the script they give:
#!/bin/bash
# Usage:\n cbs.sh <testname>\nPossible valid testnames: load, proc, disk,
swap, user.
PATH="/usr/lib/nagios/plugins/check_"
LDOPTS="-w 15,10,5 -c 30,25,20"
DSKOPT="-w 20 -c 10 -p /dev/sda2"
PROPTS="-w 150 -c 200"
SWOPTS="-w 15 -c 5"
USOPTS="-w 20 -c 50"
SSHOPT=`echo $SSH_ORIGINAL_COMMAND | { read first last; echo $last; }`
if [ -z $SSHOPT ]; then
SSHOPT=$SSH_ORIGINAL_COMMAND
fi
case $SSHOPT in
load | LOAD ) RET=`${PATH}load $LDOPTS` ; x=$? ;;
disk | DISK ) RET=`${PATH}disk $DSKOPT` ; x=$? ;;
proc | PROC ) RET=`${PATH}procs $PROPTS` ; x=$? ;;
swap | SWAP ) RET=`${PATH}swap $SWOPTS` ; x=$? ;;
user | USER ) RET=`${PATH}users $USOPTS` ; x=$? ;;
* ) RET="Invalid check command: $SSHOPT" ; x=2 ;;
esac
echo $RET
exit $x
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20080424/de6b8531/attachment.html>
More information about the Help
mailing list