Building a monitoring system based on Nagios -- installing Nagios Core
Using Nagios to build the monitoring system of this department, I have only seen this guy's name several times before. This is a real start, and now I have successfully built a test environment, monitored three machines, including the local machine, a Linux server, and a Windows Server, and received several abnormal emails. Share your experience here ......
First, we will share how to install Nagios Core to monitor and view monitoring reports on the local machine.
Here, we assume that, like me, you have successfully installed Linux, Apache2, PHP, and gd libraries.
Step 1: Obtain the Nagios Core installer.
Create a folder in the HOME directory to store the files to be downloaded.
Mkidr Downloads
Cd Downloads
Visit the Nagios Core download page upload to download to see the real download page.
Copy the download path and use wget to download Nagios Core to the Created directory. Wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.3.tar.gz
Step 2: create a separate user and group for Nagios.
To facilitate the following operations, we use sudo-s to switch to the root user environment.
After creating a nagios user, you also need to create a nagcmd group and add the nagios user and the Apache server user to the group.
/Usr/sbin/useradd nagios
/Usr/sbin/groupadd nagcmd
/Usr/sbin/usermod-a-G nagcmd nagios
/Usr/sbin/usermod-a-G nagcmd apache
Step 3: Compile and install Nagios.
Decompress the installation package and enter the nagios directory;
Then execute the configure script and compile it;
Finally, install the binary file and the permissions of the initialization script, sample configuration file, and external command folder.
Cd nagios-4.0.3
./Configure -- with-command-group = nagcmd
Make all & make install-init & make install-config & make install-commandmode
Step 4: modify the configuration file as needed.
This configuration file instructs the contact to change the contact information to your own
Vim/usr/local/nagios/etc/objects/contacts. cfg
Step 5: Configure Apache.
In the preceding four steps, Nagios Core has been installed. In this step, the cgi file that is responsible for displaying monitoring results under Nagios can be accessed through the Web.
In the nagios installation directory, open the Apache configuration command file prepared by nagios for us:
Copy the content to the main configuration file of Apache. I copied it to the bottom.
According to the authentication method in the command, we need to create the authentication file:
Cat sample-config/httpd. conf>/usr/local/apache2/conf/http. conf
Htpasswd-c/usr/local/nagios/etc/htpasswd. users nagiosadmin
Step 6: Set Nagios to automatically start upon startup.
Ln-s/etc/init. d/nagios/etc/rc3.d/S99nagios
Check whether the nagios configuration file is correct:
/Usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios. cfg
If no error message is displayed, you can start Nagios:
/Etc/init. d/nagios start
You can see the green [OK]. It means it's done!
Finally, restart the Apache server to access
Http: // localhost/nagios
Enter nagiosadmin and the password you just set to start monitoring.
Network Monitor Nagios Overview
Nagios construction and Configuration
Build a Nagios monitoring platform in the Nginx Environment
Configure the basic Nagios System on RHEL5.3 (using Nagios-3.1.2)
CentOS 5.5 + Nginx + Nagios monitoring and control terminal installation and Configuration Guide
Install Nagios Core for Ubuntu 13.10 Server
Nagios details: click here
Nagios: click here
This article permanently updates the link address: