From: Michael Howe Date: Sat, 9 Jan 2021 14:59:47 +0000 (+0000) Subject: Remove value=payload from perf data X-Git-Tag: 0.23~4 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e38fb714b7cb4831603c687a7130cef264d6e607;p=packages%2Fn%2Fnagios-plugins-local.git Remove value=payload from perf data Per icinga2 docs, perfdata should be 'metric'=number - arbitrary strings aren't supported. --- diff --git a/debian/changelog b/debian/changelog index 3e20463..39ce03d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -nagios-plugins-local (0.22~test.0) UNRELEASED; urgency=medium +nagios-plugins-local (0.22~test.1) UNRELEASED; urgency=medium * New version of check_mqtt, from https://github.com/jpmens/check-mqtt/ This adds python3 support and works with buster. - -- Michael Howe Sat, 04 Jan 2020 21:23:08 +0000 + -- Michael Howe Sat, 09 Jan 2021 14:35:02 +0000 nagios-plugins-local (0.21) unstable; urgency=medium diff --git a/plugins/check_mqtt b/plugins/check_mqtt index f70d19a..6e77079 100755 --- a/plugins/check_mqtt +++ b/plugins/check_mqtt @@ -143,9 +143,9 @@ def on_message(mosq, userdata, msg): userdata['have_response'] = True if args.short_output == True: - message = "value=%s | response_time=%.2f value=%s" % (str(payload), elapsed, str(payload)) + message = "value=%s | 'response_time'=%.2f" % (str(payload), elapsed) else: - message = "message from %s at %s in %.2fs | response_time=%.2f value=%s" % (args.check_subscription, args.mqtt_host, elapsed, elapsed, str(payload)) + message = "%s message from %s at %s in %.2fs | 'response_time'=%.2f" % (str(payload), args.check_subscription, args.mqtt_host, elapsed, elapsed) if module_math and (args.critical is not None or args.warning is not None): status == Status.OK