Query multiple SNMP OID's no index

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

Moderators: Developers, Moderators

User avatar
oxo-oxo
Cacti User
Posts: 126
Joined: Thu Aug 30, 2007 11:35 am
Location: Silkeborg, Denmark
Contact:

Post by oxo-oxo »

Good it's working: I thought it was going to be an intresting thread (which is why I asked for more info to keep it alive).

While muli DS template magic was being discussed I was trying this non-indexed area:

Code: Select all

$ vi resource/snmp_queries/tcp.xml
<interface>
        <name>Get tcp Statistics</name>
        <oid_index>.1.3.6.1.2.1.6.1</oid_index>
        <index_order>tcpRtoAlgorithm</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <tcpRtoAlgorithm>
                        <name>Index</name>
                        <method>walk</method>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.6.1</oid>
                        <source>value</source>
                </tcpRtoAlgorithm>
                <tcpInSegs>
                        <name>tcpInSegs</name>
                        <method>walk</method>
                        <direction>output</direction>
                        <oid>.1.3.6.1.2.1.6.10</oid>
                        <source>value</source>
                </tcpInSegs>
                <tcpOutSegs>
                        <name>tcpOutSegs</name>
                        <method>walk</method>
                        <direction>output</direction>
                        <oid>.1.3.6.1.2.1.6.11</oid>
                        <source>value</source>
                </tcpOutSegs>
        </fields>
</interface>
Owen Brotherwood, JN Data A/S, Denmark.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Owen,

You do have that effect on people. Big time segway. ;)

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Michalis
Posts: 15
Joined: Mon Sep 17, 2007 1:05 am
Location: Nicosia, Cyprus

Post by Michalis »

Now, considering i have an indexed query that returns many rows and values.
How can i make cacti put all those data into a single datasource and a single RRD file?
Is this even possible with indexed queries?

Thanks
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Now I am confused. Do you want to SUM or AVG the data in all the rows? What is your intention?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Michalis
Posts: 15
Joined: Mon Sep 17, 2007 1:05 am
Location: Nicosia, Cyprus

Post by Michalis »

I want to run an SNMP query on an indexed OID.
Then i will get 5 different values on different OID's.
I want to put the different OID's in a single datasource so when i go to create graphs for a device and select a data query i dont have 5 distinct DS being created for a device.

For example i want to query the temperature of a server. The server has 5 sensors with each sensor having its OID.
I can run an indexed query at a specific OID and get the 5 values. When i run the query i get "5 Items 5 Rows" in Cacti which is expected. Then i can see all 5 sensors and can select one to graph for a device. However i dont want to have 5 datasources and 5 graphs per device. I want to have a single datasource with the 5 values and graph that.

This is the query i am using :

Code: Select all

<query>
	<name>Get Compaq Temps</name>
	<description>Queries a Compaq host for Temps and Thresholds (Health MIB)</description>
	<oid_index>.1.3.6.1.4.1.232.6.2.6.8.1.2</oid_index>
	<index_order_type>numeric</index_order_type> 	
	<fields>
		<cpqHeTempIndex>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.232.6.2.6.8.1.4.0</oid>
		</cpqHeTempIndex>
		<tempCPU1>
			<name>CPU1 Temperature</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.232.6.2.6.8.1.4.0.1</oid>
		</tempCPU1>
		<tempCPU2>
			<name>CPU2 Temperature</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.232.6.2.6.8.1.4.0.2</oid>
		</tempCPU2>
		<tempBoard>
			<name>Motherboard Temperature</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.232.6.2.6.8.1.4.0.4</oid>
		</tempBoard>		
		<tempPSU>
			<name>Powersupply Temperature</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.232.6.2.6.8.1.4.0.5</oid>
		</tempPSU>				
	</fields>
</query>
SNMP Walk .1.3.6.1.4.1.232.6.2.6.8.1.4.0 gives me these temperatures

Code: Select all

SNMPv2-SMI::enterprises.232.6.2.6.8.1.4.0.1 = INTEGER: 32
SNMPv2-SMI::enterprises.232.6.2.6.8.1.4.0.2 = INTEGER: 44
SNMPv2-SMI::enterprises.232.6.2.6.8.1.4.0.3 = INTEGER: 40
SNMPv2-SMI::enterprises.232.6.2.6.8.1.4.0.4 = INTEGER: 38
SNMPv2-SMI::enterprises.232.6.2.6.8.1.4.0.5 = INTEGER: 67
And SNMP walk the index .1.3.6.1.4.1.232.6.2.6.8.1.2 gives :

Code: Select all

SNMPv2-SMI::enterprises.232.6.2.6.8.1.2.0.1 = INTEGER: 1
SNMPv2-SMI::enterprises.232.6.2.6.8.1.2.0.2 = INTEGER: 2
SNMPv2-SMI::enterprises.232.6.2.6.8.1.2.0.3 = INTEGER: 3
SNMPv2-SMI::enterprises.232.6.2.6.8.1.2.0.4 = INTEGER: 4
SNMPv2-SMI::enterprises.232.6.2.6.8.1.2.0.5 = INTEGER: 5
I hope it makes some sense
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please check out the DAta Query "SNMP - Interface Statistics" and the Data Template for "Errors and Discards". That shows an example how to achieve your goal
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests