Ndoutils Installation of Nagios monitoring

Source: Internet
Author: User
Tags unix domain socket

Ndoutuils is based on the correct installation of Nagios, please go to the previous article for Nagios installation.


1. Dependency packet Detection

#rpm-Q MySQL mysql-server mysql-devel

#yum install MySQL mysql-server mysql-devel


2. Compiling the installation

#tar Xzf Ndoutils-2.0.0.tar

#./configure \

--prefix=/usr/local/nagios \

--enable-mysql \

--with-mysql-lib=/usr/lib \

--with-mysql-inc=/usr/include \

--disable-pgsql

#make

(Do not use make install here)


3. Service Configuration

3.1 Configuring the Ndomod proxy module

Attention:

The Ndomod module has Nagios 2.x and Nagios 3.x .... Multiple versions, depending on the use of Nagios (I nagios-3.3.1 here):

NDOMOD-2X.O = Ndomod module for Nagios 2.x

NDOMOD-3X.O = Ndomod module for Nagios 3.x


#cp-V src/ndomod-3x.0/usr/local/nagios/bin/

#chown nagios.nagios/usr/local/nagios/bin/ndomod-3x.0


#cp-V Config/ndomod.cfg-sample/usr/local/nagios/etc/ndomod.cfg

#chown nagios.nagios/usr/local/nagios/etc/ndomod.cfg


3.2 Modifying the Nagios configuration file

(usually in/usr/local/nagios/etc/nagios.cfg).

Broker_module=/usr/local/nagios/bin/ndomod-3x.o

Config_file=/usr/local/nagios/etc/ndomod.cfg

(These two are on one line, and Nagios is not going to get out of it.)

Turn on event broker for Nagios

Event_broker_options=-1


# cp-v Src/{file2sock,log2ndo}/usr/local/nagios/bin

#chown Nagios.nagios/usr/local/nagios/bin/{file2sock,log2ndo}


3.3 Configuring NDO2DB

NDO2DB Daemon also modules have Nagios 2.x and Nagios 3.x .... Multiple versions, depending on the use of Nagios (I nagios-3.3.1 here):

NDOMOD-2X.O = ndo2db module for Nagios 2.x

NDOMOD-3X.O = ndo2db module for Nagios 3.x


# cp-v src/ndo2db-3x/usr/local/nagios/bin/

# chown Nagios.nagios/usr/local/nagios/bin/ndo2db-3x


# cp-v Config/ndo2db.cfg-sample/usr/local/nagios/etc/ndo2db.cfg

# chown Nagios.nagios/usr/local/nagios/etc/ndo2db.cfg


3.4 Modify the Ndoutils profile ndo2db.cfg, which mainly modifies the database name, user name and password (db_name, Db_user, Db_pass), set it to the database and user we created earlier when we installed MySQL. The rest remains the default configuration.

#vi/usr/local/nagios/etc/ndo2db.cfg

Socket_type=tcp

Db_servertype=mysql

Db_host=localhost

db_port=3306

Db_prefix=nagios_

Db_name=nagiosdb

Db_user=ndouser

db_pass=123456


Attention:

i) the option above "Db_" is used to specify the properties of the connected database;

II) The default method for receiving data is the UNIX domain socket, which is modified to be a TCP socket, and the output mode specified in the NDOMOD.CFG configuration file should be modified accordingly;


3.5 Creating a database for Ndoutils

# mysql-uroot-p

mysql> CREATE DATABASE Nagiosdb;

Mysql> GRANT Select,insert,update,delete on nagiosdb.* to [e-mail protected] identified by ' 123456 ';

mysql> flush Privileges;


The database tables required to generate Ndoutils are prefixed by default with "Nagios_", and the Install script command must be executed within the DB subdirectory:

# CD DB

#./installdb-u ndouser-p 123456-h localhost-d Ndodb

(If error 1142 (42000) errors occur because of insufficient permissions, you can use root to execute.)

Description

The meanings of each of these options are as follows:

-U is used to specify the MySQL user account to use when importing

-P indicates the password for the previous MySQL user

-h indicates the MySQL server address, and if it is localhost, you can omit the

-D indicates the target database

If integrated with cacti, the NPC plugin will automatically generate the required tables for ndoutils in the cacti database, which are prefixed with "npc_".


3.6 Edit the Ndomod configuration file to specify the output mode and output destination host for the data

# vi/usr/local/nagios/etc/ndomod.cfg

Output_type=tcpsocket

output=127.0.0.1


4. Start the ndo2db daemon

#/usr/local/nagios/bin/ndo2db-3x-c/usr/local/nagios/etc/ndo2db.cfg

It is recommended that you check the system log (/var/log/messages) for errors in this case.

If the Nagios process is started at this point, you will need to stop and restart Nagios (kill if necessary) and you must also remove the Ndo.sock under/usr/local/nagios/var, or the next ndoutils will not start properly.

# killall-sighup Nagios

# rm-f/usr/local/nagios/var/nagios.lock

#/usr/local/nagios/bin/nagios-d/usr/local/nagios/etc/nagios.cfg


Description

i) stopping nagios here must be done by sending a sighup signal to Nagios;

II) It is recommended that you check the Nagios log file to see if the Ndomod module is loaded properly, and that it can connect to data sink properly, and that you can use the following command to view the log:

# Tail-30/usr/local/nagios/var/nagios.log



Acknowledgement: I refer to a number of articles after summing up, in this thank you network share!

This article is from the "4699096" blog, please be sure to keep this source http://4709096.blog.51cto.com/4699096/1702246

Ndoutils Installation of Nagios monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.