Icinga

12.3. Configuration of IDOUtils

12.3.1. IDOMOD config options
12.3.2. IDO2DB config options
[Note] Note

This is to be considered "work in progress".

Changes to core files

Changes in idomod.cfg

Hints on performance and troubleshooting

Changes in ido2db.cfg

idomod.cfg config options

ido2db.cfg config options

Core

The configuration starts with setting up the directive "broker_options" in icinga.cfg. In most cases this value is already present in the file but may have to be activated (by removing the leading hash sign).

[Important] Important

Keep in mind that this setting affects all event broker modules! (for details see http://www.mail-archive.com/nagios-users@lists.sourceforge.net/msg24002.html).

Enable the idomod event broker module. Please note that under normal circumstances the following module definition is already present in the modules subdirectory so there is no need to edit the main config file.

If not the definition of the broker module can be done using a module definition similar to the following:

 define module {
    module_name   ido_mod
    path          /usr/local/icinga/lib/idomod.so
    module_type   neb
    args          config_file=/usr/local/icinga/etc/idomod.cfg
 }

idomod.cfg

Please review the settings before actually (re)starting Icinga.

The directive "output_type" should be set to "unixsocket" (default) or "tcpsocket" depending on whether you try access the IDO2DB daemon remote. Please set the value of "output" accordingly (and "tcp_port" as well if applicable). The other options are set to values suitable for starters. If you encounter difficulties during operation you might want to take a look at the following lines:

Some hints on performance and troubleshooting

ido2db.cfg

12.3.1. IDOMOD config options

Instance name

Format:

instance_name=<name>

Example:

instance_name=default

This option identifies the "name" associated with this particular instance of Icinga and is used to separate data coming from multiple instances. Defaults to 'default' (without quotes).

Output type

Format:

output_type=<file>|<tcpsocket>|<unixsocket>

Example:

output_type=unixsocket

This option determines what type of output sink the IDO NEB module should use for data output.

Possible values are:

  • file = standard text file

  • tcpsocket = TCP socket

  • unixsocket = UNIX domain socket (default)

Output

Format:

output=<ip address>|<file name>

Example:

output=/usr/local/icinga/var/ido.sock

This option determines the name and path of the file or UNIX domain socket to which output will be sent if the output type option specified above is "file" or "unixsocket", respectively. If the output type option is "tcpsocket", this option is used to specify the IP address or fully qualified domain name of the host that the module should connect to for sending output.

TCP-port

Format:

tcp_port=<n>

Example:

tcp_port=5668

This option determines which port the module will connect to in order to send output. This option is only valid if the output type option specified above is "tcpsocket".

Use encryption

Format:

use_ssl=

Example:

use_ssl=0

This option determines if the module will use SSL to encrypt the network traffic between module and ido2db daemon. Both sides have to enable this feature which depends on SSL libraries like openssl or kerberos.

This option is only valid if the output type option specified above is "tcpsocket".

Output buffer size

Format:

output_buffer_items=<n>

Example:

output_buffer_items=5000

This option determines the size of the output buffer, which will help prevent data from getting lost if there is a temporary disconnect from the data sink. The number of items specified here is the number of lines (each of variable size) of output that will be buffered.

Buffer file

Format:

buffer_file=<file name>

Example:

buffer_file=/usr/local/icinga/var/idomod.tmp

This option is used to specify a file which will be used to store the contents of buffered data which could not be sent to the IDO2DB daemon before Icinga shuts down. Prior to shutting down, the IDO NEB module will write all buffered data to this file for later processing. When Icinga (re)starts, the IDO NEB module will read the contents of this file and send it to the IDO2DB daemon for processing.

File rotation interval

Format:

file_rotation_interval=<seconds>

Example:

file_rotation_interval=14400

This option determines how often (in seconds) the output file is rotated by Icinga. File rotation is handled by Icinga by executing the command defined by the file_rotation_command option. This option has no effect if the output_type option is a socket.

File rotation command

Format:

file_rotation_command=<command>

Example:

file_rotation_command=rotate_ido_log

This option specified the command (as defined in Icinga) that is used to rotate the output file at the interval specified by the file_rotation_interval option. This option has no effect if the output_type option is a socket.

See the file 'misccommands.cfg' for an example command definition that you can use to rotate the log file.

File rotation timeout

Format:

file_rotation_timeout=<seconds>

Example:

file_rotation_timeout=60

This option specified the maximum number of seconds that the file rotation command should be allowed to run before being terminated prematurely.

Reconnect interval

Format:

reconnect_interval=<seconds>

Example:

reconnect_interval=15

This option determines how often (in seconds) the IDO NEB module will attempt to re-connect to the output file or socket if a connection to it is lost.

Reconnect warning interval

Format:

reconnect_warning_interval=<seconds>

Example:

reconnect_warning_interval=15

This option determines how often (in seconds) a warning message will be logged to the Icinga log file if a connection to the output file or socket cannot be re-established.

Data processing options

Format:

data_processing_options=<n>

Example:

data_processing_options=-1

[Caution] Caution

Do not mess with this option unless you know what you're doing!!!

This option determines what data the IDO NEB module will process.

Read the source code (module/idoutils/include/idomod.h) and look for "IDOMOD_PROCESS_" to determine what values to use here.

Values from source code should be OR'ed to get the value to use here. A value of -1 will cause all data to be processed.

Basically you have to calculate from the following values

 #define IDOMOD_PROCESS_PROCESS_DATA                   1
 #define IDOMOD_PROCESS_TIMED_EVENT_DATA               2
 #define IDOMOD_PROCESS_LOG_DATA                       4
 #define IDOMOD_PROCESS_SYSTEM_COMMAND_DATA            8
 #define IDOMOD_PROCESS_EVENT_HANDLER_DATA             16
 #define IDOMOD_PROCESS_NOTIFICATION_DATA              32
 #define IDOMOD_PROCESS_SERVICE_CHECK_DATA             64
 #define IDOMOD_PROCESS_HOST_CHECK_DATA                128
 #define IDOMOD_PROCESS_COMMENT_DATA                   256
 #define IDOMOD_PROCESS_DOWNTIME_DATA                  512
 #define IDOMOD_PROCESS_FLAPPING_DATA                  1024
 #define IDOMOD_PROCESS_PROGRAM_STATUS_DATA            2048
 #define IDOMOD_PROCESS_HOST_STATUS_DATA               4096
 #define IDOMOD_PROCESS_SERVICE_STATUS_DATA            8192
 #define IDOMOD_PROCESS_ADAPTIVE_PROGRAM_DATA          16384
 #define IDOMOD_PROCESS_ADAPTIVE_HOST_DATA             32768
 #define IDOMOD_PROCESS_ADAPTIVE_SERVICE_DATA          65536
 #define IDOMOD_PROCESS_EXTERNAL_COMMAND_DATA          131072
 #define IDOMOD_PROCESS_OBJECT_CONFIG_DATA             262144
 #define IDOMOD_PROCESS_MAIN_CONFIG_DATA               524288
 #define IDOMOD_PROCESS_AGGREGATED_STATUS_DATA         1048576
 #define IDOMOD_PROCESS_RETENTION_DATA                 2097152
 #define IDOMOD_PROCESS_ACKNOWLEDGEMENT_DATA           4194304
 #define IDOMOD_PROCESS_STATECHANGE_DATA               8388608
 #define IDOMOD_PROCESS_CONTACT_STATUS_DATA            16777216
 #define IDOMOD_PROCESS_ADAPTIVE_CONTACT_DATA          33554432
 #
 #define IDOMOD_PROCESS_EVERYTHING                     67108863
 #
 # You may use the Online Calculator by Gerhard Lausser:
 # http://labs.consol.de/nagios/ndo-data-processing-options/
 # (please note that there is a checkbox for everything!)
 #
 # The default setting will remove everything not used by default.
 #       TIMED_EVENT_DATA        (-2)
 #       SERVICE_CHECK_DATA      (-64)
 #       HOST_CHECK_DATA         (-128)
 #
 # 67108863-(2+64+128) = 67108863-194 = 67108669

 data_processing_options=67108669

 # If you are planning to use NagVis you may want to use the following setting:
 #
 #data_processing_options=4061953
 #
 # You may have to experiment in your environment and find the best value yourself! 

Config output options

Format:

config_output_options=<0|1|2|3>

Example:

config_output_options=2

This option determines what types of configuration data from Icinga the IDO NEB module will dump. Values can be OR'ed together. Hint: "2" is the preferred value, doing a restart after initial startup.

Possible values are:

  • 0 = Don't dump any configuration information

  • 1 = Dump only original config (from config files)

  • 2 = Dump config only after retained information has been restored

  • 3 = Dump both original and retained configuration

Debug level

Format:

debug_level=<-1|0|1|2>

Example:

debug_level=0

This option determines how much (if any) debugging information will be written to the debug file. OR values together to log multiple types of information.

Possible values are:

  • -1 = Everything

  • 0 = Nothing

  • 1 = Process info

  • 2 = SQL queries

Debug verbosity

Format:

debug_verbosity=<0|1|2>

Example:

debug_verbosity=1

This option determines how verbose the debug log output will be.

Possible values are:

  • 0 = Brief output

  • 1 = More detailed

  • 2 = Very detailed

Debug file name

Format:

debug_file=<file name>

Example:

debug_file=/usr/local/icinga/var/idomod.debug>

This option determines where the daemon should write debugging information.

Maximum debug file size

Format:

max_debug_file_size=<bytes>

Example:

max_debug_file_size=100000000

This option determines the maximum size (in bytes) of the debug file. If the file grows larger than this size, it will be renamed with a .old extension. If a file already exists with a .old extension it will be deleted automatically. This helps to ensure that your disk space usage doesn't get out of control when debugging.

Dump status of custom variables

Format:

dump_customvar_status=0|1

Example:

dump_customvar_status=1

Custom variables are dumped as required configuration on core startup but also during runtime (there may be modifications via external commands). Since these updates happen on each host/service/contact status update without any possibility to filter via data_processing_options, this is made a separate config option. In most scenarios, those updates are not required, therefore the default option is disabled.

Possible values are:

  • 0 = disabled (default)

  • 1 = enabled

12.3.2. IDO2DB config options

Lock file

Format:

lock_file=<file name>

Example:

lock_file=ido2db.lock

This is the lockfile that IDO2DB will use to store its PID number in when it is running in daemon mode.

IDO2DB user/group

Format:

ido2db_user=<user name>

ido2db_group=<group name>

Example:

ido2db_user=icinga ido2db_group=icinga-cmd

These options determine the user/group that the daemon should run as. You can specify a number (uid/gid) or a name for either option.

Socket type

Format:

socket_type=<unix|tcp>

Example:

socket_type=unix

This option determines what type of socket the daemon will create and accept connections from.

Socket name

Format:

socket_name=<file name>

Example:

socket_name=/usr/local/icinga/rw/ido.sock

This option determines the name and path of the UNIX domain socket that the daemon will create and accept connections from. This option is only valid if the socket type specified above is "unix".

Socket Permissions

Format:

socket_perm=<n>

Example:

socket_perm=0755

This option determines the permissons of the Unix domain socket. This option is only valid if the socket type specified above is "unix". Default permissions are set to 0755.

TCP-port

Format:

tcp_port=<n>

Example:

tcp_port=5668

This option determines which port the module will connect to in order to send output. This option is only valid if the output type option specified above is "tcp".

Use encryption

Format:

use_ssl=

Example:

use_ssl=0

This option determines if the module will use SSL to encrypt the network traffic between module and ido2db daemon. Both sides have to enable this feature which depends on SSL libraries like openssl or kerberos.

This option is only valid if the output type option specified above is "tcp".

Libdbi Driver Directory

Format:

libdbi_driver_dir=@LIBDBIDRIVERDIR@

Example:

libdbi_driver_dir=/usr/local/lib/dbd

[Note] Note

!!!EXPERIMENTAL!!! This option is only valid when using libdbi as database abstraction layer (so not oracle) on compile time. By default, libdbi will figure out the correct path itself. If you want to change it, enable and change the value. Default: not in use.

Database server type

Format:

db_servertype=<type>

Example:

db_servertype=mysql

This option determines what type of DB server the daemon should connect to. Supported databases are MySQL, PostgreSQL, and Oracle

Possible values are:

  • mysql (uses libdbi)

  • pgsql (uses libdbi)

  • oracle (uses ocilib)

Database host

Format:

db_host=<host name|ip address>

Example:

db_host=localhost

This option specifies what host the DB server is running on.

MySQL: The hostname or IP address of the MySQL database server. Use empty string or "localhost" to connect to a MySQL server running on the local machine.

PostgreSQL: If this begins with a slash, it specifies Unix-domain communication rather than TCP/IP communication; the value is the name of the directory in which the socket file is stored. The default behaviour when host is not specified is to connect to a Unix-domain socket in /tmp (or whatever socket directory was specified when PostgreSQL was built).

Oracle: This setting will be ignored.

Database port

Format:

db_port=<n>

Example:

db_port=3306

This option specifies the port that the DB server is running on.

Common values are:

  • 3306 (default MySQL port)

  • 5432 (default PostgreSQL port)

  • 1521 (default Oracle port)

MySQL: The port used to remotely connect to the MySQL database server over TCP. Use "0" (zero) to accept the default socket.

PostgreSQL: Port number to connect to at the server host, or socket file name extension for Unix-domain connections.

Oracle: ocilib will ignore this, you have to modify your tnsnames.ora.

Database socket

Format:

db_socket=<file name>

Example:

db_socket=/var/lib/mysql/mysql.sock

Optional db_socket allows to specify a different socket location. This will be passed to libdbi MySQL as mysql_unix_socket, while PostgreSQL overrides the port, ocilib Oracle ignores this setting.

[Note] Note

This setting overrules db_port, making it useless!

Database name

Format:

db_name=<name>

Example:

db_name=icinga

This option specifies the name of the database that should be used.

[Note] Note

Oracle with ocilib requires tnsnames.ora filled with host, port and database information. Then you can use one of the following:

  • //DBSERVER/SID

  • SID

Database prefix

Format:

db_prefix=<name>

Example:

db_prefix=icinga_

Determines the prefix (if any) that should be prepended to table names. If you modify the table prefix, you'll need to modify the SQL script for creating the database as well!

[Note] Note

Oracle will ignore this prefix since the tablename length will exceed 30 characters.

Database user/password

Format:

db_user=<user name>

db_pass=<password>

Example:

db_user=icinga db_pass=icinga

This is the username/password that will be used to authenticate to the DB. The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on the database.

Debug level

Format:

debug_level=<-1|0|1|2>

Example:

debug_level=0

This option determines how much (if any) debugging information will be written to the debug file. OR values together to log multiple types of information.

Possible values are:

  • -1 = Everything

  • 0 = Nothing

  • 1 = Process info

  • 2 = SQL queries

Debug verbosity

Format:

debug_verbosity=<0|1|2>

Example:

debug_verbosity=1

This option determines how verbose the debug log out will be.

Possible values are:

  • 0 = Brief output

  • 1 = More detailed

  • 2 = Very detailed

Debug file name

Format:

debug_file=<file name>

Example:

debug_file=/usr/local/icinga/var/idomod.debug>

This option determines where the daemon should write debugging information.

Maximum debug file size

Format:

max_debug_file_size=<bytes>

Example:

max_debug_file_size=100000000

This option determines the maximum size (in bytes) of the debug file. If the file grows larger than this size, it will be renamed with a .old extension. If a file already exists with a .old extension it will automatically be deleted. This helps ensure your disk space usage doesn't get out of control when debugging.

Readable debug timestamp

Format:

debug_readable_timestamp=<0|1>

Example:

debug_readable_timestamp=0

This option will allow you to set a readable timestamp instead of the default unix timestamp.

Possible values are:

  • 0 = disabled (unix timestamp)

  • 1 = enabled (human readable timestamp)

OCI errors to syslog

Format:

oci_errors_to_syslog=<0|1>

Example:

oci_errors_to_syslog=0

ido2db registers an error handler in ocilib which spits all messages into debug and syslog by default. Setting this option to 0, syslog output will be disabled, only debug log will be used (if appropriate debug_level is set).

Oracle trace level

Format:

oracle_trace_level=<0|1|4|8|12>

Example:

oracle_trace_level=0

This setting activates oracle session trace for each ido2db connection using trace event. Level value must be one of the currently supported values (1,4,8,12) or 0 for off. This requires explicit "alter session" privilege, select rights to v$session and v$process are recommended.

Possible values are:

  • 0 = pseudo level TRACE OFF

  • 1 = standard SQL trace, no wait events, or bind variables

  • 4 = bind variables only

  • 8 = wait events only

  • 12 = bind variables and wait events