Nagios+Check_mk CentOS 安装
主机系统:windows xp
虚拟机:VMware Workstation 7.0.1 build-227600
NAGIOS版本:nagios-3.2.3.tar.gz
NAGIOS插件版本:nagios-plugins-1.4.15.tar.gz
Check_mk版本:check_mk-1.1.10p2.tar.gz
Check_mk插件版本:check_mk-agent-1.1.10p2-1.noarch.rpm
存放路径:/tmp
虚拟系统:CentOS 5.5 Linux Version 2.6.18-194.el5
需要网络
安装前准备:
1. yum install httpd php
2. yum install gcc glibc glibc-common gcc-c++
3. yum install gd gd-devel
4. 检查python是否为2.X版本,check_mk不支持3.X :python -V
5. 安装xinetd
创建用户:
su -l
/usr/sbin/useradd -m nagios
passwd nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
安装Nagios主程序:
passwd nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
安装Nagios主程序:
cd /tmp
tar xzf nagios-3.2.3.tar.gz
cd nagios-3.2.3
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
创建web登录账户并设置密码:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
启动apache服务: service httpd start
安装Nagios插件:
cd /tmp
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
配置Nagios,重启系统后Nagios自动启动:
chkconfig --add nagios
chkconfig nagios on
检查Nagios配置:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
启动Nagios服务:
service nagios start
修改SELinux配置:
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
登录Web页面:
http://localhost/nagios/
请确保Nagios正常安装后执行之后的安装。
安装Check_mk主程序:
cd /tmp
tar xzf check_mk-1.2.4p5.tar.gz
cd check_mk-1.2.4p5
./setup.sh 基本使用默认配置,如果需要修改,请使用绝对路径
如果需要安装新版本的check_mk,请先删除文件:check_mk_setup.conf,在进行安装
检查安装是否成功,成功会显示相关版本信息:
check_mk --version
安装Check_mk插件:
cd /tmp
rpm -i check_mk-agent-1.2.4p5-1.noarch.rpm
配置Check_mk:
cd /etc/check_mk/
vi main.mk
文件修改成:all_hosts = [ "Localhost" ] check_mk -I
check_mk -O
登录Web页面:
http://localhost/nagios/
Comments
Post a Comment