[HOWTO] Using Data Queries and Data Input Methods

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This is due to the way rrdtool works (see main rrd site at http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html, Section: Data Resampling. You may find http://www.vandenbogaerdt.nl/rrdtool/process.php useful, too). Not all updates occur at exactly a 300 sec interval. So rrdtool provides a way dealing with those slight deviations and back-calculating them to exactly 300 sec. On COUNTERS, you will as well see the result of normalizing from 300 sec (data gathering interval) to 1 sec (so: division by 300 which will change integers to non-integers).
You may use the GPRINT Preset "Exact Numbers" in your Graph Template to suppress decimals.
Reinhard
Sandhya
Posts: 2
Joined: Fri Mar 07, 2008 2:08 am

Blank graph - trying to add Squid SNMP OIDs to CACTI

Post by Sandhya »

Hi
I have recently started using CACTI to monitor squid server.
I followed the above mentioned steps , created my own xml file

<interface>
<name>Get Squid Cache Network</name>
<description>Queries Squid SNMPserver </description>
<oid_index>1.3.6.1.4.1.3495.1.4.1.7</oid_index>
<oid_num_indexes>1.3.6.1.4.1.3495.1.4.1.0</oid_num_indexes>

<fields>
<cacheBlockingGetHostByName>
<name>cacheBlocking</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>1.3.6.1.4.1.3495.1.4.1.7</oid>
</cacheBlockingGetHostByName>
<cacheIpHits>
<name>cache hits </name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>1.3.6.1.4.1.3495.1.4.1.3</oid>
</cacheIpHits>
<cacheIpMisses>
<name>cache Miss </name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>1.3.6.1.4.1.3495.1.4.1.6</oid>
</cacheIpMisses>
</fields>
</interface>

The Debug query information shows

+ Running data query [14].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/testsquid.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '1.3.6.1.4.1.3495.1.4.1.7'
+ Located input field 'cacheBlockingGetHostByName' [walk]
+ Executing SNMP walk for data @ '1.3.6.1.4.1.3495.1.4.1.7'
+ Found item [cacheBlockingGetHostByName='0'] index: 0 [from value]
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/testsquid.xml'
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/testsquid.xml'
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/testsquid.xml'
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/testsquid.xml'

However , my graphs are empty!! I have included cacheIpHits and cacheIpMisses as datasources for my graph.
Also i created the .rrd file for the graph manually using "rrdtool create" since it gave an error .

Could anyone plz let me know, why am I not getting any plots on my graph? what am I missing out??
Also ,manual snmpwalk for cacheIpHits and cacheIpMisses returns valid values.

Any help regarding this is deeply appreciated.
Thanx!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Squid usually listens on a non-standard snmp port
Reinhard
Sandhya
Posts: 2
Joined: Fri Mar 07, 2008 2:08 am

Post by Sandhya »

Hi
Yes, Squid normally listens for incoming SNMP requests on port 3401.
When I do a snmpwalk on port 3401 for a particular SNMP OID , i get the correct values.

But there is no output on the graphs !!

Plz help. Could there be some issue with some settings in CACTI ??
melcon
Posts: 2
Joined: Wed Apr 09, 2008 2:47 pm
Contact:

Get SNMP Data

Post by melcon »

How can I get a SNMP Data from an OID that returns 2 fields, like in:

snmpwalk -On -v1 -ccommunity host UCD-SNMP-MIB::extOutput

...
.1.3.6.1.4.1.2021.8.1.101.4 = STRING: Duration:105 count:8
...

Is my DIM correct(see attachment)?
Attachments
Data Input Method with 2 output fields
Data Input Method with 2 output fields
cacti_dim.png (46.52 KiB) Viewed 25508 times
mgriffin
Posts: 5
Joined: Thu Jun 05, 2008 8:59 am

Post by mgriffin »

The images on the main HOWTO have broken. Is there any way to get an update to this guide for 0.8.7b?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mgriffin wrote:The images on the main HOWTO have broken. Is there any way to get an update to this guide for 0.8.7b?
Yep. Use the HowTo at http://docs.cacti.net. This thread is no longer maintained
Reinhard
devel
Posts: 19
Joined: Wed Sep 17, 2008 6:18 am

Post by devel »

I have a question about Data Input Methods->InputType.
I can't find description for "SNMP Query" anywhere. I was supposed to find there a possibility to build a list of name:oid values instead of writing own script.... but it seems servers different needs. What are they ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please refer to the 1st link of my sig for complete walkthroughs. IF your question is still valid, please post again, but create a new topic because this thread is closed
Reinhard
kruz
Posts: 23
Joined: Tue Sep 19, 2006 2:19 pm

Post by kruz »

Pics? (the cacti documentation is great, but I loved this walkthrough)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

All has been moved to http://docs.cacti.net/manual:087:3_templates#templates and following
Reinhard
great__F
Posts: 43
Joined: Mon May 17, 2010 2:41 am

Re: [HOWTO] Using Data Queries and Data Input Methods

Post by great__F »

Helloo together,

My question is, is there a maximum threshold for the number of Letters which give the query return?

exemple I want use

|query_FarmServer|

And the result is not the hole Name of the FarmServer its just 14 Letters.

thanks for reply
ricardobarbosams
Posts: 1
Joined: Mon Nov 25, 2013 9:05 am

Re: [HOWTO] Using Data Queries and Data Input Methods

Post by ricardobarbosams »

Hi all

I create the file xml with content

<interface>
<name>Get GEPON Interfaces Statistics</name>
<description>Queries a statistics for interfaces CNI e PON in plataform GEPON Furukawa FKC16</description>
<oid_index>.1.3.6.1.4.1.10428.8.1.1.9.1.2.1.1</oid_index>
<index_order>fkc16OltInformationIndex</index_order>
<oid_num_indexes>.1.3.6.1.4.1.10428.8.1.1.9.1.1.0</oid_num_indexes>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>

<fields>
<fkc16OltInformationIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.10428.8.1.1.9.1.2.1.1</oid>
</fkc16OltInformationIndex>
</fields>
</interface>


Via gui of cacti using verbose query its display
+ Running data query [14].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/gepon.xml'
+ XML file parsed ok.
+ Executing SNMP get for num of indexes @ '.1.3.6.1.4.1.10428.8.1.1.9.1.1.0' Index Count: 3
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.10428.8.1.1.9.1.2.1.1' Index Count: 0
+ No SNMP data returned

Its test via line command.

root@apolo:/usr/share/cacti/resource/snmp_queries# snmpget -c public -v 1 172.16.30.11 .1.3.6.1.4.1.10428.8.1.1.9.1.1.0
iso.3.6.1.4.1.10428.8.1.1.9.1.1.0 = INTEGER: 3
root@apolo:/usr/share/cacti/resource/snmp_queries# snmpwalk -c public -v 1 172.16.30.11 .1.3.6.1.4.1.10428.8.1.1.9.1.2.1.1
iso.3.6.1.4.1.10428.8.1.1.9.1.2.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.10428.8.1.1.9.1.2.1.1.2 = INTEGER: 2
iso.3.6.1.4.1.10428.8.1.1.9.1.2.1.1.3 = INTEGER: 3
root@apolo:/usr/share/cacti/resource/snmp_queries#

where am I wrong?

Regards
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests