Build Your own Nagios

Source: Internet
Author: User

III. deployment of Nagios monitoring system
1. Installing the Nagios system
(1) Creating Nagios Users and Groups
# GROUPADD-G-Nagios
# useradd-g Nagios-u-Nagios




(2) Installing Nagios
#./configure--prefix=/usr/local/nagios--enable-event-broker--with-nagios-user=nagios--with-nagios-group=nagios --with-command-user=nagios--with-command-group=nagios--with-httpd-conf=/etc/httpd/conf.d--with-temp-dir=/tmp-- with-init-dir=/etc/init.d/
# make All
# make Install
# Make Install-init
# Make Install-commandmode
# Make Install-config
# Make Install-webconf


(3) Installing the Nagios-plugins plug-in
# yum Install Perl perl-devel OpenSSL openssl-devel
#./configure--prefix=/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios--with-perl=/usr-- with-mysql=/usr/local/mysql/--with-openssl=/usr--enable-perl-modules
# make
# make Install



(4) Installing Nrpe Communication protocol software
#./configure--prefix=/usr/local/nagios--with-nrpe-user=nagios--with-nrpe-group=nagios--with-nagios-user=nagios --with-nagios-group=nagios
# make All
# Make Install-plugin
# Make Install-daemon
# Make Install-daemon-config

#/usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe.cfg-d \ \ Start Nrpe
#/usr/local/nagios/libexec/check_nrpe-h localhost



(5) Installing Ndoutils database communication software
#./configure--prefix=/usr/local/nagios--enable-mysql--with-init-dir=/etc/init.d--with-ndo2db-user=nagios-- With-ndo2db-group=nagios--with-mysql=/usr/local/mysql
# make
# make Install
# Make Install-config
# Make Install-init

------------------------------------------------------------------installation Ndoutils error is generally a database error

Remove the installation files, re-unzip, re-configure, and then
# VI Include/config.h
Will
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
Revision changed to
#include </usr/local/mysql/include/mysql/mysql.h>
#include </usr/local/mysql/include/mysql/errmsg.h>
Then make














# cd/var/ftp/pub/nagios/ndoutils-2.0.0/db (This is the directory of your own designation where you put it yourself)
#./installdb-u nagios-paixocm-h 172.17.10.252-d Nagios This is a database that must first be created in the database and then go conditional and have permission

# CD/USR/LOCAL/NAGIOS/ETC
# MV Ndo2db.cfg-sample Ndo2db.cfg
# MV Ndomod.cfg-sample Ndomod.cfg


2. Configuring the Nagios System
# chown Nagios:nagios Nagios-r
(1) Configuring the Nagios Master profile/usr/local/nagios/etc/nagios.cfg
BROKER_MODULE=/USR/LOCAL/NAGIOS/BIN/NDOMOD.O config_file=/usr/local/nagios/etc/ndomod.cfg

(2) Configuring the/usr/local/nagios/etc/ndo2db.cfg file for Nagios and ndo2db and database communication related information
Lock_file=/usr/local/nagios/var/ndo2db.lock
Ndo2db_user=nagios
Ndo2db_group=nagios
Socket_type=unix
Socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
Use_ssl=0
Db_servertype=mysql
db_host=172.17.10.252
db_port=3306
Db_name=nagios
Db_prefix=nagios_
Db_user=nagios
db_pass=aixocm
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
max_externalcommands_age=44640
max_notifications_age=44640
max_contactnotifications=44640
max_contactnotificationmethods=44640
max_logentries_age=129600
max_acknowledgements_age=44640
Debug_level=0
Debug_verbosity=1
Debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000

(3) Configuration/usr/local/nagios/etc/ndomod.cfg

(4) Configuring the/USR/LOCAL/NAGIOS/ETC/NRPE.CFG client configuration file

3. Start Nagios Services
# service Nagios Start
# service Nrpe start CP Init-script/etc/init.d/nrpe (to start a file that must be copied in the installation directory in the past) chmod +x/etc/init.d/nrpe ( Plus executable permissions)

# service Ndo2db Start (to add your own mysql/lib files to the vi/etc/ld.so.conf file and re-read them with Ldconfig
)



Htpasswd-c/usr/local/nagios/etc/htpasswd.users Nagios
Change one of the CGI configuration files under

Use_authentication=0

To install the PHP and Perl installation package




Build Your own Nagios

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.