Monitoring Windows using nsclient++ without icinga2 client

Hi People, i´m triing to monitoring several windows host and i need use nsclient++ only.

in my icinga server i tried to check one test host using /usr/lib/nagios/plugins/check_nt -p 12489 -s "password" -H "test host ip" r -v CPULOAD -l 5,80,90 -t 60

the result is CRITICAL - Socket timeout after 60 seconds

all another check_nt commands fails whit the same error

In the client side, i have de nsclient.ini configured:

  • allowed hosts (localhost and icingaserver)
  • password
  • checkdisk
  • checksystem
  • webserver

all tests on the local web server are funcional.

don’t know how to continue to solve the problem

Icinga version: r2.10.5-1 runing on Ubuntu 18.08

Is the required Firewall Port allowed which is mamdatory for nsclient… I think tcp/5665 or something like this.

Tbh I have never used the check_nt part of NSClient. I only ever used NRPE.

Check the nsclient.ini for the configured timeouts.
Are the correct modules enabled? Maybe try running nscp settings --generate --add-defaults --load-all from the Windows cmd (where the nscp.exe is located), to load all modules and the whole default config. With nscp settings --generate --remove-defaults you can remove the defaults again
Have you checked the nsclient.log on the windows machine?

As for the firewall:

  • Windows:
    – Normally when installing the nsclient, the windows firewall is configured.
  • other firewalls:
    – as @MoeJoe said you will have to check if the required ports are open. check_nt uses 12489 as default, NRPE uses tcp/5666

This is the Icinga 2 communication port :wink:

3 Likes

Thanks for the help. Is a problem with these client in particular, the firewall is off and the client are LISTEN con 5666 port and 12489 port.
the commands nc -zv “ip” 12489 and 5666 port from the server are ok.

We Say 'Cosa de mandinga’ for these cases

Grettings from Argentina

What version of NSC++ are you using? I had to try several different versions before finally 0.5.3.4 worked.

General checklist:

  • Did you restart NSclient service after you added the icinga2 core (or satellite) ip in allowed hosts?
  • Are you sure about the added ip in allowed hosts? Maybe there is NAT between.
  • Network firewall in between? Port 12489 opened?
  • Software firewall on client? Port 12489 opened?
  • Anti-Virus software could also interfere…
  • Try communication with telnet (nc still reports succeeded, even if IP is not listed in allowed hosts!)
    A successful communication would look like this:
# telnet windows 12489
Trying 10.140.20.10...
Connected to windows.example.com.
Escape character is '^]'.

A unsuccessful communication is closed immediately by NSclient:

# telnet windows 12489
Trying 10.140.20.10...
Connected to windows.example.com.
Escape character is '^]'.
Connection closed by foreign host.
1 Like