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

Diff of /monit/validate.c

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

revision 1.145 by martinp, Fri Sep 30 10:25:14 2005 UTC revision 1.146 by martinp, Wed Nov 2 14:06:10 2005 UTC
# Line 477  static void check_connection(Service_T s Line 477  static void check_connection(Service_T s
477    socket= socket_create(p);    socket= socket_create(p);
478    if(!socket) {    if(!socket) {
479      snprintf(report, STRLEN,      snprintf(report, STRLEN,
480               "'%s' failed, cannot open a connection to %s",        "'%s' failed, cannot open a connection to %s via %s",
481               s->name, p->address);        s->name, p->address, Util_portTypeDescription(p));
482      rv= FALSE;      rv= FALSE;
483      goto error;      goto error;
484    } else {    } else {
485      DEBUG("'%s' succeeded connecting to %s\n",      DEBUG("'%s' succeeded connecting to %s via %s\n",
486        s->name, p->address);        s->name, p->address, Util_portTypeDescription(p));
487    }    }
488    
489    /* Verify that the socket is ready for i|o */    /* Verify that the socket is ready for i|o */
490    if(! socket_is_ready(socket)) {    if(! socket_is_ready(socket)) {
491      snprintf(report, STRLEN,      snprintf(report, STRLEN,
492               "'%s' failed, the socket at %s is not ready for i|o -- %s",        "'%s' failed, the socket at %s via %s is not ready for i|o -- %s",
493               s->name, p->address, STRERROR);        s->name, p->address, Util_portTypeDescription(p), STRERROR);
494      rv= FALSE;      rv= FALSE;
495      goto error;      goto error;
496    }    }
# Line 498  static void check_connection(Service_T s Line 498  static void check_connection(Service_T s
498    /* Run the protocol verification routine through the socket */    /* Run the protocol verification routine through the socket */
499    if(! p->protocol->check(socket)) {    if(! p->protocol->check(socket)) {
500      snprintf(report, STRLEN,      snprintf(report, STRLEN,
501               "'%s' failed protocol test [%s] at %s.",        "'%s' failed protocol test [%s] at %s via %s",
502               s->name, p->protocol->name, p->address);        s->name, p->protocol->name, p->address, Util_portTypeDescription(p));
503      rv= FALSE;      rv= FALSE;
504      goto error;      goto error;
505    } else {    } else {
506      DEBUG("'%s' succeeded testing protocol [%s] at %s\n",      DEBUG("'%s' succeeded testing protocol [%s] at %s via %s\n",
507            s->name, p->protocol->name, p->address);        s->name, p->protocol->name, p->address, Util_portTypeDescription(p));
508    }    }
509    
510    /* Get time of connection attempt finish */    /* Get time of connection attempt finish */
# Line 523  static void check_connection(Service_T s Line 523  static void check_connection(Service_T s
523    } else {    } else {
524      p->is_available= TRUE;      p->is_available= TRUE;
525      Event_post(s, EVENT_CONNECTION, STATE_PASSED, p->action,      Event_post(s, EVENT_CONNECTION, STATE_PASSED, p->action,
526        "'%s' connection passed", s->name);        "'%s' connection passed to %s via %s", s->name,
527          p->address, Util_portTypeDescription(p));
528    }    }
529                
530  }  }

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

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