dnxNebMain.h File Reference

Definitions and prototypes for main module functionality. More...

#include "dnxJobList.h"
#include <time.h>

Go to the source code of this file.

Defines

#define DNX_DISPATH_PORT   12480
#define DNX_COLLECT_PORT   12481
#define DNX_TCP_LISTEN   5

Functions

char * versionText (void)
 Format version text to an allocated string buffer.
int dnxPostResult (void *data, time_t start_time, unsigned delta, int early_timeout, int res_code, char *res_data)
 Post a completed service request to the Nagios service result buffer.
void dnxJobCleanup (DnxNewJob *pJob)
 Release all resources associated with a job object.
int dnxAuditJob (DnxNewJob *pJob, char *action)
 Send an audit message to the dnx server audit log.


Detailed Description

Definitions and prototypes for main module functionality.

Author:
Robert W. Ingraham (dnx-devel@lists.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file dnxNebMain.h.


Define Documentation

#define DNX_COLLECT_PORT   12481

Definition at line 36 of file dnxNebMain.h.

#define DNX_DISPATH_PORT   12480

Definition at line 35 of file dnxNebMain.h.

#define DNX_TCP_LISTEN   5

Definition at line 37 of file dnxNebMain.h.


Function Documentation

int dnxAuditJob ( DnxNewJob pJob,
char *  action 
)

Send an audit message to the dnx server audit log.

Parameters:
[in] pJob - the job to be audited.
[in] action - the audit action that we're logging.
Returns:
Zero on success or a non-zero error value.

Todo:
This conversion should take place in the dnxUdpRead function and the resultant address string stored in the DnxNewJob structure. This would have two benefits:
1. Encapsulates conversion at the protocol level. 2. Saves some time during logging.

Definition at line 953 of file dnxServerMain.c.

References DnxNodeRequest::address, DnxNodeRequest::addrstr, DnxCfgData::auditFilePath, DnxServerCfg::auditFilePath, DnxNewJob::cmd, DNX_OK, dnxAudit(), DnxXID::objSerial, DnxXID::objSlot, DnxNewJob::pNode, DnxNodeRequest::xid, and DnxNewJob::xid.

Referenced by dnxCollector(), dnxDispatcher(), dnxPostNewJob(), and dnxTimer().

void dnxJobCleanup ( DnxNewJob pJob  ) 

Release all resources associated with a job object.

Parameters:
[in] pJob - the job to be freed.

Definition at line 942 of file dnxServerMain.c.

References DnxNewJob::cmd, DnxNewJob::payload, DnxNewJob::pNode, and xfree.

Referenced by dnxCollector(), and dnxTimer().

int dnxPostResult ( void *  data,
time_t  start_time,
unsigned  delta,
int  early_timeout,
int  res_code,
char *  res_data 
)

Post a completed service request to the Nagios service result buffer.

If early_timeout is true (1), then res_code will be reset to STATE_UNKNOWN, so you might as well pass zero for res_code.

Parameters:
[in] data - An opaque pointer to the nagios service structure and other relevant results data.
[in] start_time - the nagios service object start time.
[in] delta - the running time of the nagios service object in seconds.
[in] early_timeout - boolean; true means the job DID time out.
[in] res_code - the result code of this job.
[in] res_data - the resulting STDOUT output text of this job.
Returns:
Zero on success, or a non-zero error code.

Todo:
Nagios 3.x: Collect a better value for exited_ok.

Todo:
Nagios 3.x: Collect a better value for check_type.

Definition at line 746 of file dnxNebMain.c.

References DnxJobData::chkopts, dnxStatsInc(), POST_RESULTS_FAILED, POST_RESULTS_OK, DnxJobData::reschedule, RESULTS_FAILED, RESULTS_OK, RESULTS_TIMED_OUT, DnxJobData::schedule, and DnxJobData::svc.

char* versionText ( void   ) 

Format version text to an allocated string buffer.

Caller is responsible to free memory buffer returned.

Returns:
An allocated string buffer containing version text.
Caller is responsible to free memory buffer returned, using xfree.

Returns:
An allocated string buffer containing version text.

Definition at line 836 of file dnxServerMain.c.

References DNX_DEFAULT_DBGLOG, DNX_DEFAULT_LOG, DNX_DEFAULT_SERVER_CONFIG_FILE, PACKAGE_BUGREPORT, s_progname, VERSION, versionText(), and xstrdup.


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6