From b48c3a190aa042edb6db13efbd8b7c316861fd42 Mon Sep 17 00:00:00 2001 From: Johan Carlquist Date: Wed, 22 Mar 2017 11:35:55 +0100 Subject: [PATCH 1/3] Stop producing invalid performance data. The performance data should be something graphable, not strings. Only produce perfdata if that is the case. --- nagios/bin/pmp-check-mysql-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nagios/bin/pmp-check-mysql-status b/nagios/bin/pmp-check-mysql-status index 89c2a6a..80bfd76 100755 --- a/nagios/bin/pmp-check-mysql-status +++ b/nagios/bin/pmp-check-mysql-status @@ -133,9 +133,9 @@ main() { # Build the common perf data output for graph trending if [ "${OPT_TRAN}" = 'pct' ]; then PERFDATA_MAX=100 + PERFDATA="${OPT_VAR1}${OPT_OPER}${OPT_VAR2}=${LEVEL};${OPT_WARN};${OPT_CRIT};0;${PERFDATA_MAX}" + NOTE="$NOTE | $PERFDATA" fi - PERFDATA="${OPT_VAR1}${OPT_OPER}${OPT_VAR2}=${LEVEL};${OPT_WARN};${OPT_CRIT};0;${PERFDATA_MAX}" - NOTE="$NOTE | $PERFDATA" fi else NOTE="UNK could not get MySQL status/variables." From 8c050d35087753fd549cc55c0846bd127b73ffae Mon Sep 17 00:00:00 2001 From: Johan Carlquist Date: Wed, 22 Mar 2017 11:35:55 +0100 Subject: [PATCH 2/3] Stop producing invalid performance data. The performance data should be something graphable, not strings. Only produce perfdata if that is the case. --- nagios/bin/pmp-check-mysql-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nagios/bin/pmp-check-mysql-status b/nagios/bin/pmp-check-mysql-status index 89c2a6a..80bfd76 100755 --- a/nagios/bin/pmp-check-mysql-status +++ b/nagios/bin/pmp-check-mysql-status @@ -133,9 +133,9 @@ main() { # Build the common perf data output for graph trending if [ "${OPT_TRAN}" = 'pct' ]; then PERFDATA_MAX=100 + PERFDATA="${OPT_VAR1}${OPT_OPER}${OPT_VAR2}=${LEVEL};${OPT_WARN};${OPT_CRIT};0;${PERFDATA_MAX}" + NOTE="$NOTE | $PERFDATA" fi - PERFDATA="${OPT_VAR1}${OPT_OPER}${OPT_VAR2}=${LEVEL};${OPT_WARN};${OPT_CRIT};0;${PERFDATA_MAX}" - NOTE="$NOTE | $PERFDATA" fi else NOTE="UNK could not get MySQL status/variables." From 23ec5c9cab5a12786e55a39b3e8f9bfc437530b1 Mon Sep 17 00:00:00 2001 From: Johan Carlquist Date: Fri, 7 Jul 2017 11:45:04 +0200 Subject: [PATCH 3/3] Not only pct is graphable. My last take on to fix this perfdata didn't work since it's only strings that can't be graphable. --- nagios/bin/pmp-check-mysql-status | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nagios/bin/pmp-check-mysql-status b/nagios/bin/pmp-check-mysql-status index 80bfd76..4e9219d 100755 --- a/nagios/bin/pmp-check-mysql-status +++ b/nagios/bin/pmp-check-mysql-status @@ -133,6 +133,8 @@ main() { # Build the common perf data output for graph trending if [ "${OPT_TRAN}" = 'pct' ]; then PERFDATA_MAX=100 + fi + if [ "${OPT_TRAN}" != 'str' ]; then PERFDATA="${OPT_VAR1}${OPT_OPER}${OPT_VAR2}=${LEVEL};${OPT_WARN};${OPT_CRIT};0;${PERFDATA_MAX}" NOTE="$NOTE | $PERFDATA" fi