Cacti monitoring Tool data collection method, template introduction and use

Source: Internet
Author: User
Tags rrdtool snmp

Directory

1, Cacti data collection method, three kinds of template introduction

2. Introduction to the use of templates

1, Cacti data collection method, three kinds of template introduction

In the previous blog post we deployed the cacti environment and let cacti run. Today, we introduce the "Collection Methods", "Templates", "Import/export" three parts in the "Consolle" console of cacti, which is the three parts identified in.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/0F/wKioL1WRBOOgjbUtAAJAWXjYMOY245.jpg "title=" 1.jpg " alt= "Wkiol1wrboogjbutaajawxjymoy245.jpg"/>

In the "Collection Methods" (collection method) there are two categories, one is "Data Queries" (query), and the other is "Data input Methods" (the method of inputting). Data queries is a well-defined XML file that cacti how to obtain the monitoring data, that is, the definition of how the data is collected, the XML file is generally defined to obtain the data of the command or script; Data Input methods is also a way to describe how cacti gets the data. Common is a script that uses Perl scripts, PHP scripts, and shell scripts to organize commands that fetch data.

1.1,Collection Methods Introduction

After the cacti is installed, by default cacti provides some collection methods, we choose a look, select "Data Queries", we can see the system comes with a few data query methods, in the "Data Input method" The column also shows that each data query is probably using tools to obtain data, useful SNMP, and also useful scripts to collect data, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/0F/wKioL1WRBUTBQ7ppAAR3QfRVM7w624.jpg "title=" 1.jpg " alt= "Wkiol1wrbutbq7ppaar3qfrvm7w624.jpg"/> Click on the first data query, you can get some details about this data query, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/12/wKiom1WRA6CAuFmvAAU3v3Vsfc0858.jpg "title=" 1.jpg " alt= "Wkiom1wra6caufmvaau3v3vsfc0858.jpg"/>

If you are familiar with XML files like this, you can go to the cacti site directory to see the detailed definition of this XML file, "<path_cacti>" means cacti's home directory, that is, your site's home directory.

Then take a look at "Data Inpuet Methods", by default, cacti also provides a number of input methods, which is defined by the use of various scripts to obtain monitoring data, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/12/wKiom1WRA7zBj3CwAARn33WY-Rw055.jpg "title=" 1.jpg " alt= "Wkiom1wra7zbj3cwaarn33wy-rw055.jpg"/> point to open a data entry method can also view its detailed information, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/0F/wKioL1WRBaPj_4yGAAUYNYnMsN0307.jpg "title=" 1.jpg " alt= "Wkiol1wrbapj_4ygaauynynmsn0307.jpg"/>

1.2, Templates Introduction

1.2.1, graphic templates

In cacti, there are three types of templates: One is the graphical template, which defines how the cacti uses the "collection method" to collect the data when it is needed to draw the data out to give the graphical properties of the presentation, such as: whether the graph to be drawn represents the maximum, minimum, or average value for a given period of time, When drawing a drawing is to draw with line or area chart, what is the color of the line, whether the graphic is PNG or GIF, the length of the graph, the width is how many, etc., we open the "linux-memory Usage" This graphic template to see, click "Graph Templates", Find the "Linux-memory Usage" and open it as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/12/wKiom1WRBAOTMjAlAAaA9U65RQk481.jpg "title=" 1.jpg " alt= "Wkiom1wrbaotmjalaaaa9u65rqk481.jpg"/> above the definition of this graphic template, after the cacti installation has been called to monitor this machine, you click on the main page of the "graphs", In the default graphics tree There is a monitor graph of this machine, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/0F/wKioL1WRBeLg1XYYAARkeI1IbC0965.jpg "title=" 1.jpg " alt= "Wkiol1wrbelg1xyyaarkei1ibc0965.jpg"/>

1.2.2, host templates

Host templates I think it's a very special template, it contains the graphics template (graph Templates) and data query (Queries) two parts, we open the default when the producer of the "Local Linux machine" This host template to look at:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/12/wKiom1WRBDuSlryBAASsxLVNPQk123.jpg "title=" 1.jpg " alt= "Wkiom1wrbduslrybaassxlvnpqk123.jpg"/>

1.2.3, data templates

