Page 2 of 3

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 3:52 pm
by dwhitfield
What's the output of /usr/local/nagios/libexec/check_uptime on the remote server?

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 3:53 pm
by baber
dwhitfield wrote:What's the output of /usr/local/nagios/libexec/check_uptime on the remote server?

Code: Select all

/usr/local/nagios/libexec/check_uptime
Uptime OK: 16 day(s) 23 hour(s) 30 minute(s) | uptime=24450.000000;;;


Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 4:14 pm
by ruffsense
what are the permissions of check_ssh?

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 4:16 pm
by baber
ruffsense wrote:what are the permissions of check_ssh?

this is on nagios server

Code: Select all

-rwxr-xr-x. 1 nagios nagios 183476 May 26  2016 /usr/local/nagios/libexec/check_by_ssh

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 4:23 pm
by dwhitfield
What user did you run /usr/local/nagios/libexec/check_uptime as on the remote server? Was in nagios? If not, can you try that.

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 4:29 pm
by baber
dwhitfield wrote:What user did you run /usr/local/nagios/libexec/check_uptime as on the remote server? Was in nagios? If not, can you try that.

i run this command with nagios user on remote server

Code: Select all

[nagios@nppptgs root]$ /usr/local/nagios/libexec/check_uptime
Uptime OK: 17 day(s) 0 hour(s) 4 minute(s) | uptime=24484.000000;;;


also run that command with root user on remote server

Code: Select all

[root@nppptgs ~]# /usr/local/nagios/libexec/check_uptime
Uptime OK: 17 day(s) 0 hour(s) 5 minute(s) | uptime=24485.000000;;;


Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 5:00 pm
by dwhitfield
This is the same server with the NRPE issue, yes? Is that server in production? If not, it might be easier at this point to just start over with that server and go back to NRPE since you have that working on your other servers.

Re: how can monitor with check_by_ssh

Posted: Thu Dec 01, 2016 6:28 pm
by baber
dwhitfield wrote:This is the same server with the NRPE issue, yes? Is that server in production? If not, it might be easier at this point to just start over with that server and go back to NRPE since you have that working on your other servers.

yes this is the same server and this sever is in production site and is so important

sshd config file was ok ?

I think problem is sshd_conf file on remote host for example i said previously can not login with root user directly to server first have to login with user X Then su -
What is your idea??

Re: how can monitor with check_by_ssh

Posted: Fri Dec 02, 2016 3:03 am
by baber
baber wrote:
dwhitfield wrote:This is the same server with the NRPE issue, yes? Is that server in production? If not, it might be easier at this point to just start over with that server and go back to NRPE since you have that working on your other servers.

yes this is the same server and this sever is in production site and is so important

sshd config file was ok ?

I think problem is sshd_conf file on remote host for example i said previously can not login with root user directly to server first have to login with user X Then su -
What is your idea??

So many thanks from all of friends

problem has been solved with add switch E at the end of command line

/usr/local/nagios/libexec/check_by_ssh -H 10.10.10.10 -C 'uptime' -E

Re: how can monitor with check_by_ssh

Posted: Fri Dec 02, 2016 10:10 am
by dwhitfield
For others coming to this thread later, from the man page at http://nagios-plugins.org/doc/man/check_by_ssh.html
-E, --skip-stderr[=n]
Ignore all or (if specified) first n lines on STDERR [optional]
@baber, we ready to lock this up?