Nagios_快速配置
Nagios 快速配置
网站建设哪家好,找创新互联公司!专注于网页设计、网站建设、微信开发、小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了东兴免费建站欢迎大家使用!
1 所需软件包:
Apache
GCC compiler
GD development libraries
2 安装配置过程2.1 安装所需软件包:yum install httpd php
yum install gcc glibc glibc-common
yum install gd gd-devel
2.2 创建nagios用户/usr/sbin/useradd -m nagios
passwd nagios
2.3 创建nagcmd用户组,并添加nagios和apache到这个用户组/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
2.4 下载软件wget http://ncu.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.1/nagios-3.5.1.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz
2.5 编译安装tar xvf nagios-3.5.1.tar.gz
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
2.6 自定义配置,修改email地址vim/usr/local/nagios/etc/objects/contacts.cfg
2.7 配置web 接口#安装Nagio web 配置文件到Apacheconf.d 目录
make install-webconf
#创建用于登录的nagiosadmin账户
htpasswd -c/usr/local/nagios/etc/htpasswd.users nagiosadmin
#重启Apache使服务生效
service httpd restart
2.8 编译安装Nagios插件#解压
tar xvf nagios-plugins-2.0.tar.gz
cd nagios-plugins-2.0
#配置
./configure --with-nagios-user=nagios--with-nagios-group=nagios
make && make install
2.9 启动Nagio#添加到开机启动项
chkconfig --add nagios
#设置开机自启动
chkconfig nagios on
#检测配置文件的语法
/usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg
#启动
service nagios start
2.10 登录到Web接口#在浏览器中输入
http://localhost/nagios
#由于所用服务器没有图形界面,所以在Ubuntu查看时输入
http://10.10.54.111/nagios
3. 注意事项A.关闭SELinux
B.设置好防火墙规则
文章题目:Nagios_快速配置
标题网址:http://ybzwz.com/article/giijpj.html