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.

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
add comment

3 Answers 3

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' => '192.168.1.1', 
    'host2' => '192.168.1.254',
);

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
add comment

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
add comment

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
add comment

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.