nagios官方网站:http://www.nagios.org
nagios下载:http://www.nagios.org/download/core/thanks/
nagios插件下载:http://www.nagios.org/download/plugins
nagios-cn:http://nagios-cn.sourceforge.net/
实验环境: Red Hat Enterprise Linux Server release 6.3 selinux和iptables关闭
useradd -M -s /sbin/nologin nagios #创建nagios的用户
usermod -G nagios apache #添加nagios到apache的组里,是apache可以对nagios目录有写的权限
yum install gd-devel perl-ExtUtils-Embed.x86_64 -y
tar jxf nagios-cn-3.2.3.tar.bz2
cd nagios-cn-3.2.3
./configure –enable-embedded-perl make all make install make install-init #安装启动脚本 make install-commandmode #安装nagios命令 make install-config #安装nagios配置文件 make install-webconf #安装nagios和apache的配置文件,如果用的是nginx就不安装
yum install mysql-devel openssl-devel -y
tar zxf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15 #nagios插件安装
./configure --with-nagios-user=nagios --with-nagios-group=nagios -enable-extra-opts --enable-libtap -enable-perl-modules
make&&make install
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios #检查配置文件语法
htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:nagios
Re-type new password:nagios
/etc/init.d/httpd start
/etc/init.d/nagios start
打开浏览器输入对应主机的ip或者域名后接/nagios
输入帐号:nagiosadmin 密码:nagios
以上是nagios和apache,下面是nagios和nginx