No stats for aliased devices.
This commit is contained in:
parent
1a9eaa800f
commit
807aa955c1
@ -37,8 +37,8 @@ iflist.each do |ifname|
|
|||||||
" MTU:" + ifconfig.mtu.to_s +
|
" MTU:" + ifconfig.mtu.to_s +
|
||||||
" Metric:" + ifconfig.metric.to_s
|
" Metric:" + ifconfig.metric.to_s
|
||||||
|
|
||||||
|
if (!ifname.include?(":"))
|
||||||
ifstat = sigar.net_interface_stat(ifname)
|
ifstat = sigar.net_interface_stat(ifname)
|
||||||
|
|
||||||
puts "\t" +
|
puts "\t" +
|
||||||
"RX packets:" + ifstat.rx_packets.to_s +
|
"RX packets:" + ifstat.rx_packets.to_s +
|
||||||
" errors:" + ifstat.rx_errors.to_s +
|
" errors:" + ifstat.rx_errors.to_s +
|
||||||
@ -65,3 +65,4 @@ iflist.each do |ifname|
|
|||||||
"TX bytes:" + tx_bytes.to_s +
|
"TX bytes:" + tx_bytes.to_s +
|
||||||
" (" + Sigar.format_size(tx_bytes) + ")" + "\n";
|
" (" + Sigar.format_size(tx_bytes) + ")" + "\n";
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user