dnxCollector.c File Reference

Implements the DNX Collector thread. More...

#include "dnxCollector.h"
#include "dnxServerMain.h"
#include "dnxDebug.h"
#include "dnxError.h"
#include "dnxQueue.h"
#include "dnxProtocol.h"
#include "dnxJobList.h"
#include "dnxLogging.h"
#include <stdlib.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  iDnxCollector_
 The implementation data structure for a collector object. More...

Defines

#define DNX_COLLECTOR_TIMEOUT   30

Typedefs

typedef struct iDnxCollector_ iDnxCollector
 The implementation data structure for a collector object.

Functions

static void * dnxCollector (void *data)
 The collector thread main entry point procedure.
DnxChanneldnxCollectorGetChannel (DnxCollector *coll)
 Return a reference to the collector channel object.
int dnxCollectorCreate (char *chname, char *collurl, DnxJobList *joblist, DnxCollector **pcoll)
 Create a new collector object.
void dnxCollectorDestroy (DnxCollector *coll)
 Destroy an existing collector object.


Detailed Description

Implements the DNX Collector thread.

The purpose of this thread is to collect service check completion results from the worker nodes. When a service check result is collected, this thread dequeues the service check from the Jobs queue and posts the result to the existing Nagios service_result_buffer.

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

Definition in file dnxCollector.c.


Define Documentation

#define DNX_COLLECTOR_TIMEOUT   30

Definition at line 47 of file dnxCollector.c.

Referenced by dnxCollector().


Typedef Documentation

typedef struct iDnxCollector_ iDnxCollector

The implementation data structure for a collector object.


Function Documentation

static void* dnxCollector ( void *  data  )  [static]

The collector thread main entry point procedure.

Parameters:
[in] data - an opaque pointer to the collector thread data structure, which is actually a DnxGlobalData object (the dnxServer global data structure).
Returns:
Always returns NULL.

Todo:
Wrapper release DnxResult structure.

Definition at line 71 of file dnxCollector.c.

References DnxResult::address, iDnxCollector_::channel, DnxResult::delta, DNX_COLLECTOR_TIMEOUT, DNX_ERR_TIMEOUT, DNX_OK, dnxAuditJob(), dnxDebug(), dnxErrorString(), dnxJobCleanup(), dnxJobListCollect(), dnxLog(), dnxPostResult(), dnxWaitForResult(), iDnxCollector_::joblist, DnxXID::objSerial, DnxXID::objSlot, DnxNewJob::payload, DnxResult::resCode, DnxResult::resData, DnxNewJob::start_time, xfree, DnxNewJob::xid, and DnxResult::xid.

Referenced by dnxCollectorCreate().

int dnxCollectorCreate ( char *  chname,
char *  collurl,
DnxJobList joblist,
DnxCollector **  pcoll 
)

Create a new collector object.

Parameters:
[in] chname - the name of the collect channel.
[in] collurl - the collect channel URL.
[in] joblist - a pointer to the global job list object.
[out] pcoll - the address of storage for the return of the new collector object.
Returns:
Zero on success, or a non-zero error value.

Definition at line 133 of file dnxCollector.c.

Referenced by dnxServerInit().

void dnxCollectorDestroy ( DnxCollector coll  ) 

Destroy an existing collector object.

Parameters:
[in] coll - a pointer to the collector object to be destroyed.

Definition at line 190 of file dnxCollector.c.

Referenced by dnxServerDeInit().

DnxChannel* dnxCollectorGetChannel ( DnxCollector coll  ) 

Return a reference to the collector channel object.

Parameters:
[in] coll - the collector whose dispatch channel should be returned.
Returns:
A pointer to the collector channel object.

Definition at line 128 of file dnxCollector.c.


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