Page 1 of 1
Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 3:12 am
by shailu2014
Hi,
I have configured Nagios XI on Centos 6.3, when I opened Nagios XI GUI and checked the localhost giving the CRITICAL alert on SSH.(current port 22)
Can someone help how to change the default SSH port on Nagios XI so that CRITICAL alert change to OK status.(Screen Shot attached)
Thanks & Appreciation in Advance...
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 7:56 am
by eloyd
The service check "check_ssh" allows for ARG1 to be set to something and passed in to the check. Set ARG1 to "-p PORT" with PORT set to whatever the port is that your ssh server is listening on and you'll be all set.
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 10:51 am
by shailu2014
I have configured ARG1 to "-p PORT" is not working and still giving the same error.
Can you give me some document to change the SSH default port.
Thanks & Appreciation in Advance...
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 10:57 am
by eloyd
Are you literally using "-p PORT" or are you changing PORT to be the non-standard port number that you're using for your SSH server?
Here's an example of a working configuration in XI, though I have changed the port numbers and machine names for security reasons. Note that ARG1 has been set to the non-standard port of 2222 by using "-p 2222"
ssh.jpg
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 11:58 am
by rkennedy
Thanks @eloyd! He is right, see the command here -
Code: Select all
[root@localhost libexec]# ./check_ssh -p 2022 127.0.0.1
connect to address 127.0.0.1 and port 2022: Connection refused
If you are still seeing issues after configuring similar to the screenshot above, please post your full service definition.
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 1:20 pm
by shailu2014
after given the non-standard port -p 5566 in $ARG1$, it is working fine now.
Thanks & Appreciation of your help, please now you can close this case.
Thanks Again.........

Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 1:22 pm
by eloyd
Glad to be of help.
Re: Change the SSH default port on localhost NagiosXI
Posted: Fri Apr 15, 2016 1:32 pm
by bwallace
Glad to hear this is resolved, so closing this one out now - thanks again eloyd