1. Nagios has the following features:
1. network service monitoring (including SMTP, POP3, HTTP, NNTP, and PING)
2. server resource monitoring (CPU load, disk usage, etc)
3. You can easily customize the service monitoring plug-in you need.
4. Parallel service monitoring
5. Support for parent host rules and distributed
6. When a host or service fails, the administrator can be reminded by email or SMS.
7. Support event definitions during failures, which can solve some problems first
8. Automatic Log rollback
9. Support for redundant host monitoring
10 you can view the current network status, notifications, fault logs, and other information on the Web interface.
Ii. Nagios Installation Process
Installing Nagios includes Nagios Core and Nagios Plugins. Nagios Core is only a Daemon and is responsible for scheduling. The real detection operation is still implemented through Nagios Plugins.
1) install Nagios Core
Download and decompress
- wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
-
- tar zxf nagios-3.2.0.tar.gz
-
- cd nagios-3.2.0
Add nagios users and groups
Useradd-m-s/bin/bash nagios groupadd nagios usermod-G nagios
Because the CGI Web monitoring panel is used, we need to add a nagcmd group for CGI to execute related commands.
Groupadd nagcmd usermod-a-G nagcmd nagios usermod-a-G nagcmd www
Configure compilation and Installation
./Configure -- with-command-group = nagcmd -- with-htmurl =/-- with-cgiurl =/cgi-bin make all make install-init make install-commandmode make install-config
Add startup Service
Rc-update add nagios default
Start Nagios
/Etc/init. d/nagios start
2) install Nagios Plugins
- wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
-
- tar zxf nagios-plugins-1.4.14.tar.gz
-
- cd nagios-plugins-1.4.14
-
- ./configure --with-cgiurl=/cgi-bin make && make install
-
- [#page_#]
3. Configure the Web Monitoring Panel
To host the CGI of the monitoring panel, the pure Nginx family should choose Nginx. Create a site configuration file:
- server {
-
- listen 80;
-
- server_name nagios.local;
-
- access_log /work/www/logs/nagios.access.log main;
-
- error_log /work/www/logs/nagios.error.log;
-
- location / {
-
- root /usr/local/nagios/share;
-
- index index.html index.htm index.php;
-
- }
-
- location ~ .php$ {
-
- root /usr/local/nagios/share;
-
- fastcgi_index index.php;
-
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-
- include fastcgi_params;
-
- fastcgi_pass unix:/tmp/php-fpm.sock;
-
- }
-
- location /cgi-bin/images {
-
- alias /usr/local/nagios/share/images;
-
- }
-
- location /cgi-bin/stylesheets {
-
- alias /usr/local/nagios/share/stylesheets;
-
- }
-
- location /cgi-bin {
-
- alias /usr/local/nagios/sbin;
-
- }
-
- location ~ .cgi$ {
-
- root /usr/local/nagios/sbin;
-
- rewrite ^/cgi-bin/(.*).cgi /.cgi break;
-
- fastcgi_index index.cgi;
-
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-
- include nginx_fcgi_params;
-
- fastcgi_read_timeout 5m;
-
- fastcgi_pass unix:/var/run/nginx-fcgi.sock;
-
- }
-
- }
-
Modify configuration file
Open/usr/local/nagios/etc/cgi. cfg and modify use_authentication:
- use_authentication=0
-
Remove User Authentication and restart nagios.
Open/usr/local/nagios/share/config. inc. php and run the following command:
- $cfg['cgi_base_url']='/nagios/cgi-bin';
-
Change to (according to your actual situation ):
- $cfg['cgi_base_url']='/cgi-bin';
-
Access monitoring panel
- http://nagios.local/
-
Build complete!
Nagios is successfully installed here. If you do not understand nagios, you can read: nagios monitoring network server and network service concepts and teach you how to perform initial configuration installation for Nagios 3.0.