258 |
} else { |
} else { |
259 |
|
|
260 |
int n; |
int n; |
261 |
char buf[STRLEN]; |
char buf[BIGSTRLEN]; |
262 |
char *auth= get_basic_authentication_header(); |
char *auth= get_basic_authentication_header(); |
263 |
|
|
264 |
socket_print(sock, "GET /%s?action=status HTTP/1.0\r\n%s\r\n", |
socket_print(sock, "GET /%s?action=status HTTP/1.0\r\n%s\r\n", |
265 |
s->name, auth); |
s->name, auth); |
266 |
free(auth); |
free(auth); |
267 |
|
|
268 |
if(0>(n= socket_read(sock, buf, STRLEN))) { |
if(0>(n= socket_read(sock, buf, BIGSTRLEN))) { |
269 |
|
|
270 |
local_status(s); |
local_status(s); |
271 |
socket_free(&sock); |
socket_free(&sock); |
292 |
} else { |
} else { |
293 |
|
|
294 |
fprintf(stdout, "The monit server did not return a process, " |
fprintf(stdout, "The monit server did not return a process, " |
295 |
"device, file or directory record.\n"); |
"device, file, directory or host record.\n"); |
296 |
local_status(s); |
local_status(s); |
297 |
|
|
298 |
} |
} |