Cacti+nagios Integration (non-formed)

Source: Internet
Author: User


Cacti+nagios Integration:


http://pkgs.fedoraproject.org/repo/pkgs/php-json/php-json-ext-1.2.1.tar.bz2/e06e701412a055f3372775216ec3d604/ php-json-ext-1.2.1.tar.bz2

Http://sourceforge.net/projects/nagios/files/ndoutils-2.x/ndoutils-2.0.0/ndoutils-2.0.0.tar.gz/download

Http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

http://down.51cto.com/data/558499



$ sudo apt-get install Libmysqld-dev

$ sudo apt-get install Php5-dev

$ tar jxfv php-json-ext-1.2.1.tar.bz2

$ CD php-json-ext-1.2.1

$./configure

$ sudo make

$ sudo make install

$ cd

$ tar zxfv ndoutils-2.0.0.tar.gz

$ CD ndoutils-2.0.0

$./configure--prefix=/usr/local/nagios--enable-mysql--with-ndo2db-user=nagios--with-ndo2db-group=nagios

$ sudo make

$ sudo cp src/ndomod-3x.o/usr/local/nagios/bin/

$ sudo cp src/ndo2db-3x/usr/local/nagios/bin/

$ sudo cp src/log2ndo/usr/local/nagios/bin/

$ sudo cp src/file2sock/usr/local/nagios/bin/

$ sudo cp config/ndo2db.cfg-sample/usr/local/nagios/etc/ndo2db.cfg

$ sudo cp config/ndomod.cfg-sample/usr/local/nagios/etc/ndomod.cfg

$ sudo vi/usr/local/nagios/ndo2db.cfg

Ndo2db_user=nagios
Ndo2db_group=nagios
Socket_type=tcp (remove front #,socket_type=unix plus #)
DB_PREFIX=NPC_ (default = Db_prefix=nagios_)
Db_name=cacti//CACTI Database name
Db_user=cactiuser//cacti Database user
db_pass=123456 the password of the//CACTI database user

: Wq

$ sudo vi/usr/local/nagios/etc/ndomod.cfg

Output_type=tcpsocket (remove the front #,output_type=unixsocket plus #
output=127.0.0.1 (remove the front #,output=/usr/local/nagios//var/ndo.sock plus #

: Wq

Start ndo2db:


$ sudo/usr/local/nagios/bin/ndo2db-3x-c/usr/local/nagios/etc/ndo2db.cfg

$ sudo vi/usr/local/nagios/etc/nagios.cfg

Process_performance_data=1 (Ensure that the value is 1 and not commented out)

BROKER_MODULES=/USR/LOCAL/NAGIOS/BIN/NDOMOD-3X.O config_file=/usr/local/nagios/etc/ndomod.cfg (added at the end)

: Wq

$ sudo service Nagios restart


$ cd/var/www/cacti/plugins/(Place downloaded npc.tar.gz in this directory)

$ tar zxfv npc.tar.gz


$ sudo vi/var/www/cacti/include/config.php

$plugins []= ' NPC ';

: Wq

$ sudo service apache2 restart

$ cd

$ tar zxfv pdo_mysql-1.0.2.tgz

$ sudo ln-s/usr/include/php5/usr/include/php

$ CD pdo_mysql-1.0.2

$ phpize

$./configure

$ sudo make

$ sudo make install

$ mysql-u root-p123456

mysql> use cacti;
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_statehistory add long_output TEXT not NULL default "after output;
Mysql> ALTER TABLE npc_systemcommands add long_output TEXT not NULL default "after output;



Visit Http://localhost/cacti-console-Plugin managent-Click the actions down arrow icon for NPC rows-click the right icon-the NPC interface will appear

Click the remote Commands-nagios Command File Path:/usr/local/nagios/var/rw/nagios.cmd-nagios URL in the console-settings-npc-tick: http://ip/nagios-Click Save


This article from "Linux" blog, declined reprint!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.