Here a slightly improved version in that it should work independant of
the card density (quad/hiperdsp) and type (e1/t1). It uses the
session-id instead of the nas-port.
####################################################################
# Check Total Control by using SNMP
#
sub isOnlineTotalControlSNMP
{
my ($name, $nas_id, $nas_port, $session_id, $client) = @_;
return 1 unless &Radius::SNMP::snmpgetprogExists();
my $oid = length $session_id;
my $x;
foreach $x (unpack('C*', $session_id)) {
$oid .= ".$x";
}
my $result = &Radius::SNMP::snmpget($nas_id, $client->{SNMPCommunity},
"$Radius::Nas::TCMIB.4.2.1.140.1.2.$oid");
# There must be some Important Reason all of these routines return
# 0 or 1 instead of nil or 1, so I'll play along.
return 0+($result =~ /^.*\"([^"]+)".*$/ && $1 eq $name);
}
On Tue, 28 Mar 2000, Aaron Nabil wrote:
>
> On Tue, 28 Mar 2000, Ingvar Berg (ERA) wrote:
>
> > I assume that 24 is for a T1 line, so with E1 lines it would be 30?
> > /Ingvar
>
--
Aaron Nabil
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.