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 user@bastion.com -W %h:%p
Thanks.
Check_by_ssh and ProxyCommand
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check_by_ssh and ProxyCommand
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!
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
Thanks for your answer. I'll test it and post a result asap.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check_by_ssh and ProxyCommand
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
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
With check_by-ssh
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
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
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check_by_ssh and ProxyCommand
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!donypie wrote:It seems to work fine
Re: Check_by_ssh and ProxyCommand
Yes, thanks.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Check_by_ssh and ProxyCommand
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!