From b285350e3693831ee1746e768f1999220f0d82df Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Tue, 13 Dec 2011 19:15:45 +0400 Subject: [PATCH] implement host failures count threshold, before sending first SMS --- yasnd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yasnd.c b/yasnd.c index a0eeb7c..a1eb011 100644 --- a/yasnd.c +++ b/yasnd.c @@ -23,6 +23,7 @@ char* phone_model=NULL; // gammu phone model, for example: "at" char* phone_connection=NULL; // gammu phone connection type, for example: "at" char* recipient_number=NULL; // recipient of sms alerts bool loop_locked=false ; // flag for locking main loop while config re-reading +int failures_first=3 ; // count of failures while hosts checking, that triggers first SMS sending void log_debug(const char *message,int verbosity) { @@ -186,7 +187,7 @@ void loop_function() } for (int i=0;i0 && !hosts[i].alert_sent) + if (hosts[i].fail_count>failures_first && !hosts[i].alert_sent) { char message[100]; sprintf(message,"Host %s does not answer",hosts[i].hostname);