check_nrpe :connection refused by host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

check_nrpe :connection refused by host

Post by Frédéric GRANAT »

Hi,
I installed the nsclient++ 0.4.1 x64.
And I 've got the error connection refused by host when runnin check_nrpe -H myhost for Nagios server.
Please find attached the nsclient.ini.

Rgds,

Frederic
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe :connection refused by host

Post by slansing »

Enable:

Code: Select all

allow arguments = true

Code: Select all

allow nasty characters = true
Then restart the nsclient service and try checking again. Is that all that you have in your nsclient server? Are you actually trying to run a check at this point, or just trying to connect to NRPE.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: check_nrpe :connection refused by host

Post by Frédéric GRANAT »

Hi,
I applied the changes : still doesn't work.
It was working before with an old version of nsclient (NSC.ini file).
But with the new version I have to create a new file nsclient.ini and it's complicated

I test that new version because we have a problem with backupexec monitoring since the beginning of the week :
Several check_be.exe processes consuming all the CPU.

I'm trying to run the checks listed in the nsclient.ini.
But first I have to try to connect to my server.

Rgds,

Frederic
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: check_nrpe :connection refused by host

Post by sujitt »

1. Try running the nsclient and check versions on both server and client.
2. Hope allowed hosts is configured right in the ini , allow local host also and run check_nrpe against localhost
3. check if windows firewall is blocking ports
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_nrpe :connection refused by host

Post by tmcdonald »

I have to ask, just in case, but when you have:

Code: Select all

allowed hosts = nagiosserverip
I am assuming you actually have the IP in there?

Also, did the firewall settings change in-between the versions? Port 5666 will need to be open. Are you certain the nsclient service is running?
Former Nagios employee
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: check_nrpe :connection refused by host

Post by Frédéric GRANAT »

Hi,
I am assuming you actually have the IP in there?
=> yes
Also, did the firewall settings change in-between the versions?
=> No
Port 5666 will need to be open.
=> Opened
Are you certain the nsclient service is running?
=>YEs
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_nrpe :connection refused by host

Post by abrist »

Is there a reason for running nsclient 0.4.x? We still suggest .3.9.x . . .
Run nmap from the nagios server against the remote host:

Code: Select all

nmap <windows server ip> -p 5666
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: check_nrpe :connection refused by host

Post by Frédéric GRANAT »

Hi

Previously I used 3.9
As I already said I test that new version because we have a problem with backupexec monitoring since the beginning of the week :
Several check_be.exe processes consuming all the CPU.

Here is the result of nmap

