码迷,mamicode.com
首页 > 移动开发 > 详细

nagios 插件ndoutils 安装配置

时间:2015-12-06 01:47:46      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

nagios 插件ndoutils 安装配置

 原文地址:http://www.cnblogs.com/caoguo/p/5022645.html

 

 

# Nagios install ndoutils

# 安装ndoutils插件
[root@Cagios ~]# yum install -y mysql-devel perl-DBD-MySQL
[root@Cagios ~]# wget http://nchc.dl.sourceforge.net/project/nagios/ndoutils-2.x/ndoutils-2.0.0/ndoutils-2.0.0.tar.gz

[root@Cagios src]# tar zxf ndoutils-2.0.0.tar.gz 
[root@Cagios src]# cd ndoutils-2.0.0
[root@Cagios ndoutils-2.0.0]# ./configure --prefix=/usr/local/nagios --with-ndo2db-user=nagios --with-ndo2db-group=nagcmd

[root@Cagios ndoutils-2.0.0]# make && make install

[root@Cagios ndoutils-2.0.0]# cp daemon-init /etc/init.d/ndo2db
[root@Cagios ndoutils-2.0.0]# chmod 755 /etc/init.d/ndo2db
[root@Cagios ndoutils-2.0.0]# cp config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
[root@Cagios ndoutils-2.0.0]# cp config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
[root@Cagios ndoutils-2.0.0]# chown nagios.nagcmd /usr/local/nagios/etc/ndo*
[root@Cagios ndoutils-2.0.0]# chmod 664 /usr/local/nagios/etc/ndo*


# 建立数据库及数据帐户
[root@Cagios ~]# mysql -uroot -p
Enter password: 
mysql> create database nagios;
mysql> create user nagios@localhost identified by nagios;
mysql> grant all on nagios.* to nagios@localhost;
mysql> flush privileges;
mysql> quit


# 导入表结构
[root@Cagios ndoutils-2.0.0]# cd db/
[root@Cagios db]# ./installdb -u nagios -p nagios -h localhost -d nagios

# ndo2db配置数据连接
[root@Cagios ~]# cd /etc/nagios/
[root@Cagios nagios]# vi ndo2db.cfg
ndo2db_user=nagios
ndo2db_group=nagcmd

db_name=nagios
db_user=nagios
db_pass=nagios
[root@Cagios ~]# /etc/init.d/ndo2db start


# nagios与ndoutils通信
[root@Cagios nagios]# vi nagios.cfg
broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg

[root@Cagios ~]# /etc/init.d/nagios restart

 

#重启nagios,nagios日志输出应该如下

技术分享

 

#查看下数据库

技术分享

 

技术分享

 

技术分享

 

数据存入数据时ok的,结束!!!

nagios 插件ndoutils 安装配置

标签:

原文地址:http://www.cnblogs.com/caoguo/p/5022645.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!