196 |
|
|
197 |
if(! check_process_state(s, report)) { |
if(! check_process_state(s, report)) { |
198 |
|
|
199 |
smtp_alert_resource(s, "Reason: %s\n", report); |
alert_resource(s, "Reason: %s\n", report); |
200 |
|
|
201 |
} else { |
} else { |
202 |
|
|
211 |
switch(pr->action) { |
switch(pr->action) { |
212 |
case ACTION_ALERT: |
case ACTION_ALERT: |
213 |
if(s->def_timeout) s->nstart++; |
if(s->def_timeout) s->nstart++; |
214 |
smtp_alert_resource(s, "Reason: %s\n", report); |
alert_resource(s, "Reason: %s\n", report); |
215 |
/* We are also interested in other alerts/stops/restarts! */ |
/* We are also interested in other alerts/stops/restarts! */ |
216 |
pr->cycle=0; |
pr->cycle=0; |
217 |
break; |
break; |
272 |
|
|
273 |
switch(td->action) { |
switch(td->action) { |
274 |
case ACTION_ALERT: |
case ACTION_ALERT: |
275 |
smtp_alert_resource(s, "Reason: %s\n", report); |
alert_resource(s, "Reason: %s\n", report); |
276 |
break; |
break; |
277 |
|
|
278 |
case ACTION_STOP: |
case ACTION_STOP: |
363 |
switch(tl->action) { |
switch(tl->action) { |
364 |
case ACTION_ALERT: |
case ACTION_ALERT: |
365 |
if(s->def_timeout) s->nstart++; |
if(s->def_timeout) s->nstart++; |
366 |
smtp_alert_timestamp(s, "Reason: %s\n", report); |
alert_timestamp(s, "Reason: %s\n", report); |
367 |
break; /* continue */ |
break; /* continue */ |
368 |
|
|
369 |
case ACTION_STOP: |
case ACTION_STOP: |
421 |
|
|
422 |
log("Trying to restart '%s'\n", s->name); |
log("Trying to restart '%s'\n", s->name); |
423 |
check_service(s->name, "restart"); |
check_service(s->name, "restart"); |
424 |
smtp_alert_restart(s, "%s", tmp); |
alert_restart(s, "%s", tmp); |
425 |
|
|
426 |
} else { |
} else { |
427 |
|
|
428 |
smtp_alert_failed(s, "%s", tmp); |
alert_failed(s, "%s", tmp); |
429 |
|
|
430 |
} |
} |
431 |
|
|
459 |
if(s->mode!= MODE_PASSIVE && s->start) { |
if(s->mode!= MODE_PASSIVE && s->start) { |
460 |
|
|
461 |
check_service(s->name, "start"); |
check_service(s->name, "start"); |
462 |
smtp_alert_restart(s, "%s", tmp); |
alert_restart(s, "%s", tmp); |
463 |
|
|
464 |
} else { |
} else { |
465 |
|
|
466 |
smtp_alert_failed(s, "%s", tmp); |
alert_failed(s, "%s", tmp); |
467 |
|
|
468 |
} |
} |
469 |
|
|
497 |
|
|
498 |
if(s->mode!= MODE_PASSIVE && s->stop) { |
if(s->mode!= MODE_PASSIVE && s->stop) { |
499 |
|
|
500 |
smtp_alert_stop(s, "%s", tmp); |
alert_stop(s, "%s", tmp); |
501 |
check_service(s->name, "stop"); |
check_service(s->name, "stop"); |
502 |
|
|
503 |
} else { |
} else { |
505 |
if(s->def_timeout) |
if(s->def_timeout) |
506 |
s->nstart++; |
s->nstart++; |
507 |
|
|
508 |
smtp_alert_failed(s, "%s", tmp); |
alert_failed(s, "%s", tmp); |
509 |
|
|
510 |
} |
} |
511 |
|
|
960 |
log("**Alert** service '%s' timed out and will not be checked anymore.\n", |
log("**Alert** service '%s' timed out and will not be checked anymore.\n", |
961 |
s->name); |
s->name); |
962 |
|
|
963 |
smtp_alert_timeout(s, NULL); |
alert_timeout(s, NULL); |
964 |
|
|
965 |
return TRUE; |
return TRUE; |
966 |
|
|
1033 |
if(c->file && c->md5 && !check_md5(c->file, c->md5)) { |
if(c->file && c->md5 && !check_md5(c->file, c->md5)) { |
1034 |
|
|
1035 |
log("'%s' CHECKSUM ERROR for %s\n", s->name, c->file); |
log("'%s' CHECKSUM ERROR for %s\n", s->name, c->file); |
1036 |
smtp_alert_checksum(s, NULL); |
alert_checksum(s, NULL); |
1037 |
|
|
1038 |
LOCK(Run.mutex) |
LOCK(Run.mutex) |
1039 |
s->do_validate= FALSE; |
s->do_validate= FALSE; |