CentOS 6 nagios installation and monitoring

Deploy and install LAMP

1. Make a local yum source

Insert picture description here

2. Turn off the firewall and SELinux

Insert picture description here

3. Install LAMP service pack

Insert picture description here

4. Write Apache's PHP test page

Insert picture description here

Insert picture description here

5. Open the Apache service and view the test page successfully

Insert picture description here
Insert picture description here

Deploy and install nagios server

1. Upload the required software packages for nagios

Insert picture description here
Insert picture description here
Upload successfully
Insert picture description here

2. Install the corresponding dependencies of nagios

Insert picture description here

3. Unzip the nagios installation package, move and rename it, add user nagios, and change the owner and group of /usr/local/nagios to nagios

Insert picture description here
4. Detect the compilation environment The
Insert picture description here
detection is successful, and the Makefile file is generated
Insert picture description here

4. Compile and install

Compile make all
install Nagios basic environment #make install
install Nagios service init script# make install-init
install Nagios configuration file directory# make install-config
install Nagios web configuration file# make install-webconf
install Nagios permissions related# make install-commandmode
generate Nagios web authentication file and create user
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
confirm input password
Insert picture description here
Insert picture description here
Insert picture description here

5. Restart the Apache service and start the nagios service

Insert picture description here

6. The browser access prompts to enter the account and password, and the access is successful after entering

Insert picture description here
Insert picture description here

7. Install the plugin Nagios-plugins

Unzip, check the environment, compile and install
Insert picture description here
Insert picture description here

8. Install the nrpe plugin

Unzip, check the environment
Insert picture description here
Insert picture description here

Configure nagios to monitor Apache services

Server IP: 192.168.153.130
Client IP: 192.168.153.131

1. Open the Apache service on the client

Insert picture description here

2. Edit the nagios server configuration file, define the host and service, save and exit

Insert picture description here
Insert picture description here
Insert picture description here
Restart the service The
Insert picture description here
host and service are added successfully
Insert picture description here

3. Error 403forbidden is reported because the client lacks PHP

Insert picture description here
Install PHP on the client and write a PHP test page.
Insert picture description here
Restart the Apache service
Insert picture description here

4. Successful detection and monitoring

Insert picture description here
Insert picture description here

Configure nagios to monitor Nginx service

1. Upload and install Nginx on the client, and open the nginx service

Insert picture description here
Insert picture description here
Insert picture description here

2. Modify the server nagios configuration file

Define host and service

Insert picture description here

Insert picture description here

Insert picture description here
Add command to
Insert picture description here
Insert picture description here
restart nagios service
Insert picture description here

3. Successful detection and monitoring

Insert picture description here
Insert picture description here

Configure nagios to monitor Mysql service

1. Define the host, service and command on the server

Insert picture description here
Insert picture description here
Insert picture description here

Restart service
Insert picture description here

2. Install and start the MySQL service on the client, set the MySQL password, authorize and set it to take effect immediately

Insert picture description here
Insert picture description here
Insert picture description here

3. Successful detection and monitoring

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_46674735/article/details/108810362