资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

cacti与nagios整合

1.系统环境
# uname -a
Linux 10-6-8-200 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
CentOS release 6.3 (Final)
Nagios Stats 3.5.0
cacti-0.8.7e
2.下载包
ndoutils-1.4b9.tar.gz
npc-2.0.4.tar.gz
3.解压编译安装
# tar zxf ndoutils-1.4b9.tar.gz
# cd ndoutils-1.4b9
# ./configure --prefix=/usr/local/nagios/ --sysconfdir=/usr/local/nagios/etc/ --enable-MySQL --disable-pgsql
# make
# make install ##这步可以省略
4.拷贝命令
#cp src/{ndomd-3x.o,ndo2db-3x,file2sock,log2ndo} /usr/local/nagios/bin/
5.更改命令权限
# chown nagios.nagios /usr/local/nagios/bin/ndo*
# chmod 644 /usr/local/nagios/bin/ndo*
6.编辑配置文件
# vi /usr/local/nagios/etc/ndo2db.cfg
lock_file=/usr/local/nagios/var/ndo2db.lock
ndo2db_user=nagios
ndo2db_group=nagios
socket_type=tcp
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
use_ssl=0
db_servertype=mysql
db_host=localhost
db_port=3306
db_name=cacti
db_prefix=npc_
db_user=cacti
db_pass=xxxx
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
max_externalcommands_age=44640
debug_level=0
debug_verbosity=1
debug_file=/usr/local/nagios//var/ndo2db.debug
max_debug_file_size=1000000
# vi /usr/local/nagios/etc/ndomod.cfg
instance_name=default
output_type=tcpsocket
output=127.0.0.1
tcp_port=5668
use_ssl=0
output_buffer_items=5000
buffer_file=/usr/local/nagios//var/ndomod.tmp
file_rotation_interval=14400
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
data_processing_options=-1
config_output_options=2
7.修改nagios的配置文件
# vi /usr/local/nagios/etc/nagios.cfg
event_broker_options=-1
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
8.修改数据库
# mysql -ucacti -p
mysql> use catci;
mysql> alter table npc_eventhandlers add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_hostchecks add long_output TEXT NOT NULL default '' after output;
mysql>  alter table npc_hoststatus add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_notifications add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_servicechecks add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_servicestatus add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_statehistory add long_output TEXT NOT NULL default '' after output;
mysql> alter table npc_systemcommands add long_output TEXT NOT NULL default '' after output;
9.拷贝服务启动脚本
# cp daemon-init /etc/init.d/ndo2db
# chmod +x /etc/init.d/ndo2db
# chkconfig --add ndo2db
# chkconfig --level 35 ndo2db on
# service ndo2db start
# service nagios restart
10.解压npc,并拷贝到cacti目录
# tar zxf npc-2.0.4.tar.gz
# mv npc/ /var/www/html/cacti/plugin/

11.打开网页进入cacti

武定ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!

console--->Configuration--->Plugin Management--->Npc

cacti与nagios整合

cacti与nagios整合


网页标题:cacti与nagios整合
文章URL:http://cdkjz.cn/article/jsccjp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220