Install and configure Nginx + Nagios in Ubuntu

Source: Internet
Author: User
Nginx is a high-performance Web and reverse proxy server with many excellent features: Nginx is a good alternative to Apache server in the case of high-connection concurrency: nginx is one of the software platforms that bosses often choose to do virtual host business in the United States. It can support responses of up to 50,000 concurrent connections. Thanks to Nginx for choosing epollandkqueue as the development model. Nagios is an open-source free network monitoring tool that can effectively monitor Windo

NginxIt is a high-performance Web and reverse proxy server with many excellent features: Nginx is a good alternative to Apache server in the case of high connection concurrency: nginx is one of the software platforms that bosses often choose to do virtual host business in the United States. It supports responses with up to 50,000 concurrent connections. Thanks to Nginx for choosing epoll and kqueue as the development model.

NagiosIt is an open-source free network monitoring tool that can effectively monitor the status of Windows, Linux and Unix hosts, network settings such as vswitches and routers, and printers. If the system or service status is abnormal, an email or text message alert will be sent immediately to the website O & M personnel. After the status is restored, a normal email or text message notification will be sent.

1. Install nagios
# Wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.2.tar.gz
# Tar zxvf nagios-3.2.2.tar.gz
# Cd nagios-3.2.2
# Useradd-m-s/bin/bash nagios
# Groupadd nagios
# Usermod-G nagios
# Groupadd nagcmd
# Usermod-a-G nagcmd nagios
# Usermod-a-G nagcmd www
#./Configure -- prefix =/usr/local/nagios -- with-command-group = nagcmd
# Make
# Make all
# Make install
# Make install-init # generate the init Startup Script
# Make install-config # install the sample configuration file
# Make install-commandmode # Set the corresponding directory permissions
 
2. Install the nagiox plug-in
# Wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
# Tar zxvf nagios-plugins-1.4.15.tar.gz
# Cd nagios-plugins-1.4.15
#./Configure -- with-nagios-user = nagios -- with-nagios-group = nagios -- prefix =/usr/local/nagios
# Make
# Make install
 
3. nrpe Installation
# Apt-get install libssl-dev
# Wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz
# Tar zxvf nrpe-2.12.tar.gz
# Cd nrpe-2.12
#./Configure
# Make all
# Cp src/check_nrpe/usr/local/nagios/libexec/
 
4. install and configure Nginx
# Sudo apt-get install nginx php5-fpm libssl-dev fcgiwrap apache2
# Htpasswd-c-m/usr/local/nagios/etc/nagiosAdmin.net nagiosadmin
# Start the service
#/Etc/init. d/php5-fpm start
#/Etc/init. d/fcgiwrap start # The default is socket mode. The socket file is in/var/run/fcgiwrap. socket
#/Etc/init. d/nagios start
#/Etc/init. d/nginx start

Complete nagios WEB configuration

  1. Server {
  2. Listen 80;
  3. Server_name 1.1.1.2;
  4. Root/usr/local/nagios/share;
  5. Index index.html index.htm index. php default.html default.htm default. php;
  6. Location ~ . * \. Php? $ {
  7. Fastcgi_pass 127.0.0.1: 9000;
  8. Fastcgi_index index. php;
  9. Include fastcgi_params;
  10. Fastcgi_param SCRIPT_FILENAME/usr/local/nagios/share $ fastcgi_script_name;
  11. Auth_basic "nagios admin ";
  12. Auth_basic_user_file/usr/local/nagios/etc/nagiosAdmin.net;
  13. }
  14. Location ~ . * \. Cgi $ {
  15. Root/usr/local/nagios/sbin;
  16. Rewrite ^/nagios/cgi-bin/(. *) \. cgi/$ 1.cgi break;
  17. Fastcgi_pass unix:/var/run/fcgiwrap. socket;
  18. Fastcgi_index index. cgi;
  19. Fastcgi_param SCRIPT_FILENAME/usr/local/nagios/sbin $ fastcgi_script_name;
  20. Include fastcgi_params;
  21. Auth_basic "nagios admin ";
  22. Auth_basic_user_file/usr/local/nagios/etc/nagiosAdmin.net;
  23. }
  24. Location/nagios {
  25. Alias/usr/local/nagios/share;
  26. Auth_basic "nagios admin ";
  27. Auth_basic_user_file/usr/local/nagios/etc/nagiosAdmin.net;
  28. }
  29. Location ~ . * \. Pl $ {
  30. Fastcgi_pass unix:/var/run/fcgiwrap. socket;
  31. Fastcgi_index index. pl;
  32. Fastcgi_param SCRIPT_FILENAME/usr/local/nagios/sbin $ fastcgi_script_name;
  33. Include fastcgi_params;
  34. }
  35. }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.