no blanks in disk model names
[metriccd.git] / client / meter / net-traffic
blob9c0273b95e27b3bf107e7905cc5450131017ef3f
1 #!/usr/bin/env perl
3 require "common.pl";
5 for my $iface_path (glob "/sys/class/net/*")
7 my ($iface) = $iface_path =~ /\/([^\/]+)$/;
9 my $rx_bytes = file_get_int("$iface_path/statistics/rx_bytes");
10 my $tx_bytes = file_get_int("$iface_path/statistics/tx_bytes");
12 $\ = "\n";
13 print "$iface.rx_bytes $rx_bytes";
14 print "$iface.tx_bytes $tx_bytes";