#include "dnxCollector.h"
#include "dnxNebMain.h"
#include "dnxDebug.h"
#include "dnxError.h"
#include "dnxQueue.h"
#include "dnxSrvProt.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. | |
DnxChannel * | dnxCollectorGetChannel (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. |
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.
Definition in file dnxCollector.c.
#define DNX_COLLECTOR_TIMEOUT 30 |
Definition at line 47 of file dnxCollector.c.
typedef struct iDnxCollector_ iDnxCollector |
The implementation data structure for a collector object.
static void* dnxCollector | ( | void * | data | ) | [static] |
The collector thread main entry point procedure.
[in] | data | - an opaque pointer to the collector thread data structure, which is actually a DnxGlobalData object (the dnxServer global data 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, and DnxResult::xid.
int dnxCollectorCreate | ( | char * | chname, | |
char * | collurl, | |||
DnxJobList * | joblist, | |||
DnxCollector ** | pcoll | |||
) |
Create a new collector object.
[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. |
Definition at line 133 of file dnxCollector.c.
References iDnxCollector_::channel, iDnxCollector_::chname, DNX_ERR_MEMORY, DNX_ERR_THREAD, DNX_MODE_PASSIVE, DNX_OK, dnxChanMapAdd(), dnxChanMapDelete(), dnxCollector(), dnxConnect(), dnxDisconnect(), dnxErrorString(), dnxLog(), iDnxCollector_::joblist, iDnxCollector_::tid, iDnxCollector_::url, xfree, xmalloc, and xstrdup.
void dnxCollectorDestroy | ( | DnxCollector * | coll | ) |
Destroy an existing collector object.
[in] | coll | - a pointer to the collector object to be destroyed. |
Definition at line 190 of file dnxCollector.c.
References iDnxCollector_::channel, iDnxCollector_::chname, dnxChanMapDelete(), dnxDisconnect(), iDnxCollector_::tid, iDnxCollector_::url, and xfree.
DnxChannel* dnxCollectorGetChannel | ( | DnxCollector * | coll | ) |
Return a reference to the collector channel object.
[in] | coll | - the collector whose dispatch channel should be returned. |
Definition at line 128 of file dnxCollector.c.