how can monitor with check_by_ssh

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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how can monitor with check_by_ssh

Post by dwhitfield »

What's the output of /usr/local/nagios/libexec/check_uptime on the remote server?
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

Re: how can monitor with check_by_ssh

Post 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;;;

Last edited by baber on Fri Dec 02, 2016 3:04 am, edited 2 times in total.
User avatar
ruffsense
Posts: 140
Joined: Thu Apr 11, 2013 12:40 am

Re: how can monitor with check_by_ssh

Post by ruffsense »

what are the permissions of check_ssh?
I don't insult, I diagnose.
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

Re: how can monitor with check_by_ssh

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how can monitor with check_by_ssh

Post 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.
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

Re: how can monitor with check_by_ssh

Post 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;;;

dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how can monitor with check_by_ssh

Post 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.
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

Re: how can monitor with check_by_ssh

Post 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??
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

Re: how can monitor with check_by_ssh

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how can monitor with check_by_ssh

Post 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?
Locked