1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-05 01:53:44 +01:00

Known types always have a metric, even if 0

This commit is contained in:
Tomas Edwardsson 2013-07-16 19:43:00 +00:00
parent 5ff4605400
commit 5a8cad9783

View File

@ -39,9 +39,9 @@ def main():
", ".join(["%s: %i" % (x, len(pkg_updates[x])) for x in pkg_updates.keys()]))
p.add_metric("total", total_updates)
for update_type in pkg_updates:
p.add_metric(update_type.lower(), len(pkg_updates[update_type]))
if len(pkg_updates[update_type]):
p.add_long_output(update_type)
p.add_metric(update_type.lower(), len(pkg_updates[update_type]))
for pkg in pkg_updates[update_type]:
p.add_long_output(" %s" % pkg)