Page 1 of 1
Check_by_ssh and ProxyCommand
Posted: Tue Oct 11, 2016 8:52 am
by donypie
Hi all,
I would like to execute nagios plugins by using check_by_ssh. But, for security zones (DMZ), I have to pass by a proxy and so I would like to use the principle of Bastion host (SSH through the bastion).
Can you please tell me if I can use the ProxyCommand with check_by_ssh ?
Host destination.com
ProxyCommand ssh
[email protected] -W %h:%p
Thanks.
Re: Check_by_ssh and ProxyCommand
Posted: Tue Oct 11, 2016 4:46 pm
by dwhitfield
According to this article
http://blog.jasonantman.com/2009/10/nag ... h-and-nat/ it should be possible, but we have not tested this specifically.
I would like to note that that article is from 2009, so it might not be valid. It will depend upon, among other things, your version of Core. For the help of the community, do you mind posting your version of Core and whether you can get it working? Thanks!
Re: Check_by_ssh and ProxyCommand
Posted: Wed Oct 12, 2016 1:46 am
by donypie
Thanks for your answer. I'll test it and post a result asap.
Re: Check_by_ssh and ProxyCommand
Posted: Wed Oct 12, 2016 9:34 am
by dwhitfield
What's your version of Core? That information will help community members test. Also, what OS and version are you running? That will help me get you your Nagios version # in case you don't know what it is. Thanks!
Re: Check_by_ssh and ProxyCommand
Posted: Thu Oct 13, 2016 7:23 am
by donypie
Hi all,
I have installed the current version of Nagiosxi (trial version - so I run Nagios Core 4.1.1.) running on a Centos server, a nagios proxy server and a nagios client also running on Centos; and tested SSH through the bastion. It seems to work fine in command line and with check_by_ssh :
Command line
Code: Select all
ssh -o ProxyCommand="ssh -q -W %h:%p nagios-proxy" nagios-client -C uptime
14:53:46 up 1 day, 2:37, 1 user, load average: 0.00, 0.01, 0.05
With check_by-ssh
Code: Select all
[nagios@nagios-server libexec]$ ./check_by_ssh -v -H 10.29.2.28 -o ProxyCommand="ssh -q -W %h:%p nagios-proxy" -C uptime
Command: /usr/bin/ssh
Argument 1: -o
Argument 2: ProxyCommand=ssh -q -W %h:%p nagios-proxy
Argument 3: 10.29.2.28
Argument 4: uptime
14:53:56 up 1 day, 2:37, 1 user, load average: 0.00, 0.01, 0.05
Re: Check_by_ssh and ProxyCommand
Posted: Thu Oct 13, 2016 9:27 am
by dwhitfield
donypie wrote:It seems to work fine
Based on your statement, and your post happy face icon, I think you are good to go. Is it ok for us to lock this up? Thanks!
Re: Check_by_ssh and ProxyCommand
Posted: Fri Oct 14, 2016 3:08 am
by donypie
Yes, thanks.
Re: Check_by_ssh and ProxyCommand
Posted: Fri Oct 14, 2016 8:54 am
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!