Nagios is very good and powerful,Nagios ConfigurationThe process is also very simple.
Figure-Nagios
Configuration is the most complex part of nagios. It involves the configuration of multiple files. To facilitate the description, configure them one by one here.
1. apache configuration.
The configuration is completed in two steps. The first step is to modify the configuration file httpd. conf of apache. The file path here is/usr/local/apache/conf/httpd. conf. Change apache runtime user [1] and runtime group to nagios, and append the following line to the end of the file httpd. conf:
- # Setting for nagios
-
- ScriptAlias/nagios/cgi-bin/usr/local/nagios/sbin
-
- // Cgi File directory
-
- AuthType Basic
-
- Options ExecCGI
-
- AllowOverride None
-
- Order allow, deny
-
- Allow from all
-
- AuthName "Nagios Access"
-
- AuthUserFile/usr/local/nagios/etc/htpasswd // verify the file path
-
- Require valid-user
-
- Alias/nagios/usr/local/nagios/share
-
- // Nagios page file directory
-
- AuthType Basic
-
- Options None
-
- AllowOverride None
-
- Order allow, deny
-
- Allow from all
-
- AuthName "nagios Access"
-
- AuthUserFile/usr/local/nagios/etc/htpasswd // verify the file path
-
- Require valid-user
-
The preceding text block is used to verify the user of the nagios directory. Only authorized users can access the page files of nagios. Step 2: generate the user authentication file: run the command/usr/local/apache/bin/htpasswd-c/usr/local/nagios/etc/htpasswd sery, the legitimate web access user sery is generated. for interactive command execution, you need to enter the password twice, then write a line in the file/usr/local/nagios/etc/htpasswd-the first field is the generated user name, and the second is the encrypted password, if you want to add more users, you do not need to select "-c" when executing the command htpasswd. Otherwise, all generated rows will be overwritten.
After the configuration is complete, run/usr/local/apache/bin/apachctl-t to check whether the apache configuration file has a syntax error, use/usr/local/apache/bin/apachctl start & to start apache, and enter the nagios access address (for example, [url] http: // ip/nagios [/url]). If it is normal, the login verification window appears waiting for user input:
Enter the user name and password created with htpasswd to test the configuration.