/[monit]/monit/http/cervlet.c
ViewVC logotype

Diff of /monit/http/cervlet.c

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

revision 1.99 by hauk, Wed Sep 24 00:42:27 2003 UTC revision 1.100 by hauk, Wed Sep 24 02:19:49 2003 UTC
# Line 100  static void do_service_directory(HttpReq Line 100  static void do_service_directory(HttpReq
100  static void do_service_file(HttpRequest, HttpResponse, Service_T);  static void do_service_file(HttpRequest, HttpResponse, Service_T);
101  static void do_service_process(HttpRequest, HttpResponse, Service_T);  static void do_service_process(HttpRequest, HttpResponse, Service_T);
102  static void do_service_host(HttpRequest, HttpResponse, Service_T);  static void do_service_host(HttpRequest, HttpResponse, Service_T);
103    static void print_alerts(HttpResponse res, Service_T s);
104    
105    
106  /**  /**
# Line 1422  static void do_service_device(HttpReques Line 1423  static void do_service_device(HttpReques
1423                  "<tr><td>Inodes free</td><td>-</font></td></tr>");                  "<tr><td>Inodes free</td><td>-</font></td></tr>");
1424      }      }
1425    }    }
1426    {    
1427      Mail_T r;    print_alerts(res, s);
1428      for(r= s->maillist; r; r= r->next) {    
       out_print(res,  
                 "<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td>"  
                 "<td>%s</td></tr>", r->to?r->to:"");  
     }  
   }  
1429    out_print(res, "</table>");    out_print(res, "</table>");
1430    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");
1431    /* Start program */    /* Start program */
# Line 1590  static void do_service_directory(HttpReq Line 1586  static void do_service_directory(HttpReq
1586              "<font color='#ff0000'>":              "<font color='#ff0000'>":
1587              "<font>",              "<font>",
1588              (int)stat_buf.st_gid);              (int)stat_buf.st_gid);
1589    {    
1590      Mail_T r;    print_alerts(res, s);
1591      for(r= s->maillist; r; r= r->next) {    
       out_print(res,  
                 "<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td>"  
                 "<td>%s</td></tr>", r->to?r->to:"");  
     }  
   }  
1592    out_print(res, "</table>");    out_print(res, "</table>");
1593    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");
1594    /* Start program */    /* Start program */
# Line 1779  static void do_service_file(HttpRequest Line 1770  static void do_service_file(HttpRequest
1770              "<font color='#ff0000'>":              "<font color='#ff0000'>":
1771              "<font>",              "<font>",
1772              (int)stat_buf.st_gid);              (int)stat_buf.st_gid);
1773    {  
1774      Mail_T r;    print_alerts(res, s);
1775      for(r= s->maillist; r; r= r->next) {  
       out_print(res,  
                 "<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td><td>%s"  
                 "</td></tr>", r->to?r->to:"");  
     }  
   }  
1776    out_print(res, "</table>");    out_print(res, "</table>");
1777    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");
1778    /* Start program */    /* Start program */
# Line 2026  static void do_service_process(HttpReque Line 2012  static void do_service_process(HttpReque
2012                "Timeout if %d restart within %d cycles</td></tr>",                "Timeout if %d restart within %d cycles</td></tr>",
2013                s->to_start, s->to_cycle);                s->to_start, s->to_cycle);
2014    }    }
2015    {    
2016      Mail_T r;    print_alerts(res, s);
2017      for(r= s->maillist; r; r= r->next) {    
       out_print(res,  
                 "<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td><td>%s</td></tr>",  
                 r->to?r->to:"");  
     }  
   }  
2018    out_print(res, "</table>");    out_print(res, "</table>");
2019    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");
2020    /* Start program */    /* Start program */
# Line 2173  static void do_service_host(HttpRequest Line 2154  static void do_service_host(HttpRequest
2154                "Timeout if %d restart within %d cycles</td></tr>",                "Timeout if %d restart within %d cycles</td></tr>",
2155                s->to_start, s->to_cycle);                s->to_start, s->to_cycle);
2156    }    }
2157    {    
2158      Mail_T r;    print_alerts(res, s);
2159      for(r= s->maillist; r; r= r->next) {    
       out_print(res,  
                 "<tr bgcolor=\"#EFEFEF\"><td>"  
                 "Alert mail to</td><td>%s</td></tr>",  
                 r->to?r->to:"");  
     }  
   }  
2160    out_print(res, "</table>");    out_print(res, "</table>");
2161    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");    out_print(res, "<table cellspacing=16><tr nowrap><td><font size=+1>");
2162    /* Start program */    /* Start program */
# Line 2218  static void do_service_host(HttpRequest Line 2193  static void do_service_host(HttpRequest
2193    }    }
2194    
2195  }  }
2196    
2197    
2198    /* ------------------------------------------------------------------------- */
2199    
2200    
2201    static void print_alerts(HttpResponse res, Service_T s) {
2202    
2203      Mail_T r;
2204      
2205      for(r= s->maillist; r; r= r->next) {
2206        out_print(res,
2207                  "<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td>"
2208                  "<td>%s</td></tr>", r->to?r->to:"");
2209        out_print(res, "<tr><td>Alert on</td><td>");
2210    
2211        if(r->events == (~((unsigned int)0))) {
2212          
2213          out_print(res, "All events");
2214    
2215        } else {
2216          if(IS_EVENT_SET(r->events, EVENT_START))
2217              out_print(res, "Start ");
2218          if(IS_EVENT_SET(r->events, EVENT_STOP))
2219              out_print(res, "Stop ");
2220          if(IS_EVENT_SET(r->events, EVENT_RESTART))
2221              out_print(res, "Restart ");
2222          if(IS_EVENT_SET(r->events, EVENT_CHECKSUM))
2223              out_print(res, "Checksum ");
2224          if(IS_EVENT_SET(r->events, EVENT_RESOURCE))
2225              out_print(res, "Resource ");
2226          if(IS_EVENT_SET(r->events, EVENT_TIMEOUT))
2227              out_print(res, "Timeout ");
2228          if(IS_EVENT_SET(r->events, EVENT_TIMESTAMP))
2229              out_print(res, "Timestamp ");
2230          if(IS_EVENT_SET(r->events, EVENT_SIZE))
2231              out_print(res, "Size ");
2232          if(IS_EVENT_SET(r->events, EVENT_CONNECTION))
2233              out_print(res, "Connection ");
2234          if(IS_EVENT_SET(r->events, EVENT_PERMISSION))
2235              out_print(res, "Permission ");
2236          if(IS_EVENT_SET(r->events, EVENT_UID))
2237              out_print(res, "Uid ");
2238          if(IS_EVENT_SET(r->events, EVENT_GID))
2239              out_print(res, "Gid ");
2240          if(IS_EVENT_SET(r->events, EVENT_UNMONITOR))
2241              out_print(res, "Unmonitor ");
2242        }
2243          
2244        out_print(res, "</td></tr>");
2245    
2246      }
2247    
2248    }

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

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