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); |
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; |
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); |
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; |
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 |
/* |
/* |