| Index: modules/nagios/files/check_bandwidth |
| =================================================================== |
| --- a/modules/nagios/files/check_bandwidth |
| +++ b/modules/nagios/files/check_bandwidth |
| @@ -18,12 +18,13 @@ |
| # family name and 6 bytes actual MAC address). |
| s = socket.socket() |
| SIOCGIFHWADDR = 0x8927 # see man ioctl_list |
| - return fcntl.ioctl(s.fileno(), SIOCGIFHWADDR, struct.pack("24s", "eth0"))[18:24] |
| + NIC = str(sys.argv[3]) |
|
mathias
2017/06/07 15:27:22
This shouldn't be an upper-case name (I think the
|
| + return fcntl.ioctl(s.fileno(), SIOCGIFHWADDR, struct.pack("24s", NIC))[18:24] |
| if __name__ == "__main__": |
| - if len(sys.argv) != 3: |
| + if len(sys.argv) != 4: |
| script_name = os.path.basename(sys.argv[0]) |
| - print "Usage: %s WARN CRIT" % script_name |
| + print "Usage: %s WARN CRIT NIC" % script_name |
| sys.exit(0) |
| (warn, crit) = sys.argv[1:3] |