Help with check_by_ssh command

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gar1027
Posts: 2
Joined: Fri Sep 06, 2013 5:29 pm

Help with check_by_ssh command

Post by gar1027 »

I'm using this command on Server B to monitor Server C. Within that command is a check_ping command that checks Server C's availability. My nagios server is on Server A. When I manually invoke the following command from my nagios server, it appears to work:

check_by_ssh -H <server B IP address> -C "/usr/local/nagios/plugins/check_ping -H <public IP address of server C omitted> -w 400.0,20% -c 1000.0,50%"

Response I get back is "Ping OK - Packet loss = o%, RTA - 85.99 ms|rta=85.986000ms;400.000000;1000.000000;0.000000 pl=0%;20;50;0"

However, when nagios runs this command, it just pings Server B on the local subnet; Server B doesn't seem to be pinging Server C on the Internet. My check_by_ssh command is missing something but not sure what:

New command is defined as "check_serverC"; it has: command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C "/usr/local/nagios/plugins/check_ping -H <public IP address of server C omitted> -w 400.0,20% -c 1000.0,50%"

My relevant line in my new service definition is: check_command check_serverC!400.0,20%!900.0,60%

Any ideas?
gar1027
Posts: 2
Joined: Fri Sep 06, 2013 5:29 pm

Re: Help with check_by_ssh command

Post by gar1027 »

Problem solved. My service definition was passing arguments when it actually doesn't need to. Once I changed "check_command check_serverC!400.0,20%!900.0,60% to
"check_command check_serverC" it worked fine.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Help with check_by_ssh command

Post by sreinhardt »

Awesome! glad to hear its working.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked