Page 1 of 1

check_ssh is giving connection Refused

Posted: Wed May 01, 2019 12:09 pm
by amitgupta19
I am using the Nagios Core 4.4.3.

Suddenly check_ssh is giving the error for 2 servers as , connection refused.

But we are able to login to the server using the Putty/SSH.

Why the alert got triggered, if we are able to login to the server.

Re: check_ssh is giving connection Refused

Posted: Wed May 01, 2019 2:59 pm
by cdienger
Are you logging into the server from the XI machine or from another machine?

Check the firewalls to make sure tcp port 22 traffic is being allowed from the XI machine to the remote machine.

Also run "nmap -p 22 remote_server_ip" on the XI server's command line and check to see if it is filtered.

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 7:33 am
by amitgupta19
Are you logging into the server from the XI machine or from another machine?
Yes i am logging into the remote server using the Nagios Core Machine.

Check the firewalls to make sure tcp port 22 traffic is being allowed from the XI machine to the remote machine.
There are no firewalls between the 2 systems.


Also run "nmap -p 22 remote_server_ip" on the XI server's command line and check to see if it is filtered.
From the Nagios Server to the remote host, nmap is giving the following result

[XXXXXXX@cblXXgios01 ~]$ nmap -p 22 XXX.XXX.XXX.XXX(Remote Host IP)

Starting Nmap 6.40 ( http://nmap.org ) at 2019-05-06 05:24 PDT
Nmap scan report for labmwcp6.xxx.ad.giacloud (xxx.xxx.xxx.xxx)
Host is up (0.00038s latency).
PORT STATE SERVICE
22/tcp closed ssh

Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds


Does this mean the port 22 is closed? But we are still able to login to the server using the Putty.

How's it is possible?

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 9:20 am
by cdienger
It would appear to be down from the Core machine's perspective. What putty command are you running on the core machine to test it? Is the port something other than 22? Are you able to connect from the core machine using "ssh labmwcp6.xxx.ad.giacloud" ?

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 9:29 am
by amitgupta19
It would appear to be down from the Core machine's perspective. What putty command are you running on the core machine to test it? Is the port something other than 22? Are you able to connect from the core machine using "ssh labmwcp6.xxx.ad.giacloud" ?

I am using the Putty Application to connect to the server and the default port 22.

when i do the ssh <IP Address> it is giving me the following error:
ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused

Kindly suggest.

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 10:10 am
by cdienger
There could be a firewall between the Core machine and remote server. I would also check the iptables on the Core machine:

iptables -L

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 10:31 am
by amitgupta19
ok i am checking in the remote host.

Re: check_ssh is giving connection Refused

Posted: Mon May 06, 2019 10:41 am
by cdienger
Sounds good. Keep us posted.