From 9f676f527622461be2d7355afb53fbefab051039 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 11 Jul 2013 20:29:06 +0100 Subject: [PATCH] output: allow alarming, in case of success, be silent This will allow runnign dhcpd with cron, and when nothing is wrong emails will not be sent. Proposed-by: Dan Pritts Signed-off-by: Sami Kerola --- src/output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output.c b/src/output.c index 08cdfdf..e45acaf 100644 --- a/src/output.c +++ b/src/output.c @@ -1071,7 +1071,10 @@ int output_alarming(void) program_name); } else { ret_val = 0; - fprintf(outfile, "OK: "); + if (config.output_limit[1] & BIT3) + fprintf(outfile, "OK: "); + else + return ret_val; } if (config.output_limit[0] & BIT1) { fprintf(outfile, "Ranges; crit: %d warn: %d ok: %d ", rc, rw,