The data template defines how cacti should archive the collected data to form RRA and create an RRD file, which is a common option or parameter for creating a data source with the "RRDtool create" command, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/12/wKiom1WRBF3Cu9SDAAbVXrGH-1U576.jpg "title=" 1.jpg " alt= "Wkiom1wrbf3cu9sdaabvxrgh-1u576.jpg"/>

If you are familiar with RRDtool create this command, then the above figure expression meaning can easily read.

2. Introduction to the use of templates

Although some templates are provided by default after installing cacti, these templates are often not suitable for use in your environment, so we can go to the "http://forums.cacti.net/viewforum.php?f=12&sid= 0a97a0d56050d4fc88b158aab6c91512"Here to find the right template for you, each template will have different installation methods, you have to carefully read the author's" Install "file, which will describe how the template installed. Below is an example of importing a host template to illustrate how a template is imported, and the template file I use here is "Cacti_host_template__linux_generic.xml".

Open the cacti console and follow the steps below to import the template file:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/12/wKiom1WRBH2RH0LNAAUbzTAYaqs331.jpg "title=" 1.jpg " alt= "Wkiom1wrbh2rh0lnaaubztayaqs331.jpg"/> click on the "Import" button will show the details of this template, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/12/wKiom1WRBJySMZ_IAAQR5XCXoUs649.jpg "title=" 1.jpg " alt= "Wkiom1wrbjysmz_iaaqr5xcxous649.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/6F/0F/ Wkiol1wrbnpchrt7aapyttyate8955.jpg "title=" 1.jpg "alt=" Wkiol1wrbnpchrt7aapyttyate8955.jpg "/>

Then click "Import" to import this host template into the cacti.

After importing the template now to verify that the host template is really imported into the cacti, in the console click "Host Templates", you can find a "* Linux Generic", click to view its details, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/12/wKiom1WRBM6jQ8OoAAP_omN8I0w549.jpg "title=" 1.jpg " alt= "Wkiom1wrbm6jq8ooaap_omn8i0w549.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M01/6F/0F/ Wkiol1wrbqtivfkpaavhfiqzjqs199.jpg "title=" 1.jpg "alt=" Wkiol1wrbqtivfkpaavhfiqzjqs199.jpg "/>

The template has been imported correctly, next we create a "Devices" for a remote host, apply our imported host template to this device, I have started a Linux host with IP 192.168.0.202, this host has made the following configuration:

[[email protected] ~]# yum-y install net-snmp #安装snmp [[email protected] ~]# Cp/etc/snmp/snmpd.conf{,back} #备份配置文件 [[EMA Il protected] ~]# vim/etc/snmp/snmpd.conf .... View systemview included. 1.3.6.1.2.1 #新建了一个viewview SYSTEMV Iew included. 1.3.6.1.2.1.1view SystemView included. 1.3.6.1.2.1.25.1.1 .... [Email protected] ~]# service snmpd start #启动snmpd服务

And then go back to nod1 and test the availability of NOD2 data through SNMP:

[[EMAIL&NBSP;PROTECTED]&NBSP;~]#&NBSP;&NBSP;SNMPNETSTAT&NBSP;-V&NBSP;2C&NBSP;-C&NBSP;PUBLIC&NBSP;-CAN&NBSP;-CP  tcp 192.168.0.202Active Internet  (TCP)  Connections  (including servers) Proto local address          remote address           (state) tcp   *.22                    *.*                     Listentcp   127.0.0.1.25           *.*                     listentcp   127.0.0.1.199          *.*                    listentcp    127.0.0.1.6010         *.*                    LISTENtcp    127.0.0.1.6011         *.*                    LISTENtcp    192.168.0.202.22       192.168.0.102.50742   establishedtcp    192.168.0.202.22       192.168.0.102.50761    established# has status information output, proving that nod1 and NOD2 can communicate via SNMP

