nv-l
[Top] [All Lists]

RE: getting a maximum value using snmpColDump?

To: nv-l@lists.tivoli.com
Subject: RE: getting a maximum value using snmpColDump?
From: REIBENSCHUH Alfred <alfred.reibenschuh@it-austria.com>
Date: Wed, 30 May 2001 16:06:42 +0200
hi!

this script should do it:
-----------------------------------------------------------
#!/usr/local/bin/perl
# sc_max <file> <ip-address>
# gives max value on snmpcollect files

        open(INF,qq|$ARGV[0]|);
        binmode(INF);
        $myip=sprintf('%02x%02x%02x%02x',split(/\./,$ARGV[1]));
        while(!eof(INF)) {
            read(INF,$line,20);
            ($s,$e,$ip,$data)=unpack('L L H8 d',$line);
            if($ip EQ $myip){
                 $maxdata=($data>$maxdata) ? $data : $maxdata;
            }
        }
        print "maximum value for $ARGV[1] in $ARGV[0] = $maxdata\n";

__END__
-----------------------------------------------------------

mfG. Alfred Reibenschuh
INFORMATIONSTECHNOLOGIE AUSTRIA GMBH
TELEKOMMUNIKATION
Networkmanagement
A-1020 Wien, Lassallestrasse 5
T: ++43-1-21717-58947
F: ++43-1-21717-58979
E: alfred.reibenschuh@it-austria.com 


> -----Original Message-----
> From: Leslie Clark [mailto:lclark@us.ibm.com]
> Sent: Wednesday, May 30, 2001 2:41 PM
> To: NV-L@tkg.com
> Subject: [NV-L] getting a maximum value using snmpColDump?
> 
> 
> Has anyone figured out how to retrieve a maximum value for a
> node from collected data using snmpColDump? I see how to get
> an average using awk. I've tried dumping the data out and 
> postprocessing
> it, but snmpColDump appears to process things much faster. Thanks
> for any clues....
> 
> Cordially,
> 
> Leslie A. Clark
> IBM Global Services - Systems Mgmt & Networking
> Detroit
> 
> ______________________________________________________________
> ___________


<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web