From e38fb714b7cb4831603c687a7130cef264d6e607 Mon Sep 17 00:00:00 2001 From: Michael Howe Date: Sat, 9 Jan 2021 14:59:47 +0000 Subject: [PATCH] Remove value=payload from perf data Per icinga2 docs, perfdata should be 'metric'=number - arbitrary strings aren't supported. --- debian/changelog | 4 ++-- plugins/check_mqtt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.5