Starting Nmap 5.51 ( http://nmap.org ) at 2014-04-09 14:46 CEST
Nmap scan report for server (xxx.xx.x.xx)
Host is up (0.00064s latency).
rDNS record for xxx.xx.x.xx: server.domain
PORT STATE SERVICE
5666/tcp closed nrpe
MAC Address: 00:19:BB:CC:EB:94 (Hewlett Packard)

Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe :connection refused by host

Post by slansing »

You need to make sure port 5666 is open on the system. Right now it is closed.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: check_nrpe :connection refused by host

Post by Frédéric GRANAT »

Hi,
I checked : Everything is open on the server.
But not process listening on port 5666 as you can see below (whereas nsclient is configured to listen to port 5666).

PS C:\Users\support> netstat -a

Connexions actives

Code: Select all

  Proto  Adresse locale         Adresse distante       État
  TCP    0.0.0.0:21             SERVER:0       LISTENING
  TCP    0.0.0.0:135            SERVER:0       LISTENING
  TCP    0.0.0.0:445            SERVER:0       LISTENING
  TCP    0.0.0.0:1688           SERVER:0       LISTENING
  TCP    0.0.0.0:2301           SERVER:0       LISTENING
  TCP    0.0.0.0:2381           SERVER:0       LISTENING
  TCP    0.0.0.0:3389           SERVER:0       LISTENING
  TCP    0.0.0.0:5633           SERVER:0       LISTENING
  TCP    0.0.0.0:6101           SERVER:0       LISTENING
  TCP    0.0.0.0:6106           SERVER:0       LISTENING
  TCP    0.0.0.0:6129           SERVER:0       LISTENING
  TCP    0.0.0.0:10000          SERVER:0       LISTENING
  TCP    0.0.0.0:10082          SERVER:0       LISTENING
  TCP    0.0.0.0:10102          SERVER:0       LISTENING
  TCP    0.0.0.0:47001          SERVER:0       LISTENING
  TCP    0.0.0.0:49152          SERVER:0       LISTENING
  TCP    0.0.0.0:49153          SERVER:0       LISTENING
  TCP    0.0.0.0:49154          SERVER:0       LISTENING
  TCP    0.0.0.0:49171          SERVER:0       LISTENING
  TCP    0.0.0.0:49198          SERVER:0       LISTENING
  TCP    0.0.0.0:49199          SERVER:0       LISTENING
  TCP    0.0.0.0:49271          SERVER:0       LISTENING
  TCP    0.0.0.0:55555          SERVER:0       LISTENING
  TCP    127.0.0.1:10085        SERVER:0       LISTENING
  TCP    127.0.0.1:14147        SERVER:0       LISTENING
  TCP    127.0.0.1:14147        SERVER:53374   ESTABLISHED
  TCP    127.0.0.1:14147        SERVER:61875   ESTABLISHED
  TCP    127.0.0.1:53374        SERVER:14147   ESTABLISHED
  TCP    127.0.0.1:61875        SERVER:14147   ESTABLISHED
  TCP    172.16.6.10:139        SERVER:0       LISTENING
  TCP    172.16.6.10:3389       5004401-ju:60245       ESTABLISHED
  TCP    172.16.6.10:49269      w2k-fs02:microsoft-ds  ESTABLISHED
  TCP    172.16.6.10:49270      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49270   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49299   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49321   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49322   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49324   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:49325   ESTABLISHED
  TCP    172.16.6.10:49271      SERVER:51627   ESTABLISHED
  TCP    172.16.6.10:49299      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:49306      w2k-fs02:microsoft-ds  ESTABLISHED
  TCP    172.16.6.10:49321      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:49322      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:49324      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:49325      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:50108      w2k-fs02:microsoft-ds  ESTABLISHED
  TCP    172.16.6.10:51289      ws-dc01:49155          TIME_WAIT
  TCP    172.16.6.10:51390      SERVER:49271   TIME_WAIT
  TCP    172.16.6.10:51528      ws-dc01:49159          TIME_WAIT
  TCP    172.16.6.10:51627      SERVER:49271   ESTABLISHED
  TCP    172.16.6.10:51628      ws-dc01:49159          ESTABLISHED
  TCP    172.16.6.10:52658      w2k-fs02:microsoft-ds  ESTABLISHED
  TCP    172.16.6.10:55555      ws-tm02:54110          TIME_WAIT
  TCP    172.16.6.10:64989      w2k8-backup02:10000    ESTABLISHED
  TCP    172.16.6.10:65117      w2k8-backup02:50001    ESTABLISHED
  TCP    [::]:21                SERVER:0       LISTENING
  TCP    [::]:135               SERVER:0       LISTENING
  TCP    [::]:445               SERVER:0       LISTENING
  TCP    [::]:1688              SERVER:0       LISTENING
  TCP    [::]:2301              SERVER:0       LISTENING
  TCP    [::]:2381              SERVER:0       LISTENING
  TCP    [::]:3389              SERVER:0       LISTENING
  TCP    [::]:6101              SERVER:0       LISTENING
  TCP    [::]:6106              SERVER:0       LISTENING
  TCP    [::]:6129              SERVER:0       LISTENING
  TCP    [::]:10000             SERVER:0       LISTENING
  TCP    [::]:10082             SERVER:0       LISTENING
  TCP    [::]:10102             SERVER:0       LISTENING
  TCP    [::]:47001             SERVER:0       LISTENING
  TCP    [::]:49152             SERVER:0       LISTENING
  TCP    [::]:49153             SERVER:0       LISTENING
  TCP    [::]:49154             SERVER:0       LISTENING
  TCP    [::]:49171             SERVER:0       LISTENING
  TCP    [::]:49198             SERVER:0       LISTENING
  TCP    [::]:49199             SERVER:0       LISTENING
  TCP    [::]:49271             SERVER:0       LISTENING
  TCP    [::]:55555             SERVER:0       LISTENING
  TCP    [::1]:10082            SERVER:49532   ESTABLISHED
  TCP    [::1]:10082            SERVER:51440   TIME_WAIT
  TCP    [::1]:10082            SERVER:51445   TIME_WAIT
  TCP    [::1]:10082            SERVER:51449   TIME_WAIT
  TCP    [::1]:10082            SERVER:51459   TIME_WAIT
  TCP    [::1]:10082            SERVER:51464   TIME_WAIT
  TCP    [::1]:10082            SERVER:51468   TIME_WAIT
  TCP    [::1]:10082            SERVER:51483   TIME_WAIT
  TCP    [::1]:10082            SERVER:51487   TIME_WAIT
  TCP    [::1]:10082            SERVER:51502   TIME_WAIT
  TCP    [::1]:10082            SERVER:51517   TIME_WAIT
  TCP    [::1]:10082            SERVER:51522   TIME_WAIT
  TCP    [::1]:10082            SERVER:51542   TIME_WAIT
  TCP    [::1]:10082            SERVER:51559   TIME_WAIT
  TCP    [::1]:10082            SERVER:51564   TIME_WAIT
  TCP    [::1]:10082            SERVER:51578   TIME_WAIT
  TCP    [::1]:10082            SERVER:51583   TIME_WAIT
  TCP    [::1]:10082            SERVER:51597   TIME_WAIT
  TCP    [::1]:10082            SERVER:51606   TIME_WAIT
  TCP    [::1]:10082            SERVER:51616   TIME_WAIT
  TCP    [::1]:10082            SERVER:51621   TIME_WAIT
  TCP    [::1]:10082            SERVER:51625   TIME_WAIT
  TCP    [::1]:10082            SERVER:51637   TIME_WAIT
  TCP    [::1]:10082            SERVER:51646   TIME_WAIT
  TCP    [::1]:10085            SERVER:0       LISTENING
  TCP    [::1]:10085            SERVER:49327   ESTABLISHED
  TCP    [::1]:10085            SERVER:49328   ESTABLISHED
  TCP    [::1]:10085            SERVER:49351   ESTABLISHED
  TCP    [::1]:10085            SERVER:49356   ESTABLISHED
  TCP    [::1]:10102            SERVER:49354   ESTABLISHED
  TCP    [::1]:10102            SERVER:49376   ESTABLISHED
  TCP    [::1]:10102            SERVER:49752   ESTABLISHED
  TCP    [::1]:10102            SERVER:49755   ESTABLISHED
  TCP    [::1]:10102            SERVER:50048   ESTABLISHED
  TCP    [::1]:10102            SERVER:51430   TIME_WAIT
  TCP    [::1]:10102            SERVER:51433   TIME_WAIT
  TCP    [::1]:10102            SERVER:51436   TIME_WAIT
  TCP    [::1]:10102            SERVER:51452   TIME_WAIT
  TCP    [::1]:10102            SERVER:51455   TIME_WAIT
  TCP    [::1]:10102            SERVER:51471   TIME_WAIT
  TCP    [::1]:10102            SERVER:51474   TIME_WAIT
  TCP    [::1]:10102            SERVER:51493   TIME_WAIT
  TCP    [::1]:10102            SERVER:51513   TIME_WAIT
  TCP    [::1]:10102            SERVER:51530   TIME_WAIT
  TCP    [::1]:10102            SERVER:51533   TIME_WAIT
  TCP    [::1]:10102            SERVER:51549   TIME_WAIT
  TCP    [::1]:10102            SERVER:51552   TIME_WAIT
  TCP    [::1]:10102            SERVER:51555   TIME_WAIT
  TCP    [::1]:10102            SERVER:51571   TIME_WAIT
  TCP    [::1]:10102            SERVER:51574   TIME_WAIT
  TCP    [::1]:10102            SERVER:51590   TIME_WAIT
  TCP    [::1]:10102            SERVER:51593   TIME_WAIT
  TCP    [::1]:10102            SERVER:51609   TIME_WAIT
  TCP    [::1]:10102            SERVER:51612   TIME_WAIT
  TCP    [::1]:10102            SERVER:51630   TIME_WAIT
  TCP    [::1]:10102            SERVER:51633   TIME_WAIT
  TCP    [::1]:14147            SERVER:0       LISTENING
  TCP    [::1]:49187            SERVER:49188   ESTABLISHED
  TCP    [::1]:49188            SERVER:49187   ESTABLISHED
  TCP    [::1]:49189            SERVER:49190   ESTABLISHED
  TCP    [::1]:49190            SERVER:49189   ESTABLISHED
  TCP    [::1]:49319            SERVER:49320   ESTABLISHED
  TCP    [::1]:49320            SERVER:49319   ESTABLISHED
  TCP    [::1]:49327            SERVER:10085   ESTABLISHED
  TCP    [::1]:49328            SERVER:10085   ESTABLISHED
  TCP    [::1]:49351            SERVER:10085   ESTABLISHED
  TCP    [::1]:49354            SERVER:10102   ESTABLISHED
  TCP    [::1]:49356            SERVER:10085   ESTABLISHED
  TCP    [::1]:49357            SERVER:49358   ESTABLISHED
  TCP    [::1]:49358            SERVER:49357   ESTABLISHED
  TCP    [::1]:49376            SERVER:10102   ESTABLISHED
  TCP    [::1]:49532            SERVER:10082   ESTABLISHED
  TCP    [::1]:49752            SERVER:10102   ESTABLISHED
  TCP    [::1]:49755            SERVER:10102   ESTABLISHED
  TCP    [::1]:50048            SERVER:10102   ESTABLISHED
  TCP    [::1]:51433            SERVER:10102   TIME_WAIT
  TCP    [::1]:51445            SERVER:10082   TIME_WAIT
  TCP    [::1]:51449            SERVER:10082   TIME_WAIT
  TCP    [::1]:51455            SERVER:10102   TIME_WAIT
  TCP    [::1]:51474            SERVER:10102   TIME_WAIT
  TCP    [::1]:51478            SERVER:10082   TIME_WAIT
  TCP    [::1]:51490            SERVER:10102   TIME_WAIT
  TCP    [::1]:51497            SERVER:10082   TIME_WAIT
  TCP    [::1]:51506            SERVER:10082   TIME_WAIT
  TCP    [::1]:51510            SERVER:10102   TIME_WAIT
  TCP    [::1]:51522            SERVER:10082   TIME_WAIT
  TCP    [::1]:51526            SERVER:10082   TIME_WAIT
  TCP    [::1]:51537            SERVER:10082   TIME_WAIT
  TCP    [::1]:51546            SERVER:10082   TIME_WAIT
  TCP    [::1]:51564            SERVER:10082   TIME_WAIT
  TCP    [::1]:51568            SERVER:10082   TIME_WAIT
  TCP    [::1]:51574            SERVER:10102   TIME_WAIT
  TCP    [::1]:51587            SERVER:10082   TIME_WAIT
  TCP    [::1]:51590            SERVER:10102   TIME_WAIT
  TCP    [::1]:51602            SERVER:10082   TIME_WAIT
  TCP    [::1]:51612            SERVER:10102   TIME_WAIT
  TCP    [::1]:51621            SERVER:10082   TIME_WAIT
  TCP    [::1]:51642            SERVER:10082   TIME_WAIT
  UDP    0.0.0.0:123            *:*
  UDP    0.0.0.0:161            *:*
  UDP    0.0.0.0:500            *:*
  UDP    0.0.0.0:1434           *:*
  UDP    0.0.0.0:4500           *:*
  UDP    0.0.0.0:5355           *:*
  UDP    0.0.0.0:6129           *:*
  UDP    127.0.0.1:57913        *:*
  UDP    127.0.0.1:58105        *:*
  UDP    127.0.0.1:58390        *:*
  UDP    127.0.0.1:59116        *:*
  UDP    127.0.0.1:60033        *:*
  UDP    127.0.0.1:60035        *:*
  UDP    127.0.0.1:63849        *:*
  UDP    172.16.6.10:137        *:*
  UDP    172.16.6.10:138        *:*
  UDP    [::]:123               *:*
  UDP    [::]:161               *:*
  UDP    [::]:500               *:*
  UDP    [::]:1434              *:*
  UDP    [::]:4500              *:*
  UDP    [::]:6129              *:*
  UDP    [::1]:59408            *:*
Mod Note: Please use code wraps for long output
Locked