Nagios Monitoring Infrastructure configuration (i)

Source: Internet
Author: User

First, build Nagios monitoring Server
1. Deploy the operating environment lamp
[Email protected] ~]# yum-y install httpd
[Email protected] ~]# systemctl restart httpd
[Email protected] ~]# Systemctl enable httpd

[Email protected] ~]# yum-y install Mariadb-server mariadb
[Email protected] ~]# systemctl restart MARIADB
[Email protected] ~]# Systemctl enable MARIADB
[[email protected] ~]# mysqladmin-hlocalhost-u root password "123456"
[[email protected] ~]# yum-y install php-mysql PHP

2. Installation Preparation: Compiling tools to create users and groups
[Email protected]/]# rpm-q gcc gcc-c++
[Email protected]/]# Useradd Nagios
[Email protected]/]# Groupadd nagcmd
[Email protected]/]# usermod-g nagcmd Nagios

3. Install the source package
1) Unpacking
[Email protected]/]# TAR-ZXF nagios-4.2.4.tar.gz
[Email protected]/]# CD nagios-4.2.4/
[Email protected] nagios-4.2.4]#/configure--help | More > Pagination View Help information
[Email protected] nagios-4.2.4]#./configure

--with-nagios-user=nagios \ Owner
--with-nagios-group=nagcmd \ Subordinate Group
--with-command-user=nagios \ Software Performers
--with-command-group=nagcmd Software-Executed groups

2) compiling
[[email protected] nagios-4.2.4]# make all > Compile main program #做完这步, preferably open two terminals for easy viewing of installation
[[email protected] nagios-4.2.4]# make install > Install program
[[email protected] nagios-4.2.4]# ls/usr/local/nagios/> Master config file
[[email protected] nagios-4.2.4]# make install-init > Install control script
/usr/bin/install-c-M 755-d-o root-g root/etc/rc.d/init.d
/usr/bin/install-c-M 755-o root-g root Daemon-init/etc/rc.d/init.d/nagios

Init Script installed

[[email protected] nagios-4.2.4]# Cat/etc/rc.d/init.d/nagios > System script file

3, "Installation"
[[email protected] nagios-4.2.4]# make Install-commandmode > Set file Permissions
[[email protected] nagios-4.2.4]# make Install-config > installation configuration
[[email protected] nagios-4.2.4]# make install-webconf > Deployment site Configuration
[[email protected] nagios-4.2.4]# make install-exfoliation > page style

4. View the installation directory and configuration file description
[Email protected] nagios-4.2.4]# ls/usr/local/nagios/
bin/etc/libexec/sbin/share/var/

[[email protected] nagios-4.2.4] #ls/usr/local/nagios/bin/
Nagios > Verifying configuration information
Nagiostats > Command line display monitoring information
[[email protected] nagios-4.2.4] #ls/usr/local/nagios/etc/> Master profile Directory
[[email protected] nagios-4.2.4] #ls/usr/local/nagios/libexec/> Monitor plugin directory (default is empty)
[[email protected] nagios-4.2.4] #ls/usr/local/nagios/sbin/> Compiled script file (binary)
[[email protected] nagios-4.2.4] #ls/usr/local/nagios/share/> Web Files directory
[[email protected] nagios-4.2.4] #ls/usr/local/nagios/var/> log directory

5, install the monitoring plug-in
[[email protected] nagios-plugins-2.1.4]# tar-zxf/nagios-plugins-2.1.4.tar.gz > Unpacking
[[email protected] nagios-plugins-2.1.4]# cd/nagios-4.2.4/nagios-plugins-2.1.4/> entry Directory
[[email protected] nagios-plugins-2.1.4]#./configure && make && make install > Source installation
[[email protected] nagios-4.2.4]# ls/usr/local/nagios/libexec/> View installed Plugins

6. Start Nagios Monitoring Service
Set the user name (nagiosadmin) and password (custom) for the Access Monitoring page > First name as the default value

[Email protected] nagios-4.2.4]# vim/etc/httpd/conf.d/nagios.conf
Authuserfile/usr/local/nagios/etc/htpasswd.users > Store Access user name and password

[[email protected] nagios-4.2.4]# which htpasswd > see if this command is available
/usr/bin/htpasswd
[[email protected] nagios-4.2.4]# rpm-qf/usr/bin/htpasswd > Query the package provided
Httpd-tools-2.4.6-40.el7.x86_64

[Email protected] nagios-4.2.4]# htpasswd-c/usr/local/nagios/etc/htpasswd.users nagiosadmin > Build Web Admin user
New password:111111 > enter password
Re-type new password:111111 > Verify password
-C option
[[email protected] nagios-4.2.4]# cat/usr/local/nagios/etc/htpasswd.users > View generated files
Nagiosadmin: $apr 1$ugalkgio$gnsyq.o2t6qvqab6aktwr/

[[email protected] nagios-4.2.4]# systemctl restart httpd > Restart website service
[[email protected] nagios-4.2.4]#/etc/rc.d/init.d/nagios Start > Open Nagios Service
[[email protected] nagios-4.2.4]#/etc/rc.d/init.d/nagios status > View state
Nagios (PID 3883) is running ...

7. Visit the Monitoring Web page
[[Email protected] Desktop]# Firefox http://192.168.4.21/nagios


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Here's the main page"

Iii. Configuring Nagios Services

(the default is to monitor the machine without any configuration)
Services monitoring Information
Current Load CPU Load
Current users logged into the system
HTTP Web Service Run status
Root Partition root partition
SSH Monitoring SSH Service
Swap Usage Swap partition
Total Processes Number of processes

Host Status Totals Monitoring hosts
Service Status Totals Monitoring Resources

OK normal
WARNING Warning
Unknown don't know.
Critical Critical Error
In Pending monitoring

Http://i2.51cto.com/images/blog/201801/08/e1be13912bef7ed98eebd548ea0c1100.jpg?x-oss-process=image/watermark, size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk= "alt=" Nagios Monitoring Foundation Configuration (i) "/>

Nagios Monitoring Infrastructure configuration (i)

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.