Deploy and install LAMP
1. Make a local yum source
2. Turn off the firewall and SELinux
3. Install LAMP service pack
4. Write Apache's PHP test page
5. Open the Apache service and view the test page successfully
Deploy and install nagios server
1. Upload the required software packages for nagios
Upload successfully
2. Install the corresponding dependencies of nagios
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
4. Detect the compilation environment The
detection is successful, and the Makefile file is generated
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
5. Restart the Apache service and start the nagios service
6. The browser access prompts to enter the account and password, and the access is successful after entering
7. Install the plugin Nagios-plugins
Unzip, check the environment, compile and install
8. Install the nrpe plugin
Unzip, check the environment
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
2. Edit the nagios server configuration file, define the host and service, save and exit
Restart the service The
host and service are added successfully
3. Error 403forbidden is reported because the client lacks PHP
Install PHP on the client and write a PHP test page.
Restart the Apache service
4. Successful detection and monitoring
Configure nagios to monitor Nginx service
1. Upload and install Nginx on the client, and open the nginx service
2. Modify the server nagios configuration file
Define host and service
Add command to
restart nagios service
3. Successful detection and monitoring
Configure nagios to monitor Mysql service
1. Define the host, service and command on the server
Restart service
2. Install and start the MySQL service on the client, set the MySQL password, authorize and set it to take effect immediately
3. Successful detection and monitoring