monitoringplugin: Don't output warn/crit as 1.23e+45...

Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
Sven Velt 2011-02-11 13:41:35 +01:00
parent d2d3d41b5a
commit fa6dc16dc4

View file

@ -1,3 +1,5 @@
# -*- encoding: utf-8 -*-
__version__ = '0.0.100802' __version__ = '0.0.100802'
__all__ = ['MonitoringPlugin', 'SNMPMonitoringPlugin'] __all__ = ['MonitoringPlugin', 'SNMPMonitoringPlugin']
@ -288,10 +290,10 @@ class MonitoringPlugin(object):
range = range[1:] range = range[1:]
parts = range.split(':') parts = range.split(':')
newrange += str(self.human_to_number(parts[0], total)) newrange += ('%f' % self.human_to_number(parts[0], total)).rstrip('0').rstrip('.')
if len(parts) > 1: if len(parts) > 1:
newrange += ':' + str(self.human_to_number(parts[1], total)) newrange += ':' + ('%f' % self.human_to_number(parts[1], total)).rstrip('0').rstrip('.')
if range != newrange: if range != newrange:
self.verbose(3, 'Changed range/thresold from "' + range + '" to "' + newrange + '"') self.verbose(3, 'Changed range/thresold from "' + range + '" to "' + newrange + '"')