Nagios NSClient++ to Monitor Remote Windows Server
Scenario / Question:
How do I monitor a remote Windows system using Nagios
Solution / Answer:
Use the NSClient++ addon to execute Nagios plugins on the remote server and report back to the monitoring host server.
NSClient++ Remote Server Installation and Setup
Make a directory:
C:\NSClient++
Download NSClient++ from sourceforge into directory C:\NSClient++:
Install the NSClient++.msi:
Configure NSClient++ Windows Service Settings:
Enable “Allow service to interact with desktop”
Configure Windows Firewall to allow NSClient++ access:
Add on Exception to the Windows Firewall to allow access to nsclient++
Start – > Control Panel -> Windows Firewall -> Exceptions -> Add Program -> Browse
C:\Program Files\NSClient++\nsclient++.exe
Nagios Monitoring Host Server Setup
Activate windows.cfg object template file by editing nagios.cfg and uncomment (remove the #):
# vi /usr/local/nagios/etc/nagios.cfg cfg_file=/usr/local/nagios/etc/objects/windows.cfg
Configure NSClient++ password protection:
# vi /usr/local/nagios/etc/objects/commands.cfg
Change the check_nt command to include the password argument “-s”. Change “yourpassword” to the password you chose during the NSClient++ software install:
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s yourpassword -v $ARG1$ $ARG2$
}
Edit Windows Object Template:
Replace the values “host_name” “alias” “address” with the values that match your setup:
** The “host_name” you set for the “define_host” section must match the “host_name” in the “define_service” section **
# vi /usr/local/nagios/etc/objects/windows.cfg
define host{
use windows-server ; Inherit default values from a Windows server template (make sure you keep this line!)
host_name mywinserver
alias Windows Server
address 192.168.1.100
}
define service{
use generic-service
host_name mywinserver
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
Verify Nagios Configuration Files:
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg Total Warnings: 0 Total Errors: 0
Restart Nagios:
# service nagios restart
NSClient++ Port Forwarding and Firewall
The default port for NSClient++ is 12489
You must allow the firewall at your remote server to allow this port access.
Changing NSClient++ port:
You can change the NSClient++ port by modifying the NSC.ini file located at C:\Program Files\NSClient++ (remove “;”)
;# NSCLIENT PORT NUMBER ; This is the port the NSClientListener.dll will listen to. port=12489
Restart the NSClient++ service
Change check_nt -p 12489 argument in /usr/local/nagios/etc/objects/commands.cfg
# 'check_nt' command definition
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p portnumber -s cjr-nagios -v $ARG1$ $ARG2$
}











My question pertains to the scalability and manageability of the password security implementation of Nagios/NSClient .
It appears that the password is specified when NSClient is installed and can only be changed by going into NSClient on the monitored server.
What is the best practice for Nagios deployed in an environment of 50 , 100 , 500 Windows servers where the passwords for service accounts must be changed periodically?
What about submitting passive checks to the Nagios server, for monitored entities behind firewalls and routers that hide individual IP addresses of workstations and servers?
Passive mode means that only one IP needs to be exposed to the internet – the Nagios server doing the monitoring. Otherwise this is just mucking around, no client wants their Desktop Workstations addressable from the wider internet.
Passive monitoring is a requirement in this day and age, and I’m surprised this client still doesn’t do this.
Passive checks are possible.
Check out this page
http://nagios.sourceforge.net/docs/2_0/passivechecks.html
[...] Nagios NSClient++ a?a??daki rehberde anlat?ld??? ?ekilde kurun: http://www.kernelhardware.org/nagios-nsclient-to-monitor-remote-windows-… [...]
I have enabled SNMP instead of using NSClinet now i would like to monitor services like IIS ADMIN Services
How to monitor the log file in Windows as we have check_log for UNIX.
Will the same client work for Windows 64 server also.
VCenter…
Installation von NSClient\ Quelle:…
Heinlein vCenterServer…
Systemdokumentation: Basissystem: Windows Server 2008 64 Bit. ServerManager: Zu Aktivieren und Konfigurieren gilt es: Multipath E/A für die Anbindung des vCenters an die Storagesysteme,……
Heinlein vCenterServer…
Systemdokumentation: Basissystem: Windows Server 2…
VcenterServer…
Systemdokumentation: Basissystem: Windows Server 2…