Random Project

using ifconfig – not such good idea

Most plugins are used in enterprise environments where nagios user does not have root or sudo privileges. ifconfig cannot be run in such environments which makes the plugin unusable.

You can do almost the same code, but get the byte and packet readings from /sys/class/net/eth0/statistics. Using this method you will not need the subprocess library. Make it more simple and usable.