Monitoring hosts using ssh quick test?
I've downloaded and installed the Nagios official plugin (nagios-plugins-2.2.1.tar.gz) on a Redhat host machine.
From Nagios XI server command prompt, I run this command to do a quick test:
/usr/local/nagios/libexec/check_by_ssh -H 10.155.20.60 -C uptime -l testuser1
This gives me the error "Remote command execution failed"
When I run this command targeting another Redhat host machine, it works by returning an expected response.
Is there a test that I can do on the remote machine itself to verify if the plugin is correctly installed and working?
thanks,
ik
Monitoring hosts using ssh quick test?
Re: Monitoring hosts using ssh quick test?
check_by_ssh doesn't require anything installed on the remote machine other than to be able to connect via SSH. So try this from your Nagios host (make sure you're su'ed to the nagios user, not testing as root):
If that doesn't work, you'll need to fix things there, first.
Code: Select all
ssh <remote host> uptime
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Monitoring hosts using ssh quick test?
@eloyd,
thanks, I did this command and works without password prompt and I get a successful response:
ssh [email protected] uptime
So what would be the best way for me to troubleshoot the target host which has the 50 official nagios plugins, specifically with this command:
/usr/local/nagios/libexec/check_by_ssh -H 10.155.20.60 -C uptime -l testuser1
thanks, I did this command and works without password prompt and I get a successful response:
ssh [email protected] uptime
So what would be the best way for me to troubleshoot the target host which has the 50 official nagios plugins, specifically with this command:
/usr/local/nagios/libexec/check_by_ssh -H 10.155.20.60 -C uptime -l testuser1
Re: Monitoring hosts using ssh quick test?
Does it just say "remote execution failed" or does it also provide some additional information?
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Monitoring hosts using ssh quick test?
Yes, not much detail on the error message - here is the complete message.
[nagios@null-0800270406a2 root]$ /usr/local/nagios/libexec/check_by_ssh -H 10.155.20.60 -C "/usr/local/nagios/libexec/check_disk /" -l testuser1
Remote command execution failed: Welcome to rhel-s24me.dev.abcd.cloud.xyz.com!
thanks,
ik
[nagios@null-0800270406a2 root]$ /usr/local/nagios/libexec/check_by_ssh -H 10.155.20.60 -C "/usr/local/nagios/libexec/check_disk /" -l testuser1
Remote command execution failed: Welcome to rhel-s24me.dev.abcd.cloud.xyz.com!
thanks,
ik
Re: Monitoring hosts using ssh quick test?
Does testuser1 on 10.155.20.60 have some sort of restricted shell or locked password or some such security thingy?
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Monitoring hosts using ssh quick test?
I'm guessing it does. The target host is managed by another team and uses SALT for configuring the system and is residing on a separate network and I don't have the knowledge of what is being restricted so it is hard for me to troubleshoot.
That is why if I can isolate the problem by running some sort of test from the target host itself and hoping that can reveal the root cause is.
Since the plugins are installed on the target host, is there a way for me to execute some command that will show that check_by_ssh plugin is working?
thanks,
ik
That is why if I can isolate the problem by running some sort of test from the target host itself and hoping that can reveal the root cause is.
Since the plugins are installed on the target host, is there a way for me to execute some command that will show that check_by_ssh plugin is working?
thanks,
ik
Re: Monitoring hosts using ssh quick test?
Well, if you do this on your Nagios host (assuming you start as the root user), it will prove something's weird on the other side or not:
If that works, then something wonky is going on with Nagios. If that doesn't work, then something wonky is going on with the remote system.
Code: Select all
# su - nagios
# ssh -l testuser1 10.155.20.60 "/usr/bin/uptime"
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Monitoring hosts using ssh quick test?
If I'm understanding you correctly, I'm executing these commands on the Nagios XI server command line:
[root@null-0800270406a2 ~]# su - nagios
[nagios@null-0800270406a2 ~]$ ssh -l testuser1 10.155.20.60 "/usr/bin/uptime"
This host is managed by SaltStack!
16:39:04 up 20 days, 11:30, 1 user, load average: 0.28, 0.14, 0.08
This works - so what would be the reason this working leads to the conclusion "something wonky is going on with Nagios"?
thanks,
ik
[root@null-0800270406a2 ~]# su - nagios
[nagios@null-0800270406a2 ~]$ ssh -l testuser1 10.155.20.60 "/usr/bin/uptime"
This host is managed by SaltStack!
16:39:04 up 20 days, 11:30, 1 user, load average: 0.28, 0.14, 0.08
This works - so what would be the reason this working leads to the conclusion "something wonky is going on with Nagios"?
thanks,
ik