Integrate and use Nagios and NConf

Source: Internet
Author: User

Integrate and use Nagios and NConf

1. Introduction to nagios and nconf 3
1. About nagios 3
2. Introduction to nconf 3
Ii. experiment environment 3
1. Install mysql 3
2. install apache 4
3. install php 4
4. configure the firewall and selinux 4
Iii. Nagios installation and configuration 4
1. Install Basic Support Kit 4
2. Create nagios users and user groups 4
3. Compile and install nagios 4
4. Install the nagios plug-in 5
5. Configure apache 5
6. Create an apche directory verification file 6
7. Configure nagios 6
8. Start apache service 7
9. nagios installation completed 7
Iv. nconf installation and configuration 7
1. Check/etc/php. ini settings 7
2. Download and install nconf 7
3. Create an nconf database as user 8
4. Modify related directory permissions 8
5. Set security context 8
6. Access 8 in a browser
7. After installation is complete, sort out the nconf directory 12.
8. Access nconf: 12
5. nrpe installation and configuration 13
1. How NRPE works 13
2. Install the check_nrpe plug-in on the monitoring host 14
3. Install nrpe deamon 14 on the monitored host
3.1 new users 14
3.2 install the nagios plug-in 14
3.3 modify directory permissions 15
3.4 install nrpe 15
3.5 test whether nrpe works normally 15
Vi. simple use of nconf 16
1. Add monitoring device process 16
1.1 add Monitoring Device 16
1.2 add Monitoring Service 17
1.3 generate nagios configuration file 18
1.4 execute the script to make the nagios configuration take effect 19
1.5 successfully configured 19
2. New service process 19
2.1 upload monitoring script 19
2.2 add Check Command 19
2.3 add advanced monitoring service 20
2.4 use the added Monitoring Service 22
3. Configure Automatic nagios deployment 23
3.1 modify deployment configuration file 23
3.2 Modify/etc/sudoers 24
3.3 modify the main configuration of nagios 24
3.4 modify directory owner 24
3.5 automatic release 24
3.6 reload nagios configuration 25
3.7 automatic deployment successful 25

1. Introduction to nagios and nconf
1. About nagios
Nagios is an open-source free network monitoring tool that can effectively monitor the status of Windows, Linux and Unix hosts, network settings such as vswitches and routers, and printers. If the system or service status is abnormal, an email or text message alert will be sent immediately to the website O & M personnel. After the status is restored, a normal email or text message notification will be sent.
Nagios functions are monitoring services and hosts, but it does not include these functions. All monitoring and detection functions are implemented through various plug-ins.
After Nagios is started, it automatically calls the plug-in periodically to check the server status. At the same time, Nagios maintains a queue, and all the status information returned by the plug-in enters the queue, nagios reads and processes the information from the beginning of the team, and then displays the status results on the web.
Nagios provides many plug-ins that can be used to conveniently monitor many service statuses. After the installation is complete, all plug-ins that can be used by nagios are stored in/libexec in the main directory of nagios. For example, check_disk is the plug-in for checking disk space, and check_load is used to check CPU load, and so on. Each plug-in can view its usage and functions by running./check_xxx-h. Open the official Nagios documentation and you will find that there are basically no dependency packages for Nagios. Only Linux or other systems supported by Nagios are required. However, if you have not installed apache (http service), you will not have an intuitive interface to view the monitoring information. Therefore, apache is a prerequisite.
2. Introduction to nconf
NConf is a Web tool used to configure Nagios monitoring software. Unlike similar tools, it provides enterprise-level functions, such as templates, dependencies, and the ability to configure a large distributed Nagios server topology. It allows you to easily maintain a distributed Nagios topology. It has a user-friendly GUI and is characterized by host and service templates, graphics rely on browsers, multiple authentication modes, one Nagios configuration provider, a csv File Import and Perl database API, its data architecture is customizable and scalable.
Ii. experiment environment
LAMP environment deployment
1. Install mysql
# Yum install mysql perl mysql-server perl-DBI perl-DBD-MySQL
2. install apache
# Wget http://archive.apache.org/dist/httpd/httpd-2.4.6.tar.bz2
# Tar-xvf httpd-2.4.6.tar.bz2
# Cd httpd
#./Configure -- prefix =/usr/local/apache2
# Make & make install
3. install php
# Wget http://cn2.php.net/distributions/php-5.5.3.tar.bz2
# Tar-xvf php-5.5.3.tar.bz2
# Cd php-5.5.3
#./Configure -- prefix =/usr/local/php -- with-apxs =/usr/local/apache2/bin/apxs -- with-mysql
# Make & make install
4. configure the firewall and selinux
# Iptables-F
# Iptables-X
# Iptables-Z
# Iptables-P INPUT ACCEPT
# Iptables-P OUTPUT ACCEPT
# Iptables-P FORWARD ACCEPT
# Setenforce 0
Iii. Nagios installation and configuration
1. Install basic support suite
Yum install-y gcc glibc-common gd-devel xinetd openssl-devel
2. Create nagios users and user groups
# Useradd-s/sbin/nologin nagios
# Mkdir/usr/local/nagios
# Chown-R nagios: nagios/usr/local/nagios
3. Compile and install nagios
# Wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.1.tar.gz
# Tar-zxvf nagios-3.5.1.tar.gz
# Cd nagios
#./Configure -- prefix =/usr/local/nagios
# Make all
# Make install
# Make instal-init
# Make install-commandmode
# Make install-config
# Chkconfig -- add nagios
# Chkconfig -- level 35 nagios on
# Chkconfig -- list nagios
4. Install the nagios plugin
# Wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
# Tar -- zxvf nagios-plugins-1.4.16.tar.gz
# Cd nagios-plugins-1.4.16
#./Configure -- prefix =/usr/local/nagios
# Make & make install
5. Configure apache
Modify the/usr/local/apache2/conf/httpd. conf file:
Modify User and Group as follows:
User nagios
Group nagios
Modify the DirectoryIndex as follows:
DirectoryIndex index.html index. php
Add the following content:
AddType application/x-httpd-php. php
For the sake of security, it is generally necessary that the nagios web Monitoring page must be authorized for access. In this case, you need to add the verification configuration, that is, add the following content to the httpd. conf file:
# Setting for nagios
ScriptAlias/nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow, deny
Allow from all
AuthName "Nagios Access"
AuthUserFile/usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
Alias/nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
AuthType Basic
Options None
AllowOverride None
Order allow, deny
Allow from all
AuthName "nagios Access"
AuthUserFile/usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
To prevent nagios page garbled characters, add the following in httpd. conf:
Adddefacharcharset UTF-8
Remove the comments of the following two rows at the same time:
LoadModule cgid_module modules/mod_cgid.so
LoadModule actions_module modules/mod_actions.so

Nagios details: click here
Nagios: click here

Configure Apsara stack alarms using Nagios

Using Nagios with Apsara for SMS alert Installation

Free SMS alert configuration for Nagios Feixin Linux

How to monitor Linux Hosts and send emails to alarms through Nagios

  • 1
  • 2
  • 3
  • 4
  • 5
  • Next Page

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.