Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

My users keep unplugging our meeting rooms computers network connection.

As i can't check the computers every time a meeting ends, i'd like to find a tool, preferably running on windows, that can monitor some cisco switch ports state, and every time a cable is being unplugged, send me an email.

I know that some monitoring solutions can do that already, but i wonder if something simplier (and preferably cheap / free of course !) exists.

share|improve this question
up vote 1 down vote accepted

Not exactly state of the art but written mostly as a proof of concept, the following could be used to detect when a host goes down. Add it in a regular cronjob, modify it so it emails you everytime something is down and voila! Cheap n' quick solution.

#!/usr/bin/env perl

%hosts = ( 
    'host1' => '', 
    'host2' => '',

while (($hostname, $ip) = each(%hosts)) {
    system('ping -c1 ' . $ip. ' 2>&1 > /dev/null');
    if ( $? != 0 ) {
        print "host: ".$hostname." down\n";
    } else {
        print "host: ".$hostname." up\n";
share|improve this answer
On the cisco switch you can set up snmp, or have it log somewhere else and monitor those logs. None of that is that hard, but ping is far more simple to get the job done, so I recommend that. – Kyle Brandt Mar 12 '10 at 12:46
Thanks Fim, THAT is cheap :D But i can't run perl on our servers so... :s As for snmp, ping is indeed simplier to use, i'll probably build a vbscript that does the same thing as the one fim provided – Florent Courtay Mar 12 '10 at 14:28

I don't know about monitoring the state of a switch port, but you can certainly monitor ICMP echo response of the device connected to the port.

There are lots of free/open source monitoring solutions available that will do this, my personal favourite is Nagios.

Whilst you're at it, you might as well get Nagios monitoring your servers and other network devices too!

Edit: Sorry, Nagios actually runs on Linux, but this wikipedia page will help you find a monitoring system that runs on Windows.

share|improve this answer

Net::SNMP module for perl can do that. Take a look at Perl for system administrators(linked chapter handles SNMP) for some practical examples. Be sure to check out the module itself at cpan.

share|improve this answer
Can't use perl, and to be honnest I don't know perl either...That's why I was looking for a "pre-build" software solution. – Florent Courtay Mar 12 '10 at 14:30

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.