File 0011-Medium-docker-Reduce-monitor-log-spam.patch of Package resource-agents.11561
From 6c55a180fc373122d0e144451fa27709d3cf3261 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Tue, 1 Nov 2016 23:25:40 +0100
Subject: [PATCH 11/12] Medium: docker: Reduce monitor log spam
Reduce log level of successful monitor cmd to debug.
Set more informative exit reason on monitor failure.
---
heartbeat/docker | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/heartbeat/docker b/heartbeat/docker
index d173e90..8e2e779 100755
--- a/heartbeat/docker
+++ b/heartbeat/docker
@@ -182,18 +182,16 @@ monitor_cmd_exec()
rc=$?
fi
- if [ $rc -ne 0 ]; then
- ocf_log info "monitor cmd exit code = $rc"
- ocf_log info "stdout/stderr: $out"
-
- if [ $rc -eq 127 ]; then
- ocf_exit_reason "monitor_cmd, ${OCF_RESKEY_monitor_cmd} , not found within container."
- # there is no recovering from this, exit immediately
- exit $OCF_ERR_ARGS
- fi
+ if [ $rc -eq 127 ]; then
+ ocf_log err "monitor cmd failed (rc=$rc), output: $out"
+ ocf_exit_reason "monitor_cmd, ${OCF_RESKEY_monitor_cmd} , not found within container."
+ # there is no recovering from this, exit immediately
+ exit $OCF_ERR_ARGS
+ elif [ $rc -ne 0 ]; then
+ ocf_exit_reason "monitor cmd failed (rc=$rc), output: $out"
rc=$OCF_ERR_GENERIC
else
- ocf_log info "monitor cmd passed: exit code = $rc"
+ ocf_log debug "monitor cmd passed: exit code = $rc"
fi
return $rc
--
2.10.1