/[monit]/monit/protocols/apache_status.c
ViewVC logotype

Diff of /monit/protocols/apache_status.c

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

revision 1.4 by martinp, Thu Jan 6 20:51:50 2005 UTC revision 1.5 by hauk, Sun Jan 9 01:05:57 2005 UTC
# Line 46  Line 46 
46  #include "protocol.h"  #include "protocol.h"
47    
48  #undef   READ_SIZE  #undef   READ_SIZE
49  #define  READ_SIZE  8192  #define  READ_SIZE  1024
50    
51  /* Private prototypes */  /* Private prototypes */
52  static int check_apache_stat(Socket_T s);  static int check_apache_stat(Socket_T s);
# Line 103  static int check_apache_stat(Socket_T s) Line 103  static int check_apache_stat(Socket_T s)
103        
104    int scored = 0;    int scored = 0;
105    int errors = 0;    int errors = 0;
106    char line[STRLEN];    char line[READ_SIZE];
107    char search_string[STRLEN];    char search_string[READ_SIZE];
108    
109    int loglimit= 0;    int loglimit= 0;
110    int closelimit= 0;    int closelimit= 0;
# Line 145  static int check_apache_stat(Socket_T s) Line 145  static int check_apache_stat(Socket_T s)
145    cleanuplimit= myPort->ApacheStatus.cleanuplimit;    cleanuplimit= myPort->ApacheStatus.cleanuplimit;
146    
147    
148    while(NULL != socket_readln(s, line, STRLEN)) {    while(NULL != socket_readln(s, line, READ_SIZE)) {
149      if(Util_startsWith(line, "Scoreboard")) {        if(Util_startsWith(line, "Scoreboard")) {  
150        if(1 != sscanf(line, "%*s%*[: ]%s", search_string)) {        if(1 != sscanf(line, "%*s%*[: ]%s", search_string)) {
151         Util_chomp(line);         Util_chomp(line);
# Line 159  static int check_apache_stat(Socket_T s) Line 159  static int check_apache_stat(Socket_T s)
159        
160    DEBUG("Scoreboard: %s\n", search_string);    DEBUG("Scoreboard: %s\n", search_string);
161        
162    /*Check that some scoreboard line was found, if not return an error*/    /* Check that some scoreboard line was found, if not return an error */
163    if(!scored){    if(!scored){
164      log("APACHE-STATUS error: no scoreboard line returned by Apache\n");      log("APACHE-STATUS error: no scoreboard line returned by Apache\n");
165      return FALSE;      return FALSE;
# Line 206  static int check_apache_stat(Socket_T s) Line 206  static int check_apache_stat(Socket_T s)
206    }    }
207    
208    if(active_servers <= 0){    if(active_servers <= 0){
209      log("APACHE-STATUS error: No active servers found\n");      log("APACHE-STATUS warning: No idle server or threads found\n");
210      return FALSE;      /* This is not really an error, only a very bussy server */
211        return TRUE;
212    }    }
213    
214    /*    /*

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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