Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

nmap -A 192.168.0.1/32 -p 23

Or, look for open ports from 20 to 30 on host.example.com:

nc -z host.example.com 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

1 Answer 1

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

 
discard

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.