8
Feb/10
0

Nagios Event Broker: event_broker_options

The Nagios Event Broker (NEB) API is very powerful. A large amount of different events in the Nagios Core can be hooked using the NEB modules which are connected to the API. With that many events and type of events there might be a big overhead cause particular modules only need a little group of those events.

There is a default way to control which type of events are forwarded to the NEB modules. The option is called event_broker_options and located in the Nagios configuration file (nagios.cfg).

event_broker_options default

By default the option event_broker_options is set as follows in nagios.cfg:

event_broker_options=-1

That is very verbose. Depending on the type of NEB module you use it may result in a big overhead and much needless system load.

Effects of event_broker_options

The value of event_broker_options affects the behavior of the Nagios side of the NEB modules. This means that changing that value will affect ALL your connected NEB modules. This may be no problem when you only use one NEB module.

If you use several NEB modules it may be better to set the analog options in the configuration files of the NEB module. This assumes the module supports such an option. For example the ndomod from the NDOUtils package (ndomod.o) supports such an option, it is called data_processing_options.

But be aware: The values listed below are only valid for the Nagios side of the NEB interface. The options may differ in the modules.

event_broker_options format

To be able to gather the correct value for your needs you need to understand the format of the value. When setting to something other than -1 it is handled as bitmask. In a bitmask the value is calculated by the summary of the single valid options.

The valid options can be taken from the source code of Nagios. The definitions are located in the file include/broker.h.

Here is a list of all values which are currently supported by the NDOUtils:

/*************** EVENT BROKER OPTIONS *****************/
 
#define BROKER_NOTHING                  0
#define BROKER_EVERYTHING               1048575
 
#define BROKER_PROGRAM_STATE            1       /* DONE */
#define BROKER_TIMED_EVENTS             2       /* DONE */
#define BROKER_SERVICE_CHECKS           4       /* DONE */
#define BROKER_HOST_CHECKS              8       /* DONE */
#define BROKER_EVENT_HANDLERS           16      /* DONE */
#define BROKER_LOGGED_DATA              32      /* DONE */
#define BROKER_NOTIFICATIONS            64      /* DONE */
#define BROKER_FLAPPING_DATA            128     /* DONE */
#define BROKER_COMMENT_DATA             256     /* DONE */
#define BROKER_DOWNTIME_DATA            512     /* DONE */
#define BROKER_SYSTEM_COMMANDS          1024    /* DONE */
#define BROKER_OCP_DATA                 2048    /* DONE */
#define BROKER_STATUS_DATA              4096    /* DONE */
#define BROKER_ADAPTIVE_DATA            8192    /* DONE */
#define BROKER_EXTERNALCOMMAND_DATA     16384   /* DONE */
#define BROKER_RETENTION_DATA           32768   /* DONE */
#define BROKER_ACKNOWLEDGEMENT_DATA     65536
#define BROKER_STATECHANGE_DATA         131072
#define BROKER_RESERVED18               262144
#define BROKER_RESERVED19               524288

For example to get only the general program status of Nagios and all timed events in Nagios you need to summarize the values of BROKER_PROGRAM_STATE (1) and BROKER_TIMED_EVENTS (2) and set event_broker_options to the value of 3.

To gather the correct number for your needs you can do three things:

  • Read documentations of third parties or search the net for any hints
  • Trial and error – Check with which options your 3rd party addon works
  • Know which option affects the target system in which way. For example in the NDOUtils you may know the tables you need to be filled and then need to know which value affects which table.

Correct values for 3rd party addons

It may be some kind of hard to gather the correct values for event_broker_options and data_processing_options for the different Nagios addons. Some of the values for the most common addons are linked here:

Filed under: Nagios
Comments (0) Trackbacks (0)

No comments yet.

No trackbacks yet.