Page 1 of 2

Server showing a Connection Refused

Posted: Wed Jun 03, 2015 7:24 am
by nathanplatt
HI Everyone,

I'm currently setting up services on our servers, so far I've installed NSCP++ on two of our production servers, TS1 and TS2. I have TS1/2 setup the same way the nsclient.ini states;

[/settings/default]
allowed hosts = 192.168.1.11
password = N0rth3dgE

[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1

However on TS1 its showing as Connection Refused, but TS2 it works. I have nmap -p 12489 192.168.87.41

Starting Nmap 6.00 ( http://nmap.org ) at 2015-06-03 13:12 BST
Nmap scan report for 192.168.87.41
Host is up (0.028s latency).
PORT STATE SERVICE
12489/tcp open unknown

Any ideas on how I can resolve this?

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 9:17 am
by jdalrymple
Did you restart your service after you wrote out/updated your nsclient.ini?

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 9:32 am
by nathanplatt
I did, there's no firewall on this server and nmap can see it. Is there a log anywhere I can look for?

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 9:37 am
by nathanplatt
Its' also happening on one of the other servers, basically I added in 10 servers and 2 of them show refused connection but I can see them in Hosts and ping fine and nmap is showing its open.

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 9:40 am
by jdalrymple
If it's actually getting ahold of the nscp daemon there should be some log information at

Code: Select all

c:\program files\nsclient++\nsclient.log

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 9:49 am
by nathanplatt
2015-05-12 09:29:20: error:D:\source\nscp\include\check_nt/server/protocol.hpp:66: Rejected connection from: 192.168.1.11
2015-05-20 16:00:41: error:D:\source\nscp\include\check_nt/server/protocol.hpp:66: Rejected connection from: 192.168.1.12

The 1.11 is the nagios server but not sure what the .12 is, however its being blocked.

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 10:15 am
by jdalrymple
nathanplatt wrote:2015-05-12 09:29:20: error:D:\source\nscp\include\check_nt/server/protocol.hpp:66: Rejected connection from: 192.168.1.11
Something is haywire with the config I'd say - I'm fairly certain that's the line you'd get if allowed_hosts isn't proper.


Maybe some funky newline character or weird spaces or quoting making the allowed_hosts unreadable? Maybe just a fat-finger somewhere? Maybe net stop nscp, net start nscp isn't working properly?

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 10:18 am
by nathanplatt
I've had a look at the command, i've added into it -s THEPASSWORD and -p but this still doesn't seemed have worked.
#CPU Load over 10 Min, 60 Min, 24 hrs

define command{
command_name check_nt_cpu_avg
command_line $USER1$/check_nt -H $HOSTADDRESS$ -s THEPASSWORD -p 12489 -v CPULOAD -l 10,60,95,60,60,95,1440,60,95
}

Did i miss something on the command?

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 10:21 am
by nathanplatt
Actually by adding the -p part it has worked. So thanks for listening.

Nathan

Re: Server showing a Connection Refused

Posted: Wed Jun 03, 2015 10:56 am
by nathanplatt
Actually before closing this, one of the servers is getting this;

TS10


CPU Load

CRITICAL 2015-06-03 16:51:25 0d 0h 17m 47s 4/4 Name or service not known

Check C Drive

CRITICAL 2015-06-03 16:56:03 0d 2h 38m 9s 4/4 Name or service not known

Check Uptime

CRITICAL 2015-06-03 16:51:28 0d 2h 38m 2s 4/4 Name or service not known

Any ideas?