I want to monitor the RUNNING state of a certain network interface in an efficient way, without constantly calling ifconfig
every second, or so, and parsing its output. So I'm asking if someone knows a way to efficiently get this state information in Python on Linux.
I know of netifaces
, but it doesn't give me interface states. So I don't know if the interface is just available, or really online/running.
Then I looked into psutil
, but if I'd not missed something there, it has no access to this kind of network interface state either. If I'm wrong, I will be happy to get corrected and get specific info on how to achieve my goal.