[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
External Paging Script
- To: hobbit (at) hswn.dk
- Subject: External Paging Script
- From: PNIXON (at) ci.somerville.ma.us
- Date: Thu, 21 Sep 2006 16:05:19 -0400
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);
};