/[monit]/monit/validate.c
ViewVC logotype

Diff of /monit/validate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43 by martinp, Sun Jun 22 18:02:31 2003 UTC revision 1.44 by hauk, Tue Jun 24 02:49:09 2003 UTC
# Line 196  static void do_validate(Service_T s, Pro Line 196  static void do_validate(Service_T s, Pro
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                
# Line 211  static void do_validate(Service_T s, Pro Line 211  static void do_validate(Service_T s, Pro
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;
# Line 272  static void do_validate(Service_T s, Pro Line 272  static void do_validate(Service_T s, Pro
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:
# Line 363  static void do_validate(Service_T s, Pro Line 363  static void do_validate(Service_T s, Pro
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:
# Line 421  static void do_restart(Service_T s, char Line 421  static void do_restart(Service_T s, char
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    
# Line 459  static void do_start(Service_T s, char * Line 459  static void do_start(Service_T s, char *
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    
# Line 497  static void do_stop(Service_T s, char *m Line 497  static void do_stop(Service_T s, char *m
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 {
# Line 505  static void do_stop(Service_T s, char *m Line 505  static void do_stop(Service_T s, char *m
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    
# Line 960  static int check_timeout(Service_T s) { Line 960  static int check_timeout(Service_T s) {
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            
# Line 1033  static int check_checksum(Service_T s) { Line 1033  static int check_checksum(Service_T s) {
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;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26