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

General Purpose API
[Service Check Library]


Typedefs

typedef chksvc_status_t *(* chksvc_check_fnptr_t )(chksvc_frame_t *, chksvc_service_t *, apr_pool_t *)

Functions

 chksvc_initialize (apr_pool_t *pool)
 chksvc_register (const char *name, chksvc_check_fnptr_t fn)
 chksvc_unregister (const char *name)
 chksvc_check (const char *addr, short port, const char *type, sul_boolean_t use_ssl, apr_pool_t *pool)
 chksvc_check_service (chksvc_service_t *service, apr_pool_t *pool)

Typedef Documentation

typedef chksvc_status_t*(* chksvc_check_fnptr_t)(chksvc_frame_t*, chksvc_service_t*, apr_pool_t*)
 

Service check function pointer type. All service check functions should match this pointer's prototype. Each service check function gets a check frame that holds the context for the check, including regular expression values and the information given when the check was started. A service is also given which just has the socket, port, polling, and other data structures necessary for the check.


Function Documentation

chksvc_check const char *  addr,
short  port,
const char *  type,
sul_boolean_t  use_ssl,
apr_pool_t *  pool
 

Checks a service and returns its status. This is the heart of the library and the whole reason we're around. Some of the parameters given to this function may or may not be used by the service check, it all depends on the type of service being checked.

Parameters:
addr Address of the machine hosting the service.
port Port that the service is running on. This may only be useful for some services, HTTP for example. For others, the port is meaningless, like NIS or NFS.
type Type of service, used to lookup the proper service check function.
use_ssl Flag indicating if we should use SSL to do the check, this is only appropriate for some services, for others it's quite meaningless (NIS for example)
pool Pool for dynamic memory and resource allocation.
Returns:
Status of the service, also indicates if an error occured and contains details of any problems that occured and any information useful in diagnosing the situation. In the case of success, other useful statistics are given, such as how long the service took to respond.

chksvc_check_service chksvc_service_t service,
apr_pool_t *  pool
 

Checks a service and returns its status. This is almost identical to the chksvc_check function, but it takes an already constructed chksvc_service_t object.

Parameters:
service Service to be checked.
pool Pool for dynamic memory and resource allocation.
Returns:
Status of the service, also indicates if an error occured and contains details of any problems that occured and any information useful in diagnosing the situation. In the case of success, other useful statistics are given, such as how long the service took to respond.

chksvc_initialize apr_pool_t *  pool  ) 
 

Initialzies the library. This function MUST be called before any service checks are done and before any functions are registered. Basically, this function registers all of the default service check functions and sets up the internal data structures.

Parameters:
pool Pool for dynamic memory and resource allocation.
Returns:
Success or general failure.

chksvc_register const char *  name,
chksvc_check_fnptr_t  fn
 

Registers a service check function with the library. Each service check functions gets a unique name, which is used to identify the type of service check. Typically, the name is the acronym used for the protocol, such as HTTP or NIS.

Parameters:
name Name of the service type being registered, e.g. AUTH, NFS, etc...
fn Pointer to the function that will be invoked to do the service check.

chksvc_unregister const char *  name  ) 
 

Unregisters a service check function with the given name. After this function checks of the specified service type will no longer be possible, the library will return an error.

Parameters:
name Name of the service type being unregistered.


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