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

Diff of /monit/validate.c

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

revision 1.144 by martinp, Mon Sep 5 09:51:38 2005 UTC revision 1.145 by martinp, Fri Sep 30 10:25:14 2005 UTC
# Line 396  int check_directory(Service_T s) { Line 396  int check_directory(Service_T s) {
396   */   */
397  int check_remote_host(Service_T s) {  int check_remote_host(Service_T s) {
398    
399    Port_T p= NULL;    Port_T p = NULL;
400    Icmp_T icmp;    Icmp_T icmp = NULL;
401      Icmp_T last_ping = NULL;
402    
403    ASSERT(s);    ASSERT(s);
404    
# Line 422  int check_remote_host(Service_T s) { Line 423  int check_remote_host(Service_T s) {
423            Event_post(s, EVENT_ICMP, STATE_PASSED, icmp->action,            Event_post(s, EVENT_ICMP, STATE_PASSED, icmp->action,
424              "'%s' passed ICMP test [%s]", s->name, icmpnames[icmp->type]);              "'%s' passed ICMP test [%s]", s->name, icmpnames[icmp->type]);
425          }          }
426            last_ping = icmp;
427          break;          break;
428    
429        default:        default:
# Line 432  int check_remote_host(Service_T s) { Line 434  int check_remote_host(Service_T s) {
434      }      }
435    }    }
436    
437      /* If we could not ping the host we assume it's down and do not
438       * continue to check any port connections  */
439      if(last_ping && !last_ping->is_available) {
440        DEBUG("'%s' icmp ping failed, skipping any port connection tests\n",
441          s->name);
442        return FALSE;
443      }
444    
445    /* Test each host:port and protocol in the service's portlist */    /* Test each host:port and protocol in the service's portlist */
446    if(s->portlist)    if(s->portlist)
447      for(p= s->portlist; p; p= p->next)      for(p= s->portlist; p; p= p->next)

Legend:
Removed from v.1.144  
changed lines
  Added in v.1.145

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