Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I could check for telnet on a known IP using other programs like:

nmap -A -p 23

Or, look for open ports from 20 to 30 on

nc -z 20-30

I need to create a batch file, since I think that is how NSClient++ works on Windows Server being monitored by Nagios. Currently I have CPU, Disk, Memory, NSClient, and PING being monitored but I need a Specific port that I can also Monitor.

share|improve this question
Just to be clear, you want to check connectivity TO another host from the monitored Windows host, right? – Matt Simmons Jan 8 '12 at 23:55

Assuming you have a monitored Windows server, and you want to check to see if it has connectivity to a remote machine, I would recommend the following:

Use this PowerShell code (or one much like it) to write a script that checks a remote port.

Then set up the CheckExternalScripts module to run and interpret the output of the PowerShell script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.