Index data to one graph

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
VladimirX
Posts: 8
Joined: Thu Aug 23, 2007 2:44 am

Index data to one graph

Post by VladimirX »

Hi, guys!

I am newcomer in Cacti world and I have several questions about using this staff. One of them is about indexed queries. I want to monitor temperature parameters (for example) for Cisco devices. But different types of devices have different number and types of sensors. As I undestand after reading different howtos using templates and data queries I can get separate graphs for separate rows of the table. But what if I want to retrieve index information for several rows and plot it on ONE graph? For example, I want to get the graph for 3750 which has 2 sensors where both two lines for Sensor 1 and Sensor 2 would be on one image.

Code: Select all

For Cisco 3750
 ciscoEnvMonTemperatureStatusDescr ciscoEnvMonTemperatureStatusValue ciscoEnvMonTemperatureThreshold ciscoEnvMonTemperatureLastShutdown ciscoEnvMonTemperatureState
            SW#1, Sensor#1, GREEN                 42 degrees Celsius              59 degrees Celsius                  0 degrees Celsius                      normal
            SW#2, Sensor#1, GREEN                 43 degrees Celsius              59 degrees Celsius                  0 degrees Celsius                      normal
tksmon:~/scripts #
Or for Cisco 3945 which has 8 sensors I want to have one grapch whith 8 lines in it

Code: Select all

tksmon:~/scripts # snmptable -v 2c -c public 10.0.0.1 .1.3.6.1.4.1.9.9.13.1.3
SNMP table: CISCO-ENVMON-MIB::ciscoEnvMonTemperatureStatusTable

 ciscoEnvMonTemperatureStatusDescr ciscoEnvMonTemperatureStatusValue ciscoEnvMonTemperatureThreshold ciscoEnvMonTemperatureLastShutdown ciscoEnvMonTemperatureState
                               CPU                44 degrees Celsius             115 degrees Celsius                  0 degrees Celsius                      normal
                       Intake Left                19 degrees Celsius              57 degrees Celsius                  0 degrees Celsius                      normal
                      Intake Right                16 degrees Celsius              57 degrees Celsius                  0 degrees Celsius                      normal
                     Exhaust Right                17 degrees Celsius              75 degrees Celsius                  0 degrees Celsius                      normal
                      Exhaust Left                19 degrees Celsius              75 degrees Celsius                  0 degrees Celsius                      normal
                    Power Supply 1                19 degrees Celsius              80 degrees Celsius                  0 degrees Celsius                      normal
                    Power Supply 2                21 degrees Celsius              80 degrees Celsius                  0 degrees Celsius                      normal
                       12V voltage             24935 degrees Celsius           26990 degrees Celsius                  0 degrees Celsius                      normal
Graph should have legends from ciscoEnvMonTemperatureStatusDescr column, lines from ciscoEnvMonTemperatureStatusValue column and maybe CDEF from ciscoEnvMonTemperatureThreshold column.

Is it possible to do that?

Thank you!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Index data to one graph

Post by BSOD2600 »

yes, this is possible.

Have you searched the script forum and/or template repository (http://docs.cacti.net/templates)? Most likely someone else has already created sensor Data Query templates for Cisco, which you can then modify and adapt to your hardware. If not, there are docs (http://docs.cacti.net/wiki:documentation) with guides on how to build the templates from scratch.... or hire a developer (like me ;) ) to do the work for you.
VladimirX
Posts: 8
Joined: Thu Aug 23, 2007 2:44 am

Re: Index data to one graph

Post by VladimirX »

Thank you for reply!

After reading HOWTO: Using Data Queries and Data Input Methods and "SNMP Data Queries" chapter in documentation for 0.8.8 I could not get positive results. I'd like to hire you but I need to understand how the cacti works. So I want to solve the problem by myself (of course with the hope of your help:))

So, what did I do and what could I reach?

I have one test router with several interfaces which I configured for SNMP. The router successfully answer to my requests

Code: Select all

sles11:/srv/www/htdocs/cacti/rra # snmpwalk  -v 2c -c public 192.168.1.211 ifDescr
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
IF-MIB::ifDescr.2 = STRING: FastEthernet1/0
IF-MIB::ifDescr.3 = STRING: FastEthernet1/1
IF-MIB::ifDescr.5 = STRING: Null0
IF-MIB::ifDescr.6 = STRING: Loopback0
sles11:/srv/www/htdocs/cacti/rra #
I want to plot the graph (ONE graph) for number of input unicast packets for two interfaces fa0/0 and fa 1/0.
I created the xml file for query ifInUcastPkts:

Code: Select all

<query>
        <name>Get Input Unicast Packets</name>
        <description>Queries a host for a list of interfaces and returns number of input unicat packets</description>
        <oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
        <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
        <index_order>ifDescr:ifIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <ifIndex>
                        <name>Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.2.2.1.1</oid>
                </ifIndex>
                <ifDescr>
                        <name>Name</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.2.2.1.2</oid>
                </ifDescr>
                <ifInUcastPkts>
                        <name>UnicastsIn</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.2.1.2.2.1.11</oid>
                </ifInUcastPkts>
        </fields>
</query>
Then I configured data query, graph and data templates using steps which are covered in howto. After applying data query to device I've got successful result of checking data query and reading input data from xml
Image
Each data source for each interface. So after that I had several rrd files were created (one for each interface)
Image

Returning back to scheme "Retreiving -> Storing -> Presenting" scheme which mentioned in howto I suggest that at this stage Storing is finished. I have several rrds two of which I need. So I need somehow aggregate two rrds in one graph statement. But to my regret I couldn't find such option. All graphs were created separate: one graph for one row in snmptable, i.e. one graph for one interface.
Image

All howtos and docs describe situation where I have several output values (several columns) and plot these values one one graph assuming that for next row in the table there will other graph.

How can I aggregate several rrds created in result of snmp data query to one rrd graph?

Maybe I am not very clear in my explanations, so sorry about that (i know english badly)

P.S. I analyzed several templates from repository and recognized that the task is solved in the way of creating separate data inputs with separate snmp oids, aggregating them together in data template and using after graph template. So using this way we just escape of applying snmp data query at all.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Index data to one graph

Post by BSOD2600 »

1) You do realize Cacti comes with an interface template out of the box, right? [SNMP - Interface Statistics], no need to reinvent it unless you're doing so for learning...

2) Yes, a Graph template can aggregate multiple data sources/rrd files so they're all displayed together.
VladimirX
Posts: 8
Joined: Thu Aug 23, 2007 2:44 am

Re: Index data to one graph

Post by VladimirX »

I use interface statistics just for example. I definitely know that there is existing template. I want to know how to use snmptable output for plot separate rows on one graph. It's not important is it interface statistics table, temperature table or something other. Trying to solve this task I decided to not create data query for temperature but try to play with existing data query for interfaces.
I didn't find a way to plot graph for several interfaces on one graph even with existing graph templates.
For instance let's talk about task where we want to obtain a graph showing input rate in bits per seconds for Fa0/0 and Fa0/1.
Of course I successfully solve this task with separate two graphs.

If you know how to solve this problem please show me a way.

Recently I've read about aggregate plugin. Is it useful for my task? Can I get result without it?

Thank you.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Index data to one graph

Post by BSOD2600 »

VladimirX wrote:Recently I've read about aggregate plugin. Is it useful for my task? Can I get result without it?
Yes. Two options
1) create a new graph template with placeholders for 4 data sources (2 in, 2 out). then you assign the graph to a host and manually set the 4 data sources for Fa0/0 and Fa0/1.
2) use aggregate to automate the steps I described in #1 with a few clicks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest