nagios安装配置(一):nagios
1. 在服务器上下载nagios、nagios-plugin、nrpe[*]wget http://nchc.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.3/nagios-3.2.3.tar.gz -P /usr/local/src
[*]wget http://nchc.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz -P /usr/local/src
[*]wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz -P /usr/local/src
2. 服务器安装必要的软件包
[*]yum install httpd gcc glibc glibc-common gd gd-devel
3. 服务器添加必要的用户nagios、nagcmd
[*]# 添加nagios用户和组
[*]useradd -r nagios -M -s /bin/bash -d /usr/local/nagios
[*]# 添加nagcmd用户和组
[*]useradd -r nagcmd -M -s /sbin/nologin -d /usr/local/nagios
[*]# 将nagios和apache添加到nagcmd组
[*]usermod -G nagcmd -a nagios
[*]usermod -G nagcmd -a nobody
注意:这里是将nobody用户添加到nagcmd中,nagios的Web运行在nginx下
4. 安装nagios
[*]tar zxvf nagios-3.2.3.tar.gz
[*]cd nagios-3.2.3
[*]./configure –with-command-group=nagcmd –prefix=/usr/local/src
[*]make all
[*]make install
[*]make install-init
[*]make install-config
[*]make install-commandmode
5. 服务器添加nagios为service
[*]chkconfig –add nagios
[*]chekconfig nagios on
6. 服务器安装nagios-plugin
[*]tar zxvf nagios-plugins-1.4.15.tar.gz
[*]cd nagios-plugins-1.4.15
[*]# –with-mysql指定mysql的路径,如果没有指定则可能不会生成check_mysql
[*]./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-mysql=/usr/local/mysql
[*]make && make install
6. 配置登录Web用户名和密码
[*]# 生成验证的文件并添加用户
[*]htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin password
页:
[1]