66 |
#define STRERROR strerror(errno) |
#define STRERROR strerror(errno) |
67 |
#define STRLEN 256 |
#define STRLEN 256 |
68 |
#define ARGMAX 64 |
#define ARGMAX 64 |
69 |
|
#define MAX_HEADERS 20 |
70 |
/* Set log file mode: "-rw-rw-r--" */ |
/* Set log file mode: "-rw-rw-r--" */ |
71 |
#define LOGMASK 0112 |
#define LOGMASK 0112 |
72 |
/* Set pid file mode: "-rw-r--r--" */ |
/* Set pid file mode: "-rw-r--r--" */ |
244 |
int port; /**< URL port part */ |
int port; /**< URL port part */ |
245 |
char *path; /**< URL path part */ |
char *path; /**< URL path part */ |
246 |
char *query; /**< URL query part */ |
char *query; /**< URL query part */ |
247 |
} *Url_T; |
} *URL_T; |
248 |
|
|
249 |
|
|
250 |
|
/** Defines a HTTP client request object */ |
251 |
|
typedef struct myrequest { |
252 |
|
URL_T url; /**< Optional URL request */ |
253 |
|
int length; /**< The length of the headers array */ |
254 |
|
int operator; /**< Response content comparison operator */ |
255 |
|
char *headers[MAX_HEADERS]; /**< HTTP headers embedded in the request */ |
256 |
|
#ifdef HAVE_REGEX_H |
257 |
|
regex_t *regex; /* regex used to test the response body */ |
258 |
|
#else |
259 |
|
char *regex; /* string to search for in the response body */ |
260 |
|
#endif |
261 |
|
} *Request_T; |
262 |
|
|
263 |
|
|
264 |
/** Defines an event notification and status receiver object */ |
/** Defines an event notification and status receiver object */ |
265 |
typedef struct mycollector { |
typedef struct mycollector { |
266 |
Url_T url; /**< URL definition */ |
URL_T url; /**< URL definition */ |
267 |
Ssl_T ssl; /**< SSL definition */ |
Ssl_T ssl; /**< SSL definition */ |
268 |
int timeout; /**< The timeout to wait for connection or i/o */ |
int timeout; /**< The timeout to wait for connection or i/o */ |
|
|
|
269 |
Socket_T socket; /**< Socket used for connection */ |
Socket_T socket; /**< Socket used for connection */ |
270 |
|
|
271 |
/** For internal use */ |
/** For internal use */ |
419 |
struct mygenericproto *next; |
struct mygenericproto *next; |
420 |
} *Generic_T; |
} *Generic_T; |
421 |
|
|
|
|
|
422 |
/** Defines a port object */ |
/** Defines a port object */ |
423 |
typedef struct myport { |
typedef struct myport { |
424 |
volatile int socket; /**< Socket used for connection */ |
volatile int socket; /**< Socket used for connection */ |
436 |
int is_available; /**< TRUE if the server/port is available */ |
int is_available; /**< TRUE if the server/port is available */ |
437 |
double response; /**< Socket connection response time */ |
double response; /**< Socket connection response time */ |
438 |
EventAction_T action; /**< Description of the action upon event occurence */ |
EventAction_T action; /**< Description of the action upon event occurence */ |
439 |
|
/** Apache-status specific parameters */ |
|
/**< Apache-status specific parameters */ |
|
440 |
struct apache_status { |
struct apache_status { |
441 |
int loglimit; /**< Max percentatge of logging processes */ |
int loglimit; /**< Max percentatge of logging processes */ |
442 |
int loglimitOP; /**< loglimit operator */ |
int loglimitOP; /**< loglimit operator */ |
461 |
} ApacheStatus; |
} ApacheStatus; |
462 |
|
|
463 |
Ssl_T SSL; /**< SSL definition */ |
Ssl_T SSL; /**< SSL definition */ |
464 |
|
Protocol_T protocol; /**< Protocol object for testing a port's service */ |
465 |
/**< Object used for testing a port's service */ |
Request_T url_request; /**< Optional url client request object */ |
|
Protocol_T protocol; |
|
466 |
|
|
467 |
/** For internal use */ |
/** For internal use */ |
468 |
struct myport *next; /**< next port in chain */ |
struct myport *next; /**< next port in chain */ |
652 |
Size_T sizelist; /**< Size check list */ |
Size_T sizelist; /**< Size check list */ |
653 |
Timestamp_T timestamplist; /**< Timestamp check list */ |
Timestamp_T timestamplist; /**< Timestamp check list */ |
654 |
Uid_T uid; /**< Uid check */ |
Uid_T uid; /**< Uid check */ |
655 |
|
URL_T urllist; /**< URLs to check for the service */ |
656 |
|
|
657 |
/** General event handlers */ |
/** General event handlers */ |
658 |
EventAction_T action_DATA; /**< Description of the action upon event */ |
EventAction_T action_DATA; /**< Description of the action upon event */ |
730 |
void daemonize() ; |
void daemonize() ; |
731 |
void gc(); |
void gc(); |
732 |
void gc_mail_list(Mail_T *); |
void gc_mail_list(Mail_T *); |
|
void gc_url(Url_T *); |
|
733 |
int kill_daemon(int); |
int kill_daemon(int); |
734 |
int exist_daemon(); |
int exist_daemon(); |
735 |
void sendmail(Mail_T); |
void sendmail(Mail_T); |