主机系统: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
虚拟系统:RHEL 5.3 Linux
安装前准备:
将RHEL的安装光盘mount到文件系统中:mount -t iso9660 /dev/cdrom /mnt/cdrom
需要在图形页面中“添加/删除软件”配置
菜单Edit/Repository Manager
新建:
Name:cdrom
Description: cdrom
Location:file:///mnt/cdrom/Server/
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: yum search xinetd
如果没有,需要安装:yum install 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主程序:
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
配置httpd,重启系统后httpd自动启动:
chkconfig --add httpd
chkconfig httpd 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.1.10p2.tar.gz
cd check_mk-1.1.10p2
./setup.sh 基本使用默认配置,如果需要修改,请使用绝对路径
如果需要安装新版本的check_mk,请先删除文件:check_mk_setup.conf,在进行安装
检查安装是否成功,成功会显示相关版本信息:
check_mk --version
安装Check_mk插件:
cd /tmp
rpm -i check_mk-agent-1.1.10p2-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/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24751738/viewspace-707306/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24751738/viewspace-707306/