Netlink event for network device statistics
Subsystems (2)
Hi everyone,
so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.
So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?
Regards
Marcel
Quoted 8 lines · Marcel Holtmann
Hi everyone,
so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.
Quoted 4 lines
So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?
Don't we already include them in the DELLINK message? rtnl_fill_ifinfo() unconditionally includes the statistics.
Hi Patrick,
Quoted 6 lines
Quoted 6 lines
so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.
Quoted 7 lines
Quoted 4 lines
So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?
Don't we already include them in the DELLINK message?
rtnl_fill_ifinfo()unconditionally includes the statistics.
you are correct. We already have the IFLA_STATS in DELLINK. I got confused with ip monitor not decoding these and assumed they were not included at all.
Regards
Marcel