Next on the cacti console to increase the monitoring of the NOD2, click "Devices", you can see the default cacti has built a device for this machine

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/0F/wKioL1WRBsKSMCHlAANyMsfoFZ4025.jpg "title=" 1.jpg " alt= "Wkiol1wrbsksmchlaanymsfofz4025.jpg"/> Here we click "Add" in the top right corner and then appear:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/12/wKiom1WRBRqhk7mMAAa5EDRDCMk272.jpg "title=" 1.jpg " alt= "Wkiom1wrbrqhk7mmaaa5edrdcmk272.jpg"/> The last click "Create", the creation of a monitoring device, and then build a graphics for this monitoring device, click on the top right corner of the "Create Graphs for This Host ", such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/0F/wKioL1WRBvzCKvpGAAUeD7dfbsA826.jpg "title=" 1.jpg " alt= "Wkiol1wrbvzckvpgaaued7dfbsa826.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/6F/12/ Wkiom1wrbvdxy5wfaaqndzoyggq877.jpg "title=" 1.jpg "alt=" Wkiom1wrbvdxy5wfaaqndzoyggq877.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/0F/wKioL1WRByry--pTAANu5-5jQR8446.jpg "title=" 1.jpg " alt= "Wkiol1wrbyry--ptaanu5-5jqr8446.jpg"/>

For example, select the graphic template we want to create a graph, the data query is divided into two categories, one is about the partition, a class is about the NIC interface, both are defined to obtain the data method, and finally click "Create" after the image is created.

Finally, the remote host organization in the graphics tree display, click "Graph Trees", and then click "Add", such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/12/wKiom1WRBYagQzxZAAIeK0x-Juk582.jpg "title=" 1.jpg " alt= "Wkiom1wrbyagqzxzaaiek0x-juk582.jpg"/> then enter a name for the graphics tree, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/0F/wKioL1WRB2KAUYtuAAKSmm93YW4548.jpg "title=" 1.jpg " alt= "Wkiol1wrb2kauytuaaksmm93yw4548.jpg"/> click "Create", a graph tree is generated, and then create the project on this graph tree, click "Add" in the graph tree, you can create a project:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/0F/wKioL1WRB3ySw7KnAAN9SNgTMus203.jpg "title=" 1.jpg " alt= "Wkiol1wrb3ysw7knaan9sngtmus203.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/6F/0F/ Wkiol1wrb4-w8t-xaaqiv1nrtv8904.jpg "title=" 1.jpg "alt=" wkiol1wrb4-w8t-xaaqiv1nrtv8904.jpg "/> re-click on" Create " After that, jump to:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/12/wKiom1WRBeeRRiTwAAOvijk8-Ss990.jpg "title=" 1.jpg " alt= "Wkiom1wrbeerritwaaovijk8-ss990.jpg"/>

Then click "Save" to save the graph tree we created.

To see our monitoring image of the remote host, we can click on the "graphs" on the homepage to see the graph tree, one is the default graphics tree, there is a local host monitoring graphics, the other is our own definition, as long as a few days, the graph will have data generated, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/0F/wKioL1WRB8KS97iXAAW2MSeYGOM136.jpg "title=" 1.jpg " alt= "Wkiol1wrb8ks97ixaaw2mseygom136.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M01/6F/12/ Wkiom1wrbhqiiiybaamkywo6nq0559.jpg "title=" 1.jpg "alt=" wkiom1wrbhqiiiybaamkywo6nq0559.jpg "/>650) this.width= 650; "Src=" http://s3.51cto.com/wyfs02/M02/6F/12/wKiom1WRBjTjCL44AAMAQfhDqio247.jpg "title=" 1.jpg "alt=" Wkiom1wrbjtjcl44aamaqfhdqio247.jpg "/>650) this.width=650;" Src= "http://s3.51cto.com/wyfs02/M00/6F/0F/ Wkiol1wrcaiytz82aamoknb0w7i044.jpg "title=" 1.jpg "alt=" Wkiol1wrcaiytz82aamoknb0w7i044.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/0F/wKioL1WRCBzR-3h2AAJK4IpwY4I357.jpg "title=" 1.jpg " alt= "Wkiol1wrcbzr-3h2aajk4ipwy4i357.jpg"/>

This host template can monitor a number of projects, the bottom of the fancy is the second page.

All right, here we go. We have completed the introduction of the cacti template, and illustrated how to import a template and use it on a remote host.

This article is from the "focus on operations, and Linux Dances" blog, please be sure to keep this source http://zhaochj.blog.51cto.com/368705/1669081

Cacti monitoring Tool data collection method, template introduction and use

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.