Integration of Cacti and Nagios on RedHat5.4

Source: Internet
Author: User
Forbidden. B

Integrate cacti and nagios

Software required before integration

Cacti-plugin-0.8.7e-PA-v2.5.zip

Npc-2.0.4.tar.gz

Php-json-ext-1.2.1.tar.bz2

1. Check whether the php-devel software is installed on the system. If not, install the software. Otherwise,

Php-dson-ext cannot be compiled and installed

2 decompress and install php-json-ext-1.2.1.tar.bz2

# Tar xvf php-json-ext -1.2.1.tar. Bz2

# Cd php-json-ext-1.2.1

# Phpize

Processing ing:

PHP Api Version: 20041225

Zend Module Api No: 20050922

Zend Extension Api No: 220051025

#./Configure

# Make

# Make install

# Find/-name * json. so

/Usr/lib/php/modules/json. so

/Root/soft/php-json-ext-1.2.1/modules/json. so

/Root/soft/php-json-ext-1.2.1/. libs/json. so

3. Edit the/etc/php. d/json. ini file.

And add the following content

Extension = json. so

4. Restart apache

# Service httpd restart

5. Create a page under/var/www/html

# Vim test.html

Phpinfo ();

Phpinfo (INFO_GENERAL );

Phpinfo (1 );

?>

And save

And access http: // ip

Check whether php supports json

6. Install the cacti-plugins plug-in.

# Unzip cacti-plugin-0.8.7e-PA-v2.5.zip

Of course, there are two ways to install cacti-plugins

(1) The first method is to extract the files-0.8.7.e file directly overwrite/var/www/cacti/directory

Overwrite and configure

(2) The second method is patching,

# Cd cacti-plugin-0.8.7e-PA-v2.5

# Cp cacti-plugin-0.8.7e-PA-v2.5. dff/var/www/html/cact

# Cp pa. SQL/var/www/html/cacti

# Cd/var/www/html/cacti

# Patch-p1-N

And update the database

# Mysql-uroot-p password cactidb

If selinux is enabled, You need to modify the tag again.

# Chcon-R-t httpd_sys_content_t cacti

8. Install the npc plug-in

First, decompress the package and move the plug-in to cacti/plugins.

# Tar xvf npc-2.0.4.tar.gz

# Mv/var/www/html/cacti/plugins/npc

9 edit the configuration file include/global. php for configuring cacti

And add the following parameters.

$ Plugins [] = 'npc ';

$ Config ['url _ path'] = '/cacti /';

Save and exit

10. modify the configuration file

# Cd/usr/local/nagios/etc

# Vim 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

Db_servertype = mysql

Db_host = localhost

DB Port = 3306

Db_name = cactidb

Db_prefix = npc _

Db_user = cactiuser

Db_pass = 123456

Of course, the cactidb here is the cacti Database

Db_user is the user with the cactidb permission.

11 install the npc through the web interface

Http: // IP/cacti

(1) console-à User Management-à admin

In the lower right corner, there are two options: NPC and NPC Global Commands. Select and save the two options.

(2) Click Plugin Management-à to find the npc option and click install to install it.

After the plug-in is installed and enabled, click Enable

Note: Although cacti and nagios are correct, I don't know why. It is because the nagios status displayed on the npc page of cacti is always off, however, you can view nagios's,

Part 4

Is part of the cacti plug-in.

Of course, the installation of other cacti plug-ins is very similar to the installation of the npc plug-in.

Move to the cacti/plugins directory under the cacti root directory, but it is worth noting that some plug-ins need to import their own data into the cacti database, import the data to the cacti database if necessary.

During installation, check whether selinux on the host is enabled.

If selinux is enabled, disable or modify the tag of the plug-in.

# Chcon-R-t filename

After the configuration is added, modify the master configuration file of cacti.

Add the following

$ Plugins [] = '*****';

And save it.

Related Article

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.