Your math for computing portidx isn't correct for more than the first 24
ports.  If use the following instead, you'll get the correct results.

   my $chan = $nas_port % 24;
   my $slot = (($nas_port - $chan) / 24)+1;
   my $portidx = (256*$slot) + $chan + 1000;


Note that these equations are for the factory default density settings.



On Sun, 28 Mar 1999, Stephen Roderick wrote:

> 
> I have figured out the Total Control SNMP stuff as well (see note at
> bottom). I'm sure that Mike will whip up a patch for everyone in the near
> future. 
> 
> 
> # The 3com TotalControl SNMP MIB
> $Radius::Nas::TCMIB =
>     '.iso.org.dod.internet.private.enterprises.429'
> 
> 
> sub isOnlineTotalControlSNMP
> {
>     my ($name, $nas_id, $nas_port, $session_id, $client) = @_;
> 
>     if (!-x $Radius::Nas::snmpgetprog)
>     {
>     &main::log($main::LOG_ERR, "$Radius::Nas::snmpgetprog is not 
> executable. Check and configure Nas.pm");
>     return 1; # Assume the worst
>     }
>     my $portidx = 1256 + $nas_port;
>     my $result = `$Radius::Nas::snmpgetprog $nas_id 
> $client->{SNMPCommunity} $Radius::Nas::TCMIB.4.10.1.1.18.$portidx`;
> 
>     &main::log($main::LOG_ERR, "The command '$Radius::Nas::snmpgetprog
> $nas_id $client->{SNMPCommunity} $Radius::Nas::TCMIB.4.10.1.1.18.$portidx' failed
> with an error: $result")
>     if $result =~ /error/i;
> 
>     if ($result =~ /^.*\"([^"]+)".*$/)
>     {
>         return $1 eq $name;
>     }
>     return 0;
> }
> 
> Note: I got most of this from another Radius product (not to be mentioned
> here ;-)
> 

--
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.

Reply via email to