2 系统环境
OS : CentOS release 5.4 (Final)
Nagios: nagios-3.2.3.tar.gz
Nagios-plugins
:nagios-plugins-1.4.15.tar.gz
2 安装需求:
lhttpd、php
lgcc、glibc、glibc-common
lgd、gd-devel
2 依赖包安装
懒人懒办法-_-
#yum install -y httpd php gcc glibc glibc-common gd gd-devel
2 账户创建
#/usr/sbin/useradd -m nagios#/usr/sbin/groupadd nagcmd
#/usr/sbin/usermod -a -G nagcmd nagios#/usr/sbin/usermod -a -G nagcmd apache
2 Nagios安装
#tar xzf nagios-3.2.3.tar.gz
# ./configure --with-command-group=nagcmd
# make all
安装程序
#make install
安装init脚本(启动脚本)
#make install-init
安装配置文件(nagios.cfg ..)
#make install-config
安装webconfiugre(可以通过网站访问Nagios)
#make install-webconf
设置权限
#make install-commandmode
2 Nagios-plugins安装
#tar xzf nagios-plugins-HEAD.tar.gz
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make #make install
#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
#service httpd restart
2 Nagios启动
chkconfig 管理nagios #chkconfig --add nagios
开机启动
#chkconfig --level 345 nagios on
验证配置文件的正确性
#/usr/local/nagios/bin/nagios -v \ /usr/local/nagios/etc/nagios.cfg
#service nagios start
2 目录介绍
/usr/local/nagios #安装目录 /usr/local/nagios/libexec #检测插件目录
/usr/local/nagios/etc #配置文件目录
/usr/local/nagios/bin #可执行文件目录
/usr/local/nagios/share #web目录
/usr/local/nagios/var #日志、cache目录
/usr/local/nagios/sbin #cgi文件
/usr/local/nagios/etc/objects #对象配置文件目录
./nagios_deploy.sh nagios-*
阅读(2165) | 评论(2) | 转发(0) |