diff --git a/check_ping_multiaddr.py b/check_ping_multiaddr.py index 73e886242c299256df68bd2d679572d797e7bf59..9e57990b597945125459fd618d10152696035878 100755 --- a/check_ping_multiaddr.py +++ b/check_ping_multiaddr.py @@ -223,12 +223,12 @@ def main(argv): (alive, unreachable, not_reported, unexpected) = \ ping_addresses(addresses) - # XXX: Better messages ping_statuses = { - 'OK': map(str, alive), - 'WARNING': map(str, unexpected), - 'CRITICAL': map(str, unreachable), - 'UNKNOWN': map(str, not_reported), + 'OK': [ '%s is alive' % (ip,) for ip in alive ], + 'WARNING': [ '%s was reported despite not being pinged' % (ip,) + for ip in unexpected ], + 'CRITICAL': [ '%s is unreachable' % (ip,) for ip in unreachable ], + 'UNKNOWN': [ '%s has no information' % (ip,) for ip in not_reported ], } lvl,message = trh_nagioslib.nagios_report(ping_statuses) sys.stdout.write(message)