+=cut
+
+my $dev = sh 'grep : /proc/net/dev';
+while(<$dev>) {
+ chomp;
+ s/^\s+//;
+ my @l = split(/[:\s]+/, $_);
+#warn "XXX $_ -> ",Dumper( \@l );
+ if ( my $instance = $tap_instance->{$hostname}->{ $l[0] } ) {
+ $stat->{$instance}->{rx} += $l[1];
+ $stat->{$instance}->{tx} += $l[9];
+ } elsif ( $l[0] =~ m/eth/ ) { # connect hardware eth devices under node
+ $stat->{ '__' . $hostname }->{rx} += $l[1];
+ $stat->{ '__' . $hostname }->{tx} += $l[9];
+ }
+}
+
+
+goto next_node if @nodes;
+
+
+
+# dump some useful data structures
+
+sub tab_dump {
+ my ( $name, $hash ) = @_;
+ warn "# $name\n";
+ foreach my $key ( sort keys %$hash ) {
+ warn $key, "\t", $hash->{$key}, "\n";
+ }
+}
+
+
+
+foreach my $node ( sort keys %$mac_to_name ) {
+ tab_dump "$node mac instance", $mac_to_name->{$node};
+}
+#warn Dumper( $mac_to_name );
+#tab_dump 'instance_tap', $instance_tap;
+#warn Dumper( $instance_tap );
+#warn Dumper( $tap_instance );
+