output formatting
This commit is contained in:
parent
12a2ccf145
commit
f37e260d7b
|
@ -53,15 +53,16 @@ def main():
|
|||
bandwidth_utilization = data[i][1]
|
||||
if bandwidth_utilization >= crit_value:
|
||||
critical.append(interface)
|
||||
data[i][2] = 'critical'
|
||||
state = 'critical'
|
||||
exit_code = nagios.CRITICAL
|
||||
elif bandwidth_utilization >= warn_value:
|
||||
warn.append(interface)
|
||||
data[i][2] = 'warning'
|
||||
state = 'warning'
|
||||
exit_code = nagios.WARNING
|
||||
else:
|
||||
ok.append(interface)
|
||||
data[i][2] = 'ok'
|
||||
state = 'ok'
|
||||
data[i][2] = f'[{state.upper()}]'
|
||||
perf_data.append(f'{interface}={round(bandwidth_utilization, 2)}MB;{warn_value};{crit_value};{f"0;{args.max};" if args.max else ""} ')
|
||||
|
||||
if len(ok):
|
||||
|
|
Loading…
Reference in New Issue