# Components

## Overview

There are four main components that make up the NDO utilities:

1. NDOMOD Event Broker Module

2. LOG2NDO Utility

3. FILE2SOCK Utility

4. NDO2DB Daemon

Each component is described in more detail on the following pages.

## NDOMOD

The NDO utilities includes a Nagios event broker module (NDOMOD.O) that exports data from the Nagios daemon.

Assuming that Nagios has been compiled with the event broker enabled (this is the default), you can configure Nagios to load the NDOMOD module during runtime. Once the module has been loaded by the Nagios daemon, it can access all of the data and logic present in the running Nagios process.

Loaded NDOMOD Event broker Module

The NDOMOD module has been designed to export configuration data, as well as information about various runtime events that occur in the monitoring process, from the Nagios daemon. The module can send this data to a standard file, a Unix domain socket, or a TCP socket.

NDOMOD Capabilities

The NDOMOD module writes data in a format that the NDO2DB daemon (described later) can understand.

If the NDOMOD module is writing its output to a file, you can configure it to periodically rotate and/or process the output file using a predefined Nagios command. This can be useful if you want to transfer the output file to another physical machine (using SSH, etc. ) and send its contents to the NDO2DB daemon using the FILE2SOCK utility (described later).

If the NDOMOD module is writing it output to a TCP or Unix domain socket, it has some resistance to connection dropouts. The module will attempt to cache its output until it can (re)connect to the socket for writing. This is helpful if the process that creates and listens on the socket needs to be restarted, etc.

## LOG2NDO

The LOG2NDO utility has been designed to allow you to import historical Nagios and NetSaint log files into a database via the NDO2DB daemon (described later). The utility works by sending historical log file data to a standard file, a Unix domain socket, or a TCP socket in a format the NDO2DB daemon understands. The NDO2DB daemon can then be used to process that output and store the historical logfile information in a database.

LOG2NDO Utility

## FILE2SOCK

The FILE2SOCK utility is quite simple. Its reads input from a standard file (or STDIN) and writes all of that data to either a Unix domain socket or TCP socket. The data that is read is not processed in any way before it is sent to the socket.

FILE2SOCK Utility

This utility is useful if you are directing the output of the NDOMOD event broker module and/or LOG2NDO utility to a standard file. Once these components finish writing their output to a file, you can use the FILE2SOCK utility to send the contents of the file to the NDO2DB daemon's TCP or Unix domain socket.

## NDO2DB

The NDO2DB utility is designed to take the data output from the NDOMOD and LOG2NDO components and store it in a MySQL database.

When it starts, the NDO2DB daemon creates either a TCP or Unix domain socket and waits for clients to connect. NDO2DB can run either as a standalone, multi-process daemon or under INETD (if using a TCP socket).

NDO2DB Daemon

Multiple clients can connect to the NDO2DB daemon's socket and transmit data simultaneously. A separate NDO2DB process is spawned to handle each new client that connects. Data is read from each client and stored in a user-specified database for later retrieval and processing.

NDO2DB with multiple Clients