implement host failures count threshold, before sending first SMS
This commit is contained in:
parent
75c7a1be71
commit
b285350e36
3
yasnd.c
3
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* phone_connection=NULL; // gammu phone connection type, for example: "at"
|
||||||
char* recipient_number=NULL; // recipient of sms alerts
|
char* recipient_number=NULL; // recipient of sms alerts
|
||||||
bool loop_locked=false ; // flag for locking main loop while config re-reading
|
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)
|
void log_debug(const char *message,int verbosity)
|
||||||
{
|
{
|
||||||
@ -186,7 +187,7 @@ void loop_function()
|
|||||||
}
|
}
|
||||||
for (int i=0;i<hosts_count;i++)
|
for (int i=0;i<hosts_count;i++)
|
||||||
{
|
{
|
||||||
if (hosts[i].fail_count>0 && !hosts[i].alert_sent)
|
if (hosts[i].fail_count>failures_first && !hosts[i].alert_sent)
|
||||||
{
|
{
|
||||||
char message[100];
|
char message[100];
|
||||||
sprintf(message,"Host %s does not answer",hosts[i].hostname);
|
sprintf(message,"Host %s does not answer",hosts[i].hostname);
|
||||||
|
Loading…
Reference in New Issue
Block a user