Hello again,

I realised my earlier perl script wasn't much use really, so I have modified
it to send an alarm to your WhatsUp machine syslog server if a number of
devices fail to respond to a ping.

Now what you need to do is modify a few lines in this file, run it via
scheduler or some such, and use WUG to monitor the syslog for the text it
produces.
(Configure / Events Library / Syslog, then set up an event to match on
something like "\w exceed maximum allowed")

I hope this is more useful ...

#!/bin/perl

use Net::Ping;
use Net::Syslog;

# Change the machines listed here to suit your setup. If the names cannot be
# resolved then it will count as a failed ping.

@machines = (s1,s2,s3,s4,s5,r32,r33,r34,r35,r36,r37);

# Initialise count of "down" machines to zero
$downcount = 0;

# Set "maxdowncount" to number of machines that need to be down to send WUG
an alarm.
$maxdowncount = 3;

# Set line below to your WUG syslog server's IP address
$sysloghost = "127.0.0.1";

# Loop through each machine in list, incrementing "downcount" for each that
doesn't respond to a ping
$p = Net::Ping->new("icmp");
    foreach $host (@machines)
    {
        $downcount = $downcount + 1 unless $p->ping($host, 2);
    }
$p->close();

# If number of device down equal or exceed downcount maximum then send alert
to syslog
if ($downcount >= $maxdowncount)
        {
        my $s=new
Net::Syslog(SyslogHost=>$sysloghost,Facility=>'user',Priority=>'debug');
        $s->send('Aggregate down devices exceed maximum
allowed',Priority=>'alert');
        }

exit;



Regards,

Andy Young
Design Systems Administrator
BBC Post Production

*       Room 3501, Stage 5, Television Centre, Wood Lane, London, W12 7RJ
*       mailto:[EMAIL PROTECTED]
*       http://www.bbcresources.com/postproduction


BBCi at http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain 
personal views which are not the views of the BBC unless specifically 
stated.
If you have received it in error, please delete it from your system, do 
not use, copy or disclose the information in any way nor act in 
reliance on it and notify the sender immediately. Please note that the 
BBC monitors e-mails sent or received. Further communication will 
signify your consent to this.


Please visit http://www.ipswitch.com/support/mailing-lists.html 
to be removed from this list.

An Archive of this list is available at:
http://www.mail-archive.com/whatsup_forum%40list.ipswitch.com/

Reply via email to