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

Diff of /monit/util.c

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

revision 1.78 by martinp, Tue Aug 12 11:22:17 2003 UTC revision 1.79 by martinp, Tue Aug 12 13:11:01 2003 UTC
# Line 523  void printservice(Service_T s) { Line 523  void printservice(Service_T s) {
523      printf("\n");      printf("\n");
524    }    }
525    
   if(s->md5)  
     printf(" %-20s = %s\n", "Checksum", s->md5);  
   
526    for(d= s->dependantlist; d; d= d->next)    for(d= s->dependantlist; d; d= d->next)
527      if(d->dependant != NULL)      if(d->dependant != NULL)
528        printf(" %-20s = %s\n", "Depends on Service", d->dependant);        printf(" %-20s = %s\n", "Depends on Service", d->dependant);
529    
530      if(s->checksum)
531        printf(" %-20s = if failed %s then %s\n",
532               "Checksum", s->checksum->md5, actionnames[s->checksum->action]);
533    
534    if(s->perm)    if(s->perm)
535      printf(" %-20s = if failed %o then %s\n",      printf(" %-20s = if failed %o then %s\n",
536             "Permission", s->perm->perm, actionnames[s->perm->action]);             "Permission", s->perm->perm, actionnames[s->perm->action]);
# Line 698  void printservice(Service_T s) { Line 699  void printservice(Service_T s) {
699    for(r= s->maillist; r; r= r->next) {    for(r= s->maillist; r; r= r->next) {
700            
701      printf(" %-20s = %s\n", "Alert mail to", is_str_defined(r->to));      printf(" %-20s = %s\n", "Alert mail to", is_str_defined(r->to));
702      printf("   %-18s = %s\n", "alert from", is_str_defined_default(r->from));      printf("  %-19s = %s\n", "alert from", is_str_defined_default(r->from));
703      printf("   %-18s = %s\n", "alert subject",      printf("  %-19s = %s\n", "alert subject",
704             is_str_defined_default(r->subject));             is_str_defined_default(r->subject));
705      printf("   %-18s = %-.20s%s\n", "alert message",      printf("  %-19s = %-.20s%s\n", "alert message",
706             is_str_defined_default(r->message),             is_str_defined_default(r->message),
707             r->message?"..":"");             r->message?"..":"");
708      printf("   %-18s = %s\n", "alert on start",      printf("  %-19s = %s\n", "alert on start",
709             IS_EVENT_SET(r->events, EVENT_START)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_START)?"yes":"no");
710      printf("   %-18s = %s\n", "alert on stop",      printf("  %-19s = %s\n", "alert on stop",
711             IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no");
712      printf("   %-18s = %s\n", "alert on restart",      printf("  %-19s = %s\n", "alert on restart",
713               IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no");
714      printf("   %-18s = %s\n", "alert on checksum",      printf("  %-19s = %s\n", "alert on checksum",
715             IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no");
716      printf("   %-18s = %s\n", "alert on resource",      printf("  %-19s = %s\n", "alert on resource",
717             IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no");
718      printf("   %-18s = %s\n", "alert on timeout",      printf("  %-19s = %s\n", "alert on timeout",
719             IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no");
720      printf("   %-18s = %s\n", "alert on timestamp",      printf("  %-19s = %s\n", "alert on timestamp",
721             IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no");             IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no");
722        printf("  %-19s = %s\n", "alert on connection",
723               IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no");
724        printf("  %-19s = %s\n", "alert on size",
725               IS_EVENT_SET(r->events, EVENT_SIZE)?"yes":"no");
726        printf("  %-19s = %s\n", "alert on permission",
727               IS_EVENT_SET(r->events, EVENT_PERMISSION)?"yes":"no");
728        printf("  %-19s = %s\n", "alert on uid",
729               IS_EVENT_SET(r->events, EVENT_UID)?"yes":"no");
730        printf("  %-19s = %s\n", "alert on gid",
731               IS_EVENT_SET(r->events, EVENT_GID)?"yes":"no");
732    
733    }    }
734    

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

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