##nagios安装## ##可参考官网文档
1.tar jxf nagios-cn-3.2.3.tar.bz2
cd nagios-cn-3.2.3
yum install gd-devel-2.0.35-11.el6.x86_64.rpm -y
groudadd nagcmd
useradd -M -d /usr/local/nagious -G nagcmd nagios
usermod -G nagcmd apache
./configure --with-command-group=nagcmd
make all##可以看到后面步骤
make install
make install-init
make install-config
make install-commandmode
make install-webconf
/etc/httpd/conf.d/nagios.conf
/usr/local/nagios/etc/htpasswd.users##可看到用户名和密码
htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin##修改nagiosadmin的密码
##nagios-plugins安装##
tar zxf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
./configure##可看到插件安装的信息,可根据缺少的插件进行安装。例如:mysql-devel,openssl-devel
make
make install
cd /usr/local/nagios/libexec
chown nagios.nagios * -R
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios reload
cd /usr/local/nagios/etc/
vim nagios.cfg
注释掉cfg_file,添加两个cfg_file
图
cd objects/
cp -p localhost.cfg hosts.cfg
cp -p localhost.cfg services.cfg
vim hosts.cfg
图
vim services.cfg
图
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios reload
./check_disk
./check_disk -w 20 -c 10
./check_disk -w 20 -c 10 -p /
vim commands.cfg
图
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios reload