以下是2014-4-17安装记录:
== 服务端 ==
安装依赖包:(其实不装也能安装成功,就是部分功能会disabled)
sudo apt-get install build-essential libssl-dev \
libgd2-xpm-dev libpng12-dev php5-gd libgd2-xpm
用户组:
sudo adduser --system --no-create-home --disabled-login --group nagios
sudo groupadd nagcmd
sudo usermod -G nagcmd nagios
sudo usermod -a -G nagcmd www-data
从 http://www.nagios.org/download/ 下载解压:
cd /tmp
mkdir nagios
cd nagios
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.5.tar.gz
wget http://www.nagios-plugins.org/download/nagios-plugins-2.0.1.tar.gz
tar zxf nagios-4.0.5.tar.gz
tar zxf nagios-plugins-2.0.1.tar.gz
编译安装:
cd /tmp/nagios/nagios-4.0.5
./configure --prefix=/opt/nagios --sysconfdir=/etc/nagios \
--with-nagios-user=nagios --with-nagios-group=nagios \
--with-command-user=nagios --with-command-group=nagcmd
make all
sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode
建立htpasswd.users,这个如果装了apache2有htpasswd这个命令,不然可以用某个python脚本:
(如果服务器不想装python,可以找台有python的服务器;或者找台装了apache的机器运行htpasswd;或者装个httpd不启动也没关系)
(生成的htpasswd.users是个文本文件,复制到服务器的 /etc/nagios/htpasswd.users)
wget http://trac.edgewall.org/export/10791/trunk/contrib/htpasswd.py
chmod +x htpasswd.py
./htpasswd.py -c -b /etc/nagios/htpasswd.users nagiosadmin "password"
修改联系人email,在contacts.cfg的email那里(34行)
sudo vi /etc/nagios/objects/contacts.cfg
安装mail报警通知所需包(安装时选择”Internet Site”;输入域名)
(注意:不装这个mail包编译nagios-plugins-2.0.1会error,但是编译nagios-plugins-2.0没问题。。。)
sudo apt-get install mailutils postfix
sudo ln -s /usr/bin/mail /bin/mail
安装插件:
cd /tmp/nagios/nagios-plugins-2.0.1
./configure --prefix=/opt/nagios --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install
sudo chown -R nagios:nagios /opt/nagios
启动nagios
sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
sudo service nagios start
安装fcgi
sudo apt-get install spawn-fcgi fcgiwrap
编辑nginx.conf
sudo vi /etc/nginx/sites-enabled/nagios
其中对/nagios/开头的地址进行了rewrite,(nagios内部很多页面是写死/nagios/开头的,导致images、css等出不来)
server {
server_name nagios.bianbian.org;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log;
auth_basic "Restricted Nagios Area!";
auth_basic_user_file /etc/nagios/htpasswd.users;
root /opt/nagios/share/;
location ~ ^/nagios/ {
rewrite ^/nagios/(.*) /$1 permanent;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.socket;
}
location ~ \.cgi$ {
root /opt/nagios/sbin/;
rewrite ^/cgi-bin/(.*)\.cgi /$1.cgi break;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
}
启动服务
sudo service nagios start
登录后就看到nagios的监控界面了
创造与魔法 安卓版v1.0.0750
创造与魔法是一款开放世界手游,在游戏中玩家可探索这个奇妙的世
创造与魔法修改版 最新版v1.0.0750
创造与魔法无限点券版是款探索冒险游戏,该款游戏的操作还是蛮自
战争与文明官方版本 安卓版v1.7.16
战争与文明是一款由上海邮通科技有限公司开发的战争策略游戏,这
迷你世界0元领皮肤无限迷你币版 最新安卓版v1.43.0
迷你世界0元购买皮肤版是这款开放沙盒冒险建造游戏的特殊破解版
创造与魔法无限经验版 安卓版v1.0.0750
创造与魔法无限经验版是款可以改造环境,整个游戏的自由度还是蛮