Re: (PM) Connection time stuck at 99days on show session

Pete Templin (templin@jlink.net)
Tue, 18 May 1999 12:25:09 -0400 (EDT)

On Tue, 18 May 1999, Jake Messinger wrote:

> I think it is best if you reset your isdn links ever few days. Takes only a
> coule secs to tear down and re-establish a call anyway.

I use the following script at a site that suffered from a flapping d
channel. It only reset the d channel if it appeared down.

check-d:
show isdn

reset-d0:
reset d0

reset-d1:
reset d1

pmisdnmon:
#!/usr/bin/perl5
#

# specify notification recipient
$recipient = "staff\@<yourdomain.com>";
$sender = "ISP Systems Watcher <youremail\@yourdomain.com>";
$receiver = "ISP Staff <staff\@yourdomain.com>";

# specify what,how,how much to monitor
# field one = hostname
# field two = password
# field three = comma-separated list of lines to monitor
@active = ("pm3a:PW:0,1", # checks line0 and line1
"pm3b:PW:0"); # checks line0

for ($a=0; $a<=$#active; $a++) {
@checker = split(/:/,$active[$a]);
$host = $checker[0];
$hostpw = $checker[1];
$hostlines = $checker[2];
@isdn = split(/,/,$hostlines);
open(CHECK,"pmcommand $host $hostpw check-d|");
while (<CHECK>) {
$line = $_;
if ($line =~ /^ \d/) {
$num = $line;
chomp($num);
$num =~ s/^ (\d).*/$1/;
for ($b=0; $b<=$#isdn; $b++) {
if ($num =~ /$isdn[$b]/) {
unless ($line =~ /Active/) {
&reset_line;
}
}
}
}
}
}

sub reset_line {
open(REPORT,"|sendmail $recipient");
open(RESET,"pmcommand $host $hostpw reset-d$num|");
print REPORT "From: $sender\n";
print REPORT "To: $receiver\n";
print REPORT "Subject: Portmaster Trouble\n";
print REPORT "\n";
print REPORT "Line problem with line d$num on Portmaster $host!\n";
print REPORT "\n";
print REPORT "D Ports State L1 L2 Change init Up Down\n";
print REPORT "-- ------- ------------- ------- ----- ----- ----- \n";
print REPORT "$line";
print REPORT "\n";
print REPORT "Attempting to reset line d$num on Portmaster $host...\n";
while (<RESET>) {
print REPORT;
}
close(RESET);
print REPORT "\n";
print REPORT "Reset attempt complete.\n";
close(REPORT);
}


Pete

--
Peter J. Templin, Jr.
Systems and Networks Administrator

Jlink Internet Services 1000 S. Market St. templin@jlink.net Bloomsburg, PA 17815 (717)389-6400

- To unsubscribe, email 'majordomo@livingston.com' with 'unsubscribe portmaster-users' in the body of the message. Searchable list archive: <URL:http://www.livingston.com/Tech/archive/>