Nginx 是一個很牛的高性能Web和反向代理服務器,它具有很多非常優越的特性:在高連接並發的情況下,Nginx是Apache服務器不錯的替代品:Nginx在美國是做虛擬主機生意的老板們經常選擇的軟件平台之一。能夠支持高達 50,000 個並發連接數的響應,感謝Nginx為我們選擇了 epoll and kqueue作為開發模型。
Nagios是一款開源的免費網絡監視工具,能有效監控Windows、Linux和Unix的主機狀態,交換機路由器等網絡設置,打印機等。在系統或服務狀態異常時發出郵件或短信報警第一時間通知網站運維人員,在狀態恢復後發出正常的郵件或短信通知。
1. 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 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 # 生成init啟動腳本
# make install-config # 安裝示例配置文件
# make install-commandmode # 設置相應的目錄權限
2. nagiox插件安裝
# 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安裝
# 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.安裝配置Nginx
#sudo apt-get install nginx php5-fpm libssl-dev fcgiwrap apache2
# htpasswd -c -m /usr/local/nagios/etc/nagiosAdmin.net nagiosadmin
# 啟動服務
# /etc/init.d/php5-fpm start
# /etc/init.d/fcgiwrap start #默認是socket模式,socket文件在/var/run/fcgiwrap.socket
# /etc/init.d/nagios start
# /etc/init.d/nginx start
nagios的完整WEB配置