Simple nagios Installation
During this period of time, I have been conducting nagios installation experiments, and have carried out many experiments. Now, some basic records are recorded.
This article describes how to install nagios easily. After installing nagios, you can view the local monitoring image on the web page,
The nagios installation is simple as a whole, and nothing is too difficult. The important thing is to solve the problem. If there is no idea, it will be a little difficult, all the steps in this article have gone through my own experiments. If all the steps are installed according to my instructions, there will be basically no errors.
When installing nagios, you first need to prepare a few items, one is the operating system disc. With the operating system disc, it is very easy to install the dependency package, you only need to perform YUM. The second is to download the main program of nagios, which is the core program of nagios. The third is the nagios plug-in. In the monitoring of nagios, nagios itself is not monitored, and all monitoring is completed through the nagios plug-in. The third is the PHP program. During nagios display, php must be used; the fourth is the installation of apache, which is displayed on the web interface. For details, see the last section of the article.
1. Install nagios1.1 to check the dependency package
First, install the dependency package. It is best to use YUM to quickly install the dependency package. If these dependency packages do not exist, the package cannot be found during installation. Therefore, the first step of installation is to check the dependency package and install the package without installation.
1.2 create nagios users and user groups
Create nagios users and user groups. when running the nagios program, you must use nagios users to ensure security.
In nologin mode, a prompt is displayed every time nagios is started to prevent users from logging on:
This account is currently not available
1.3 compile and install nagios
Decompress the downloaded nagios file.
Compile. during compilation, you only need to set the installation directory.
This is after compilation. If an error occurs during compilation, the dependent package is definitely not installed, and the installation status of the dependent package will be checked.
.
After the installation is complete
Make install
After make install is complete
Install the initialization script to make it easy to start each time
Install an external command file
Install the configuration file to insert all configuration files of nagios into the corresponding location.
1.4 check whether nagios is correctly installed and check whether nagios is correctly installed. Check the files installed in the installation directory as follows:
2. Install the nagios plugin
Compile the program. The directory specified here is the same as the main program directory of nagios.
After compilation, You can see which modules are enabled here.
Install
When the installation is complete.
3. install apache
.
After compilation
Install
4. install PHP
Extract
Compile
Compilation completed
Install
5. Configure apache to find the apache configuration file. The path is as follows:
Change
Change
Add the following content at the end:
AddType application/x-httpd-php. php # setting for nagios ScriptAlias/nagios/cgi-bin "/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 // The Require valid-user file used to Access authentication in this directory
Alias/nagios "/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
6. Create an apache directory verification file
Select the login user name and password you want to use for web page logon monitoring.
7. Start the apache service
Start the apache service. The information displayed above is normal, so ignore it.
8. Start nagios
Start nagios
9. Go to the nagios page for the first time
For the first time, the user name and password are required, that is, the user name and password to be set. The entered address is the IP address of your nagios installation. Note that if you cannot access the system, any errors may occur, check the firewall, selinux, and virtual machine connection mode.
Now that nagios is installed, You need to configure relevant monitoring metrics for nagios. This is left to the next article.
Related:
Nagios plug-in Project: plugin/
The following article will solve the problems with simple nagios installation.