bandwidth max
This commit is contained in:
parent
e31918a949
commit
aea52d15bf
|
@ -13,6 +13,7 @@ parser = argparse.ArgumentParser(description='Check network interface bandwidth
|
|||
parser.add_argument('--bandwidth', type=float, required=True, help='Bandwidth speed in Mbps.')
|
||||
parser.add_argument('--critical', type=int, default=75, help='Critical if percent of bandwidth usage is greater than or equal to this.')
|
||||
parser.add_argument('--warn', type=int, default=50, help='Warning if percent of bandwidth usage is greater than or equal to this.')
|
||||
parser.add_argument('--max', type=int, default=None, help='Set the max value the bandwidth can be. Useful for graphs and whatever.')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
|
@ -61,7 +62,7 @@ def main():
|
|||
else:
|
||||
ok.append(interface)
|
||||
data[i][2] = 'ok'
|
||||
perf_data.append(f'{interface}={round(bandwidth_utilization, 2)}MB;{warn_value};{crit_value}; ')
|
||||
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):
|
||||
print(f'OK: {", ".join(ok)}')
|
||||
|
|
Loading…
Reference in New Issue