http://qs1969.pair.com?node_id=113930

shadox has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone, the other day i was working in project to monitor the bandwidth usage, the program is in a openBSD server and there are logs of the bandwidth usage so i just need to manipulate the data, that was easy until i tried to do it for any O.S.
I did look for some module or something for it but i didn't find anything useful, and since i am new with network programing, here i am :)
Anyone knows a way to do it, a module or something
Thanx
Dreams they just disapear into the shadows,
then they become true....

Replies are listed 'Best First'.
Re: Bandwidth Usage
by lhoward (Vicar) on Sep 21, 2001 at 21:55 UTC
    use SNMP (in particular, for monitoring bandwidth you'll want to use ifInOctets and ifOutOctets). SNMP is cross platform and very standard. Best of all, there are lots of SNMP perl modules...
Re: Bandwidth Usage
by clintp (Curate) on Sep 21, 2001 at 21:08 UTC
    We did something similar here but not for bandwidth usage. It might prove helpful. We took a filehandle and did a tie() on it, and selected it as the default output filehandle.

    Using something like this you could count the bytes that go by unobtrusively and then when the object is destroyed (the program ends), put the data out to a logfile somewhere..