This article covers how to install NDOUtils in Ubuntu. NDOUtils is basically the Database Output for Nagios Core.
NDOUtils stands for Nagios Data Output Utilities which is an addon that allows you to move status and event information from Nagios to a MySQL Database for later retrieval and processing.
NDOUtils consists of the following parts:
1. The NDOMOD event broker module. This module is intended to be loaded by the Nagios process at runtime. Its only role is to dump all events and data from Nagios to a TCP socket or a regular file or Unix domain socket on the local filesystem somewhere. If you want Realtime transfer of data to MySQL, dump the data to a TCP or Unix domain socket. If you want delayed transfer of data into MySQL (i.e. you need to transfer the data to another host first), dump the data to a regular file.
2. The NDO2DB daemon. This standalone daemon reads input (that was produced by the NDOMOD broker module) from a TCP or Unix domain socket, parses that data, and then dumps it into one or more MySQL databases. The daemon is capable of handling multiple client connections simultaneously, so you can have multiple instances of the NDOMOD module writing to the same TCP or Unix domain socket at the same time.
3. The FILE2SOCK utility. This simple utility reads data from a standard file and dumps it to either a TCP or a Unix domain socket. This is useful if you are having the NDOMOD module write to a standard file that you later want to send to the NDO2DB daemon. If the module and the daemon are running on different machines, you can periodically use SSH to transfer the file from the monitoring machine to the machine running the NDO2DB daemon, and then use the FILE2SOCK utility to send the contents of that file to the TCP socket or Unix domain socket that the NDO2DB daemon is reading.
4. The LOG2NDO utility. This utility is used for importing historical log archives from NetSaint and Nagios and sending them to the NDO2DB daemon. It takes a single log file as its input and can output data to either a TCP socket, a Unix domain socket or standard output.
To compile the NDO broker module, NDO2DB daemon, and additional utilities:
1. Run the commands below;
2. If the configure script is unable to locate your MySQL development libraries, you may need to help it out by using the --with-mysql-lib option.
Here's an example:
NDOUTILS Tuning Kernel Parameters includes:
NDOUTILS uses a single message queue to communicate between the broker module and the NDO2DB daemon. Depending on the operating system, there may be parameters that need to be tuned in order for this communication to work correctly.
1. kernel.msgmax is the maximum size of a single message in a message queue
2. kernel.msgmni is the maximum number of messages allowed in any one message queue
3. kernel.msgmnb is the total number of bytes allow in all messages in any one message queue
How to initialize the Database for NDOUtils installation:
Before you start using NDOUtils, you should create the database where you will be storing all Nagios related information.
Note: Only MySQL Databases are supported!
i. Create a database for storing the data (e.g. nagios)
ii. Create a username/password that has at least the following privileges for the database:
SELECT, INSERT, UPDATE, DELETE
iii. Run the DB installation script in the db/ subdirectory of the NDO distribution to create the necessary tables in the database.
iv. Make sure the database name, prefix, and username/password you just created and setup match the variable specified in the NDO2DB config file.