External Paging Script
    PNIXON at ci.somerville.ma.us 
    PNIXON at ci.somerville.ma.us
       
    Thu Sep 21 22:05:19 CEST 2006
    
    
  
Hey all,
 Attached is a paging script I'm using to limit the amount of pages within a
15 minute window to one page per window.
 Script comes with no warranty or support, use at your own will.  I know,
it's kludgey as well.
--Pat
#!/usr/bin/perl
$INTERAL = 900; ## # Of Seconds between Pages
$RCPT = $ENV{'RCPT'};
$RCPTN = "/bb/hms/server/tmp/np-".$RCPT;
$ACKCODE = $ENV{'ACKCODE'};
$BBHOSTSVC = $ENV{'BBHOSTSVC'};
$NOW = `date +%s`;
chomp $NOW;
$mstat = (stat $RCPTN)[9];
$fileage = $NOW-$mstat;
if ( $fileage >= $INTERVAL ) {
        open (PAGER,">$RCPTN");
        system('echo $BBHOSTSVC [$ACKCODE] | mail $RCPT');
        print PAGER " ";
        close (PAGER);
};
    
    
More information about the Xymon
mailing list