ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
460 stars 64 forks source link

Network interface information with ip command fix #65

Closed nurk closed 1 year ago

nurk commented 2 years ago

I installed a raspberry pi 4 with ubuntu server and the network interface information was not working. Ubuntu server does not come with /sbin/ifconfig

I made adjustments so that when the interfaces are fetched using the ip command this is used throughout. The parsing of the lines has also been adjusted for this.

The resulting networking output is as follows(wlan is not connected):

"networking": {"eth0": {"mac": "e4:5f:01:ac:50:47", "IP": "192.168.1.7"}, "wlan0": {"mac": "e4:5f:01:ac:50:48"}}

Unfortunately I do not own a device which uses /sbin/ifconfig so I cannot test that.