声明
作者:昨夜星辰
博客:http://yestreenstars.blog.51cto.com/
本文由本人创作,如需转载,请注明出处,谢谢合作!
目的
安装check_mk。
主要软件
OS: CentOS 6.2 32
nagios: 4.0.7
nagios-plugins: 2.0.3
nrpe: 2.15
pnp4nagios: 0.6.25
mk-livestatus: 1.2.6
mod-python: 3.5.0
check_mk: 1.2.6
注意事项
我已经将以下配置过程中会用到的软件打包上传到云盘,读者可以直接从云盘下载并上传至/tmp目录。
http://yunpan.cn/cVHrvdAAutXup (提取码:2807)
配置
# 停止防火墙并禁止开机自动启动 service iptables stop chkconfig iptables off # 关闭SELinux并设置开机默认为不可用状态 setenforce 0 sed -i ‘/^SELINUX=/s/=.*/=disabled/‘ /etc/selinux/config # 安装相关软件 yum -y groupinstall ‘Development Tools‘ yum -y install httpd-devel python-devel rrdtool rrdtool-perl perl-Time-HiRes gd gd-devel openssl openssl-devel php net-snmp wget # 创建相关用户和组 useradd nagios -M -s /sbin/nologin gpasswd -a apache nagios # 安装nagios tar xzf /tmp/nagios-4.0.7.tar.gz -C /usr/local/src/ cd /usr/local/src/nagios-4.0.7/ ./configure make all make install make install-init make install-commandmode make install-config make install-webconf # 安装nagios-plugins tar xzf /tmp/nagios-plugins-2.0.3.tar.gz -C /usr/local/src/ cd /usr/local/src/nagios-plugins-2.0.3/ ./configure make make install # 安装nrpe tar xzf /tmp/nrpe-2.15.tar.gz -C /usr/local/src/ cd /usr/local/src/nrpe-2.15/ ./configure make all make install-plugin make install-daemon make install-daemon-config # 启动httpd和nagios服务并设置为开机自动启动 service httpd start chkconfig httpd on service nagios start chkconfig --add nagios chkconfig nagios on # 创建nagios的管理员并设置密码 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin # 安装pnp4nagios tar xzf /tmp/pnp4nagios-0.6.25.tar.gz -C /usr/local/src/ cd /usr/local/src/pnp4nagios-0.6.25/ ./configure make all make fullinstall # 安装mk-livestatus tar xzf /tmp/mk-livestatus-1.2.6.tar.gz -C /usr/local/src/ cd /usr/local/src/mk-livestatus-1.2.6/ ./configure make make install # 安装mod_python tar xzf /tmp/mod_python-3.5.0.tgz -C /usr/local/src/ cd /usr/local/src/mod_python-3.5.0/ git init git add . git commit -m ‘Initial commit‘ ./configure --with-apxs=/usr/sbin/apxs make make install # 修改/etc/httpd/conf/httpd.conf以支持mod_python sed -i ‘/^LoadModule/,/^$/{/^$/s/^/LoadModule python_module modules\/mod_python.so\n/}‘ /etc/httpd/conf/httpd.conf # 安装check_mk tar xzf /tmp/check_mk-1.2.6.tar.gz -C /usr/local/src/ cd /usr/local/src/check_mk-1.2.6/ ./setup.sh # 这是一个交互式脚本,大部分值都可以用默认的(直接回车),除了以下几个值: # /var/log/nagios/rw/nagios.cmd -> /usr/local/nagios/var/rw/nagios.cmd # /var/lib/nagios/rrd -> /usr/local/pnp4nagios/var/perfdata # 安装完之后要重启httpd和nagios service nagios restart service httpd restart # 整个配置过程就到此结束了,读者可以通过http://localhost/check_mk来访问。
时间: 2024-10-17 11:14:46