nagios-4.0.8安装
1、下载nagios-4.0.8、nagios-plugins-2.0.3wget http://jaist.dl.sourceforge.net/ ... nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
2、安装组件
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
3、创建nagios用户与用户组
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
4、安装nagios-4.0.8
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --perfix=/usr/local/nagios --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagcmd /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
5、配置httpd
1)配置web登陆用户名和密码
htpasswd -c /usr/local/nagios/etc/htpasswd nagiosadmin
vi /etc/httpd/conf/httpd.conf加入以下内容
#setting for nagios #ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" AuthType Basic Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd //用于此目录访问身份验证的文件 Require valid-user#Alias /nagios "/usr/local/nagios/share" AuthType Basic Options None AllowOverride None Order allow,deny Allow from all AuthName "nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd Require valid-user 2)找到
user apache
group apache
修改为
user nagios
group nagcmd
3)找到
#ServerName www.example.com:80
将前面的#删除
6、安装nagios-plugins
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagcmd
make
make install
7、设置开机启动
chkconfig --add nagios
chkconfig --level 35 nagios on
service nagios start
chkconfig --add httpd
chkconfig --level 35 httpd on
service httpd start
8、访问
http://IP/nagios 输入用户名密码
nagios文件里默认设置的不是nagios组吗?你这个为什么单独设置一个组?
页:
[1]