Detailed Implementation of Cacti plugin added in Cacti monitoring Linux

Source: Internet
Author: User
Tags snmp snmp port snmpwalk

Cacti is a software implemented in php. Its main function is to use the snmp service to obtain data, store and update data using rrdtool, and generate charts and present them to users. Previous articles briefly talked about Cacti monitoring

The following section describes the Linux application that Cacti monitors.

I. Add a new host to the "Devices" option of Cacti monitoring Linux

Note that select squid sever for "Host Template ". It is the imported one, and pay attention to fill in the following content:
SNMP Community = passwd
SNMP Version = 1
SNMP Port = 3401

Ii. Notes about Cacti monitoring Linux in Cacti's "settings"

Select Ping for "Downed Host Detection" on the poller page. If you do not select snmp, an error will occur.
At the bottom of your Device Host
WebCache-Squid Statistics-Core (Verbose Query) Uptime Goes Backwards Success [1 Item, 1 Row]
WebCache-Squid Statistics-Median Based (Verbose Query) Uptime Goes Backwards Success [3 Items, 3 Rows]

1. message: "No SNMP data returned"
You can try to change this setting.
View systemview embedded ded. 1.3.6.1.2.1.1
Is
View systemview embedded ded. 1.3.6.1.2.1

2. Cacti cannot generate images.
Note that the host must be active in settings. That is to say, icmp and so on must be able to ping.
You can also disable the survival check.

Appendix: methods for testing snmp Data Capturing:

Test common data:
Snmpwalk-v 1-c passwd 127.0.0.1: 161 if
Snmpwalk-v 2c-c passwd 127.0.0.1: 161 if

Test squid data:
Snmpwalk-v 1-c passwd 127.0.0.1: 3401 1.3.6.1.4.1.3495.1
Snmpwalk-v 2c-c passwd 127.0.0.1: 3401 1.3.6.1.4.1.3495.1

Iii. How to add the Cacti plug-in to Cacti monitoring Linux:

Install plug-ins such as Thold and Monitor for the Cacti system. Pay attention to the corresponding version when downloading. if the version is incorrect, problems may occur.
The monitor plug-in provides simpler and more intuitive device status diagrams. The thold plug-in provides device exception warnings.
Install the thold and monitor plug-ins: Back up the plug-ins first.

1) install the plug-in Architecture patch. After installation, you can enable the thold and monitor plug-ins.
Shell> tar zxvf Cacti-plugin-arch.tar.gz-C/var/www/Cacti
Shell> cd/var/www/Cacti/
Shell> patches-p1-N <Cacti-plugin-arch/Cacti-plugin-0.8.7a-PA-v2.1.diff
Shell>/opt/mysql/bin/mysql-u Cactiuser-p Cactidb <pa. SQL

2) install the thold and monitor plug-ins.
Shell> tar zxvf settings-0.5.tar.gz-C/var/www/Cacti/plugins
Shell> tar zxvf thold-0.3.4.tar.gz-C/var/www/Cacti/plugins
Shell> tar zxvf monitor-0.8.2.tar.gz-C/var/www/Cacti/plugins
Shell> cd/var/www/Cacti/plugins/
Shell>/opt/mysql/bin/mysql-u Cactiuser-p Cactidb <thold/thold. SQL
Shell>/opt/mysql/bin/mysql-u Cactiuser-p Cactidb <monitor/monitor. SQL


3) modify the config. php configuration file
Shell> vi/var/www/Cacti/include/config. php
$ Config ['url _ path'] = "/Cacti/"; // change the value to Cacti, which corresponds to the path under the web directory.
$ Plugins = array ();
$ Plugins [] = thold;
$ Plugins [] = monitor;

4) refresh the web management interface of the Cacti system. Two more tabs are displayed: thold and monitor ).

5) use the monitor plug-in

1> open "Console-> Settings-> Misc" to adjust the configurations of Monitor. For example, you can select Show Icon Legend to display the Legend on the monitoring page;
You can select the Tiles type for "View" to display the device status table.

2> when adding a new device to Cacti, check "Monitor Host. You can use "Management-> Devices" to modify the added Devices.

3> click the "monitor" tab link at the top of the Web page to view the status charts of each device/host.

(6) use the thold plug-in

1> open "Console-> Settings-> Mail/DNS", and you can adjust the Settings such as "SMTP Options" and "DNS Options" to ensure that the alert email can be sent.

2> open "Console-> Settings-> Alerting/Thold" to adjust the configuration of Thold. For example, in the "Dead Host Email" field, you can enter the Email address to which the device sends the warning message when it is sent. Select

"Send alerts as text", you can set to Send only messages in text format.
3> open "Templates-> Threshold Templates" to add and retrieve the template to be associated with the alert system. For example, you can add an association with the "Interface-Traffic" template, select "traffic_in ",
"Traffic_out" data item, respectively set the warning Threshold "High Threshold" such as 200000000 bits/s); you can add the association with the "Unix-Disk Space" template .......

4> open "Create-> New Graphs", select the device that requires an alert, and click "Auto-create thresholds" in the upper-right corner to Create an alert project.

5> open "Management-> Thresholds" to manage created alert projects.

4. Cacti Linux: Cacti hard disk I/O monitoring method:

The Cacti template can only monitor the disk usage, but cannot monitor the usage percentage. Therefore, we can customize cdef to monitor the disk usage and use the thold plug-in to implement the alarm function. All the information found on the internet is

Cacti.0.8.6, and I use Cacti.0.8.7. Therefore, make the following changes based on the actual situation:
Under the Cacti directory, vi global_arrays.php

Search custom_data_source_types. Modify the following section:
$ Custom_data_source_types = array (
"CURRENT_DATA_SOURCE" => "Current Graph Item Data Source ",
"ALL_DATA_SOURCES_NODUPS" => "All Data Sources (Don't Include Duplicates )",
"ALL_DATA_SOURCES_DUPS" => "All Data Sources (Include Duplicates )",
"SIMILAR_DATA_SOURCES_NODUPS" => "All Similar Data Sources (Don't Include Duplicates )",
"SIMILAR_DATA_SOURCES_DUPS" => "All Similar Data Sources (Include Duplicates )",
"CURRENT_DS_MINIMUM_VALUE" => "Current Data Source Item: Minimum Value ",
"CURRENT_DS_MAXIMUM_VALUE" => "Current Data Source Item: Maximum Value ",
"CURRENT_GRAPH_MINIMUM_VALUE" => "Graph: Lower Limit ",

// Add the following two rows
"CURRENT_GRAPH_MAXIMUM_VALUE" => "Graph: Upper Limit ",
"VALUE_OF_HDD_TOTAL" => "Value of hdd_total data source ");

// Chinese version:
"CURRENT_GRAPH_MAXIMUM_VALUE" => "Image: upper limit ",
"VALUE_OF_HDD_TOTAL" => "values of all hard disk data ");

Create a cdef module in the Graph Management-cdefs on the Cacti interface and add the following fields by name:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 100
Item #3 Operator :*
Item #4 Special Data Source: VALUE_OF_HDD_TOTAL
Item #5 Operator:

That is to say
Cdef = CURRENT_DATA_SOURCE, 100, *, VALUE_OF_HDD_TOTAL ,/
In this way, you can add the monitoring Hard disk module in Threshold Templates. I added the Host MIB-Hard Drive Space, and finally selected the custom CDEF in Threshold cdef, in this way, it will work normally.

Monitor hard disk usage.

The following is an excerpt from the usage:
1. Copy net-snmp_devio.xml to/resource/snmp_queries/net-snmp_devio.xml
2. Import all * _ templ. xml via Cacti "Import Templates" interface-These templates shoshould include all their dependences es
3. Add "ucd/net-Get Device I/O" Data Query to your SNMP Enabled host using the "Index Count Changed" Re-index Method.
4. Create Graphs for your desired Disk and/or Memory devices.

Notes for Cacti Linux monitoring:
1). It is very important that you select the snmp version> = 2 for the Cacti device. Otherwise, you will not be able to obtain information such as the cpu and network card.
2) The memory Monitoring Unit of the local view provided by Cacti is incorrect. You can delete and recreate it to correct it.
3) In system monitoring, the number 200m of the cpu icon represents a maximum of ten thousandths. In my understanding, Cacti is used to facilitate the display of pictures.
4) permission problem: the permissions of the Cacti_path/rra log directory must be granted to new users of Cacti. Otherwise, an error occurs: There is a graph, but no data.
 

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.