Main Page | Modules | Data Structures | File List | Data Fields

Service Check API
[Service Check Library]


Defines

#define CHKSVC_GENERAL(service, test, code, str, msg, pool)   if (test != APR_SUCCESS) return (chksvc_status_create(service, str, code, msg, pool));
#define CHKSVC_WARNING(test, service, msg, pool)   CHKSVC_GENERAL(service, test, -1, "WARNING", msg, pool)
#define CHKSVC_FATAL(test, service, msg, pool)   CHKSVC_GENERAL(service, test, -2, "FATAL", msg, pool)
#define CHKSVC_STATUS_SUCCESS(service, pool)   chksvc_status_create(service, "NORMAL", 0, "Normal", pool)

Functions

apr_status_t chksvc_connection_send (chksvc_frame_t *cf, const char *str, apr_pool_t *pool)
apr_status_t chksvc_connection_receive_until (chksvc_frame_t *cf, const char *str, apr_pool_t *pool)
apr_status_t chksvc_connection_close (chksvc_frame_t *cf, apr_pool_t *pool)
apr_status_t chksvc_connection_discard (chksvc_frame_t *cf, apr_pool_t *pool)

Define Documentation

#define CHKSVC_FATAL test,
service,
msg,
pool   )     CHKSVC_GENERAL(service, test, -2, "FATAL", msg, pool)
 

Creates a new chksvc_status_t object for FATAL if the given condition test fails.

Parameters:
test Expression to evaluate that determines if a FATAL condition has been reached.
service A service that is being checked.
msg Message describing the problem that went wrong should test fail and a FATAL condition be reached.
pool Pool for dynamic memory and resource allocation.

#define CHKSVC_GENERAL service,
test,
code,
str,
msg,
pool   )     if (test != APR_SUCCESS) return (chksvc_status_create(service, str, code, msg, pool));
 

Creates a new chksvc_status_t object with the given properties if the specified condition test fails.

Parameters:
service A service.
test Expression to evaluate that determines if a FATAL condition has been reached.
code Numeric code describing the status.
str String with the short description of the status (FATAL, WARNING, etc...)
msg Message giving miscellaneous details for human consumption on the status.
pool Pool for dynamic memory and resource allocation.

#define CHKSVC_STATUS_SUCCESS service,
pool   )     chksvc_status_create(service, "NORMAL", 0, "Normal", pool)
 

Creates a new chksvc_status_t object for SUCCESS.

Parameters:
service A service that is being checked.
pool Pool for dynamic memory and resource allocation.

#define CHKSVC_WARNING test,
service,
msg,
pool   )     CHKSVC_GENERAL(service, test, -1, "WARNING", msg, pool)
 

Creates a new chksvc_status_t object for WARNING if the given condition test fails.

Parameters:
test Expression to evaluate that determines if a FATAL condition has been reached.
service A service that is being checked.
msg Message describing the problem that went wrong should test fail and a WARNING condition be reached.
pool Pool for dynamic memory and resource allocation.


Function Documentation

apr_status_t chksvc_connection_close chksvc_frame_t cf,
apr_pool_t *  pool
 

Closes the services connection. No more reading or writing to or from the connection can be done.

Parameters:
cf Check frame storing the information on the active service check the "check-time" information, and the context for regular expression variables and other properties.
pool Pool for dynamic memory and resource allocation.
Returns:
Success or failure.

apr_status_t chksvc_connection_discard chksvc_frame_t cf,
apr_pool_t *  pool
 

Discards any remaining data from the service's connection. This basically keeps reading until an EOF is reached. Most commonly used when the service insists on sending us a bunch of data and good behavior says that we should receive their information (HTTP for example).

Parameters:
cf Check frame storing the information on the active service check the "check-time" information, and the context for regular expression variables and other properties.
pool Pool for dynamic memory and resource allocation.
Returns:
Success or failure.

apr_status_t chksvc_connection_receive_until chksvc_frame_t cf,
const char *  str,
apr_pool_t *  pool
 

Keeps reading data from the service connection until a given regular experssion matches. If the connection is closed then this function will return an error. If there's a timeout problem reading from the connection then this function will return an error.

Parameters:
cf Check frame storing the information on the active service check the "check-time" information, and the context for regular expression variables and other properties.
str Regular expression to check for and to "EXPECT".
pool Pool for dynamic memory and resource allocation.
Returns:
Success or failure.

apr_status_t chksvc_connection_send chksvc_frame_t cf,
const char *  str,
apr_pool_t *  pool
 

Sends a string over the service's connection. Interpolation is done on the string and so tokens such as $1 and $2 will be recognized and replaced with the appropriate match from a previous regular expression. If there are any errors sending the complete string, then this function will fail as appropriate.

Parameters:
cf Check frame storing the information on the active service check the "check-time" information, and the context for regular expression variables and other properties.
str A c-style string to send.
pool Pool for dynamic memory and resource allocation.
Returns:
Success or failure.


Generated on Wed Apr 28 09:38:37 2004 for State by doxygen 1.3.5