Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does cacti monitor linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how cacti monitors linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1. Cacti Monitoring Linux adds new hosts in the "Devices" option

Notice that "Host Template" selects "squid sever". It's the one that was imported. And pay attention to fill in the following:

SNMP Community = passwd

SNMP Version = 1

SNMP Port = 3401

2. Cacti monitors the precautions of Linux in the "settings" of Cacti

The "Downed Host Detection" of the poller page selects Ping. Do not select the word "snmp" that will make an error.

You will see it at the bottom of your device mainframe.

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. Hint: "No SNMP data returned"

You can try to change this setting

View systemview included .1.3.6.1.2.1.1

For

View systemview included .1.3.6.1.2.1

2.Cacti cannot generate an image.

Note that in the host setting, it must be alive. In other words, icmp and the like must be able to ping.

You can also try to disable the survival check.

Attached: test the method of grabbing data by snmp:

Test general data:

Snmpwalk-v 1-c passwd 127.0.0.1 purl 161 if

Snmpwalk-v 2c-c passwd 127.0.0.1 purl 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

3. How to add a Cacti plug-in to Cacti monitoring Linux:

Install Thold, Monitor and other plug-ins for the Cacti system, pay attention to the corresponding version when downloading, incorrect version will cause problems.

Monitor plug-in to provide a more concise and intuitive device status diagram; thold plug-in to provide equipment exception warning.

Install thold and monitor plug-ins: make a backup first

(1) install the Plugin Architecture patch before you can enable thold and monitor plug-ins

Shell > tar zxvf Cacti-plugin-arch.tar.gz-C / var/www/Cacti

Shell > cd / var/www/Cacti/

Shell > patch-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)、安装thold、monitor插件 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)、修改config.php配置文件 shell>

Vi / var/www/Cacti/include/config.php

$config ['url_path'] = "/ Cacti/"; / / change to Cacti corresponds to the path under the web directory, this office is Cacti

$plugins = array ()

$plugins [] = thold

$plugins [] = monitor

(4) refresh the web management interface of the Cacti system, you can see two more tabs (thold, monitor).

(5) use the monitor plug-in

1 > Open "Console- > Settings- > Misc" to adjust the configuration of Monitor. For example, check "Show Icon Legend" to display the legend on the monitoring page.

"View" can choose the Tiles type to display the device status table.

2 > when adding new devices for Cacti, check the "Monitor Host" item. Devices that have been added can be modified through "Management- > Devices".

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

(6) use the thold plug-in

1 > Open "Console- > Settings- > Mail/DNS", and you can adjust configurations such as "SMTP Options" and "DNS Options" to ensure that early warning messages can be sent.

2 > Open "Console- > Settings- > Alerting/Thold" to adjust the configuration of Thold. For example, at "Dead Host Notifications Email", you can fill in the mailbox to which the warning message is sent when the device is down; check

The "Send alerts as text" item can be set to send only messages in text format.

3 > Open "Templates- > Threshold Templates", and you can add and remove templates that need to be associated with the early warning system. For example, you can add an association with the "Interface-Traffic" template, select "traffic_in",

"traffic_out" data item, respectively set warning threshold "High Threshold" (e.g. 200000000 bits / s); you can add association with "Unix-Disk Space" template.

4 > Open "Create- > New Graphs", select the device that needs to provide early warning, and click "Auto-create thresholds" at the top right to create the warning project.

5 > Open "Management- > Thresholds" to manage the early warning projects that have been created.

4. The method of Cacti monitoring Linux:Cacti monitoring hard disk Ihand O:

The template of Cacti itself can only monitor the usage size of the hard disk, but not the percentage of usage, so we can customize cdef to monitor the hard disk utilization and realize the alarm function with the help of thold plug-in. All the information found on the Internet is in

It's implemented on the Cacti.0.8.6 version, and I use the Cacti.0.8.7 version. Therefore, make the following changes according to the actual situation:

Under the Cacti directory, vi global_arrays.php

Search for custom_data_source_types and modify this paragraph as follows:

$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 lines

"CURRENT_GRAPH_MAXIMUM_VALUE" = > "Graph: Upper Limit"

"VALUE_OF_HDD_TOTAL" = > "Value of hdd_total data source")

/ / the Chinese version is transformed into:

"CURRENT_GRAPH_MAXIMUM_VALUE" = > "Image: upper limit"

"VALUE_OF_HDD_TOTAL" = > "value of all hard disk data")

Create a new cdef module in the Graph Management-cdefs of the Cacti interface with a name of your own, and add the following fields:

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 a module to monitor the hard disk in Threshold Templates. I added Host MIB-Hard Drive Space. * Select the custom cdef in Threshold CDEF, so that it can work normally.

Monitor hard drive usage.

Here is an excerpt of how to use it:

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 should include all their dependancies

3. Add "ucd/net-Get Device I Re-index Method 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.

Overall considerations for Cacti monitoring Linux:

1) A very important point: in Cacti devices, you must select the version of snmp > = 2, otherwise you will not be able to get relevant information such as cpu and network card.

2) the memory monitoring unit of local view that comes with Cacti is incorrect. It can be deleted and re-created, and it will be corrected.

3), in the system monitoring, the number of 200m of the cpu icon represents the number of thousands. My understanding of Cacti is to facilitate display and drawing.

4), permission problem: the permission of the Cacti_path/rra log directory must be given to the new user of Cacti, otherwise there will be an error: there are pictures, but there is no data.

This is the end of this article on "how cacti monitors linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report