Page 1 of 2
check_by_ssh out of bounds
Posted: Tue Feb 25, 2014 3:14 pm
by iivanyi
Hello,
I've run out of options, so I'm wondering what/where I've gone wrong. I've setup a linux host for check_by_ssh in XI. This works fine.
I have also setup 2 Solaris hosts in the same way.
Example:
###############################################################################
define service {
<snip>
check_command check_xi_by_ssh!'check_init_service cron'!!!!!!!
</snip>
###############################################################################
This is exactly the same for the Linux system.
Unfortunately all service checks are returning "out of bounds within the gui.
via command line as user Nagios this runs fine:
$ /usr/local/nagios/libexec/check_by_ssh -E -t 60 -H REMOTEHOST -C 'check_init_service cron'
online Oct_22 svc:/system/cron:default
I can login remotely without password obviously...
Note, the remote user, on all systems is using restricted bash, I don't think this is the issue as the checks are running from command line
Re: check_by_ssh out of bounds
Posted: Tue Feb 25, 2014 4:05 pm
by lmiltchev
Run the following command on the remote box and show us the output:
Re: check_by_ssh out of bounds
Posted: Tue Feb 25, 2014 5:02 pm
by iivanyi
/etc/group
anothergroup:

nagios,anotheruser
nagios::50110:
/etc/passwd
nagios

50110:50110:Nagios Monitoring System:/home/nagios:/bin/rbash
nagios:nagios is connecting to remote system as user nagios for clarification
Re: check_by_ssh out of bounds
Posted: Tue Feb 25, 2014 5:34 pm
by iivanyi
note also this is the current check_xi_by_ssh command config
$USER1$/check_by_ssh -E -t 60 -H $HOSTADDRESS$ -C $ARG1$
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 10:55 am
by iivanyi
the following is returning ok in web ui,
check_command check_xi_by_ssh!'echo OK'!!!!!!!
so I am still at a loss to see where I can see an error/return code isn't functionning properly, I did add -v check_by_ssh command
this reported the command-line in web ui against the Linux host, but still out of bounds against solaris host
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 12:03 pm
by lmiltchev
It sounds like a permissions issue... Is "check_init_service" the only check that you are having issues with on the Solaris box? Can you run other nagios checks, for example:
Code: Select all
$ /usr/local/nagios/libexec/check_by_ssh -E -t 60 -H REMOTEHOST -C '/opt/nagios/libexec/check_users -w 2 -c 5'
Note: Your path may be different.
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 12:49 pm
by iivanyi
no all checks work from command-line
[nagios@nagiosserver ~]$ /usr/local/nagios/libexec/check_by_ssh -v -q -E -t 60 -H solarishost "check_swap -w 30% -c 20%"
/usr/bin/ssh -q solarishost 'check_swap -w 30% -c 20%'
SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0
service definition:
check_command check_xi_by_ssh!'check_swap -w 90% -c 80%'!!!!!!!
All work for the Linux hosts, none except "echo" work for the Solaris systems.
I even tried check_dummy, which was also reportin out of bounds
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 1:26 pm
by lmiltchev
All work for the Linux hosts, none except "echo" work for the Solaris systems.
My understanding was that the following command, run in the CLI:
Code: Select all
$ /usr/local/nagios/libexec/check_by_ssh -E -t 60 -H REMOTEHOST -C 'check_init_service cron'
worked fine for you, when you run it against the Solaris host, but it showed "out of bounds" in the GUI...
Can you run the command locally on the Solaris box as the nagios user, and show us the output?
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 1:33 pm
by iivanyi
:/home/nagios $ check_disk -w 30% -c 20% -A
DISK OK - free space: / 5775 MB
:/home/nagios $ check_procs
PROCS OK: 73 processes | procs=73;;;0;
etc...
I'd say something in profile not being read but I'm having trouble seeing why it would work via command-line check-by-ssh
Re: check_by_ssh out of bounds
Posted: Wed Feb 26, 2014 3:08 pm
by iivanyi
some more background perhaps,
I have 2 solaris packages, one containing the plugins (checks) which based on architecture will create a symbolic link between i386 or sparc directory -> libexec
and one package that creates the intended user (no difference between platform)
I've extended my testing a bit and x86 is working with no issues. And yet another SPARC is failing.
binaries, and scripts work on SPARC with NRPE without any issues, however we need to use ssh on a small subset.