From c72251a7f9b9c8117e19db82a7a5da272c959f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 8 Jun 2015 14:38:11 +0200 Subject: [PATCH 1/3] Not using memory is a warning condition When a daemon fails `-nan` is its memory usage. --- plugins/monit/monit_parser | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/monit/monit_parser b/plugins/monit/monit_parser index 5d34a3a3..1dc5a604 100755 --- a/plugins/monit/monit_parser +++ b/plugins/monit/monit_parser @@ -54,6 +54,7 @@ if len(sys.argv) > 1 and sys.argv[1] == 'config': for process in procs: for stat in procs[process]: print "monit_%s_%s.label %s.%s" % (process, stat, process, stat) + print "monit_%s_%s.warning 1:" sys.exit(0) for process in procs: From 7220fda4ad816012cf0755e2f6437fc5c3db41bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 8 Jun 2015 17:05:20 +0200 Subject: [PATCH 2/3] print statements need variables --- plugins/monit/monit_parser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/monit/monit_parser b/plugins/monit/monit_parser index 1dc5a604..be6c39c1 100755 --- a/plugins/monit/monit_parser +++ b/plugins/monit/monit_parser @@ -54,7 +54,7 @@ if len(sys.argv) > 1 and sys.argv[1] == 'config': for process in procs: for stat in procs[process]: print "monit_%s_%s.label %s.%s" % (process, stat, process, stat) - print "monit_%s_%s.warning 1:" + print "monit_%s_%s.warning 1:" % (process, stat) sys.exit(0) for process in procs: From 25a1a06a4a0c8329b6eb6b60b438666e2595346d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 8 Jun 2015 17:10:04 +0200 Subject: [PATCH 3/3] Missing condition --- plugins/monit/monit_parser | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/monit/monit_parser b/plugins/monit/monit_parser index be6c39c1..f89bd4db 100755 --- a/plugins/monit/monit_parser +++ b/plugins/monit/monit_parser @@ -54,7 +54,8 @@ if len(sys.argv) > 1 and sys.argv[1] == 'config': for process in procs: for stat in procs[process]: print "monit_%s_%s.label %s.%s" % (process, stat, process, stat) - print "monit_%s_%s.warning 1:" % (process, stat) + if stat == 'total_memory': + print "monit_%s_%s.warning 1:" % (process, stat) sys.exit(0) for process in procs: