Module: check_mk
Branch: master
Commit: 1491f90130f5847ba8d8673ef12765663c07df32
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1491f90130f584…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 20 16:41:18 2011 +0200
Better output of low NIC speeds in checks
---
modules/check_mk_base.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index afe44e0..b4897a9 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1094,7 +1094,11 @@ def get_nic_speed_human_readable(speed):
speed = "100MBit/s"
elif speedi == 1000000000:
speed = "1GBit/s"
- elif speed < 1500000000:
+ elif speed < 1500:
+ speed = "%dBit/s" % speedi
+ elif speed < 1000000:
+ speed = "%.1fKBit/s" % (speedi / 1000.0)
+ elif speed < 1000000000:
speed = "%.2fMBit/s" % (speedi / 1000000.0)
else:
speed = "%.2fGBit/s" % (speedi / 1000000000.0)