标签:
1.安装准备
①下载安装包:nagios-4.1.1.tar.gz、
nagios-plugins-2.1.1.tar.gz
nrpe-2.15.tar.gz
②下载依赖包:yum install httpd php gcc glibc glibc-common gd gd-devel xinetd openssl-devel mysql-devel php-mysql
③创建用户、用户组
useradd nagios
passwd nagios
**********
Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.创建一个新的nagcmd组允许外部命令通过web界面提交。把nagios和apache用户加到这个用户组
**********
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
2.安装
①nagios-4.1.1
cd nagios-4.1.1
./configure –with-command-group=nagcmd 【–build=‘uname -m‘ rh7.1】
make all
make install
make install-init
make install-config
make install-commandmode
做完上面的步骤,配置文件样例已经安装在了/usr/local/nagios/etc/中,为了继续下面的操作,需要编辑其中一个配置文件
vi /usr/local/nagios/etc/objects/contacts.cfg **可以个性化其中的内容**
make install-webconf
配置nagios web登录用户名密码
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
重启httpd服务以生效以上配置
service httpd restart
②安装nagios-plugin
cd nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios 【–build=‘uname -m‘】
make
make install
③启动nagios
将Nagios添加到系统服务列表并在系统启动时自动启动
chkconfig --add nagios
chkconfig nagios on Verify the sample Nagios configuration files
验证
. /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
如果不报错则启动nagios
service nagios start
此时可以启动nagios web查看是否正常显示
④安装nrpe
cd nrpe-2.15
./configure --with-nagios-user=nagios –with-nagios-group=nagios
验证
[root@mast1 nagios]# ll /usr/local/nagios/libexec/|grep check_nrpe
-rwxrwxr-x 1 nagios nagios 75501 Jun 17 16:35 check_nrpe
标签:
原文地址:http://www.cnblogs.com/roger888/p/5594695.html