Unverified Commit c6bbb9ae authored by Adrian Schollmeyer's avatar Adrian Schollmeyer
Browse files

check_net_traffic: Add additional perfdata

parent db727870
......@@ -51,7 +51,11 @@ def parse_net_stats(data):
fields = re.split("\s+", data[i].strip())
results[fields[0][:-1]] = {
"rbytes": int(fields[1]),
"tbytes": int(fields[9])
"tbytes": int(fields[9]),
"r_errs": int(fields[3]),
"t_errs": int(fields[11]),
"r_dropped": int(fields[4]),
"t_dropped": int(fields[12])
}
return results
......@@ -73,6 +77,10 @@ def get_perfdata(results, diff):
for name,value in results.items():
perfdata += " {:}_rx={:.2f}B".format(name, value["rbytes"])
perfdata += " {:}_tx={:.2f}B".format(name, value["tbytes"])
perfdata += f" {name}_rx_errs={value['r_errs']}"
perfdata += f" {name}_tx_errs={value['t_errs']}"
perfdata += f" {name}_rx_dropped={value['r_dropped']}"
perfdata += f" {name}_tx_dropped={value['t_dropped']}"
return perfdata
# nagios compatible exit
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment