Zembower, Kevin wrote: > I'm trying to capture the number of bytes transmitted and received on my > eth0 interface for use with RRD. I'm using this source for the data: > > [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev > Inter-| Receive | > Transmit > face |bytes packets errs drop fifo frame compressed multicast|bytes > packets errs drop fifo colls carrier compressed > lo:31738431 323299 0 0 0 0 0 0 > 31738431 323299 0 0 0 0 0 0 > eth0:147992894 45634695 0 0 0 0 0 0 > 1722980290 70429910 0 0 4 0 0 0 > sit0: 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 > > When I try to grab just the number of received bytes on eth0, it > duplicates the number: > > [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev|perl -ne > '/eth0:(\d+)\s+.*/; print $1;'
perl -F'[:\s]+' -lane'print "$F[2] $F[10]" if /eth0:/' /proc/net/dev John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>