Monitor multiple remote windows servers!


Hiya :slight_smile:
We have a couple Windows servers in our office which we’re monitoring OK; and our clients (about 100) are typically small businesses with single Windows servers there – so we’re using NSClient++ and opening ports on their firewalls to monitor these boxes.

However - a couple of our clients have more than one server on their network that we need to monitor. I see that any concept of this has been left out of the official nagios docs; does anyone know a way to do this:?:!?


Establish a VPN to that client? Set up a distributed monitoring server at their site? Specify a different port for each windows server in NSClient++ and punch multiple firewall holes?


comfi — Ah so I can open 12489 and any additional ports i need – i’ll have to do this at both ends? (monitoring and remote end?) I wondered IF i could do that but wasn’t sure how NAGIOS would try to ‘listen’ if i changed a port?


I haven’t tried it myself, so I may be missing a step. Assuming you’re using the standard NSClient++ configuration, you’ll have to modify the check_nt command in commands.cfg or add a new one. The default one defines port 12489. You can change it to not specify the port and then you’d define it in the service check definition or you can add another command definition, one for each additional port.

My command definition looks like:

define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$

Maybe you’d add another that looks like this:

define command{
command_name check_nt_p12490
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12490 -v $ARG1$ $ARG2$

The corresponding service check would then look something like:

define service{
use generic-service
host_name some_machine
contact_groups admins
service_description Net Logon
check_command check_nt_p12490!SERVICESTATE!-d SHOWALL -l ‘Netlogon’

You’ll need to open up that port on firewalls and whatnot, obviously. Then, on the client, you’d modify the NSC.ini on some_machine and just change the port= line to 12490. If you have loads of other ports you’ll be adding, it’d probably be cleaner to leave the port out of the command definition and stick it in the service defintion instead.

As mentioned, I haven’t tried this myself. Proceed with caution.


Comfi - aahhhh that’s great. I’ve been learning so much ‘new’ linux stuff that the initial stuff i’m learning occasionally… well i forget it, but thanks, that looks great.


Hello there,

has anyone actually acheived this ? I require the function to monitor multiple windows machines. However i would like simple approach to simply change the port allocation in conf files and make port forward changes on firewall/router.

any feedback would be appreciated




Hi yeah doing it this way works - I can now run loads of machines behind remote firewalls just setting an increment to the check_nt process!