Title: RE: (RADIATOR) Perl script question

But the values which in $total and $accttotal are number of access and accounting requests...they are not bytes per second


Tuncay

-----Original Message-----
From: Jason J. Horton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 07, 2000 8:19 PM
To: Tuncay MARGILIC
Cc: [EMAIL PROTECTED]
Subject: Re: (RADIATOR) Perl script question


I would assume because the logged values are bytes, and teh script wants the
value in bits.

> Tuncay MARGILIC wrote:
> I found this script at the Radiator faq docs. Why do we multiply the $total
> and $accttotal values by 8. Any idea?
>
> Tuncay Margilic
> System Adm.
> Siemens Business Services
>
> #!/usr/bin/perl
>
>     $total = 0;
>     $accttotal = 0;
>
>     open(FD, "/usr/bin/snmpwalk host secret .1.3.6.1.3.79.1.1.1.6.1.4  |") or
> die;
>     while(<FD>)
>     {
>         $total += $1    if (/.* = (\d+)/);
>     }
>     close(FD);
>
>     open(FD, "/usr/bin/snmpwalk host secret .1.3.6.1.3.79.1.1.1.6.1.12  |") or
> die;
>     while(<FD>)
>     {
>         $accttotal += $1    if (/.* = (\d+)/);
>     }
>     close(FD);
>
> *    $total *= 8;
> *    $accttotal *= 8;
>
>     open(FD, ">/stats/radius.stats");
>     print FD "$total\n$total\n";
>     close(FD);
>
>     open(FD, ">/stats/radiusacct.stats");
>     print FD "$accttotal\n$accttotal\n";
>     close(FD);
>
>     exit 0;

--
        -Jason J. Horton <[EMAIL PROTECTED]>
         Fat Man in a Little Coat
         Intercom Online Inc.
         212.376.7440 | http://www.intercom.com

Reply via email to