bjango / istatserverlinux

A system monitoring daemon that sends stats to Send stats to iStat View for iOS and iStat View for macOS.
https://bjango.com/istatserver/
Other
102 stars 11 forks source link

istatserver skips my network interface #9

Closed jeremyvaartjes closed 6 years ago

jeremyvaartjes commented 6 years ago

When I installed this program onto my server I noticed that I was not getting any network traffic. It was picking up a "docker0" interface, but it was ignoring the standard ethernet interface. I have another server with this program installed and it works fine, using the same software. Did some snooping and found that the server that works has an interface name "eth0" and the server that doesn't work has the interface name "enp1s0f0". After some snooping in your source code I found that a line in your source code uses fscanf to get the interface name out of the proc file, but it trims the name to 7 characters which causes the interface to be ignored. My interface has 8 characters. I updated the source code on my end and everything works now, just by changing the 7 to an 8.

https://github.com/bjango/istatserverlinux/blob/40411ad7c34f4fa96a1b11d2e9c080d04dff9d78/src/stats/StatsNetwork.cpp#L145