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

Michalis
Posts: 15
Joined: Mon Sep 17, 2007 1:05 am
Location: Nicosia, Cyprus

Query multiple SNMP OID's no index

Post by Michalis »

I have been reading any documentation i could find and searched the forums extensively but i am not sure if this is possible or not.
Basically i want to use an SNMP query with multiple OID's with no index.
An example of this is getting the memory information from SNMP informant.
Can i do this with the following query?
Note : I put the oid_index stuff to make the parsing work with cacti.

Code: Select all

<query> 
<name>Win32 - Memory Statistics</name> 
<description>Grab the memory statistics using SNMP-Informant</description> 
<oid_index>.1.3.6.1.4.1.9600.1.1.2</oid_index>
<index_order_type>oid</index_order_type> 

<fields> 
	<AvailableBytes> 
	<name>Available Bytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.1</oid>
	</AvailableBytes> 
	
	<AvailableMBytes> 
	<name>Available Megabytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.3</oid>
	</AvailableMBytes> 

</fields> 
</query>
If this is not the correct way to do it, whats the simplest way to do it without creating external scripts or anything? I like the structured way that is used for indexed queries and i want to use something similar.

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

Post by oxo-oxo »

Try it and post verbose query
Owen Brotherwood, JN Data A/S, Denmark.
Michalis
Posts: 15
Joined: Mon Sep 17, 2007 1:05 am
Location: Nicosia, Cyprus

Post by Michalis »

Hi oxo-oxo,

I have tried it.
The verbose query shows 0 items, 0 rows

Output is :

Code: Select all

+ Running data query [30].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'C:/apache/Apache2/htdocs/cacti/resource/snmp_queries/snmp_informant_standard_memory.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.1.2'
+ Found data query XML file at 'C:/apache/Apache2/htdocs/cacti/resource/snmp_queries/snmp_informant_standard_memory.xml'
+ Found data query XML file at 'C:/apache/Apache2/htdocs/cacti/resource/snmp_queries/snmp_informant_standard_memory.xml'
+ Found data query XML file at 'C:/apache/Apache2/htdocs/cacti/resource/snmp_queries/snmp_informant_standard_memory.xml'
No datasources are created.
Is this the correct approach to create a multiple OID query with no index?
User avatar
oxo-oxo
Cacti User
Posts: 126
Joined: Thu Aug 30, 2007 11:35 am
Location: Silkeborg, Denmark
Contact:

Post by oxo-oxo »

Post snmpwalk from command line of .1.3.6.1.4.1.9600.1.1.2
Owen Brotherwood, JN Data A/S, Denmark.
Michalis
Posts: 15
Joined: Mon Sep 17, 2007 1:05 am
Location: Nicosia, Cyprus

Post by Michalis »

Code: Select all

SNMPv2-SMI::enterprises.9600.1.1.2.1.0 = Gauge32: 205901824
SNMPv2-SMI::enterprises.9600.1.1.2.2.0 = Gauge32: 201076
SNMPv2-SMI::enterprises.9600.1.1.2.3.0 = Gauge32: 196
SNMPv2-SMI::enterprises.9600.1.1.2.4.0 = Gauge32: 1593229312
SNMPv2-SMI::enterprises.9600.1.1.2.5.0 = Gauge32: 453611520
SNMPv2-SMI::enterprises.9600.1.1.2.6.0 = Gauge32: 532684800
SNMPv2-SMI::enterprises.9600.1.1.2.7.0 = Gauge32: 9
SNMPv2-SMI::enterprises.9600.1.1.2.8.0 = Gauge32: 0
SNMPv2-SMI::enterprises.9600.1.1.2.9.0 = Gauge32: 0
SNMPv2-SMI::enterprises.9600.1.1.2.10.0 = Gauge32: 0
SNMPv2-SMI::enterprises.9600.1.1.2.11.0 = Gauge32: 33914880
SNMPv2-SMI::enterprises.9600.1.1.2.12.0 = Gauge32: 26783744
SNMPv2-SMI::enterprises.9600.1.1.2.13.0 = Gauge32: 16060416
SNMPv2-SMI::enterprises.9600.1.1.2.14.0 = Gauge32: 435466240
SNMPv2-SMI::enterprises.9600.1.1.2.15.0 = Gauge32: 8192
SNMPv2-SMI::enterprises.9600.1.1.2.16.0 = Gauge32: 1343488
SNMPv2-SMI::enterprises.9600.1.1.2.17.0 = Gauge32: 2076672
SNMPv2-SMI::enterprises.9600.1.1.2.18.0 = Gauge32: 2236416
User avatar
oxo-oxo
Cacti User
Posts: 126
Joined: Thu Aug 30, 2007 11:35 am
Location: Silkeborg, Denmark
Contact:

Post by oxo-oxo »

So maybe something like this ...:

Code: Select all

<oid_index>.1.3.6.1.4.1.9600.1.1.2.1</oid_index>
The trailing 0 gets turned to Index 1 in the code ...
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 »

Data Queries "Require" an index. You should instead create a multiple DS Data Template the have each tab in the Data Template have it's own OID.

That way 1 RRD file, multiple OID's and still using snmp.

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?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

TheWitness wrote:You should instead create a multiple DS Data Template the have each tab in the Data Template have it's own OID.
Unless something has changed in the past several versions, I thought a DS data template could only do one OID. At least in the past when I've tried to use multiple OID's for a DS template, it only saved one...
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well, I thought the same until I saw someone doing it :)

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 have tried the multiple DS approach per data template in the past but on each DS tab the same OID was showing which lead me to believe that I cannot put multiple DS on a data template. Is there a trick to making this work?

Is there a specific version that this feature was implemented?
I am using cacti-0.8.6j
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well don't I feel stupid. Well it should :oops:

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 »

OK i think i have figured it out, i am currently graphing the memory information of a server running SNMP informant.
I dont think the memory info has an SNMP index but the following query works and gives me all the memory related information in one RRD which then i can create graphs from.
This is the SNMP query i am using. Note that this is an indexed query.

Code: Select all

<query> 
<name>Win32 - Memory Statistics</name> 
<description>Grab the memory statistics using SNMP-Informant</description> 
<oid_index>.1.3.6.1.4.1.9600.1.1.2</oid_index>
<index_order_type>oid</index_order_type> 

<fields> 
	<memory> 
	<name>Counter Type</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>input</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2</oid>
	</memory>
	
	<AvailableBytes> 
	<name>Available Bytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.1</oid>
	</AvailableBytes> 
	
	<AvailableMBytes> 
	<name>Available Megabytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.3</oid>
	</AvailableMBytes> 

	<CommitedBytes> 
	<name>Commited Bytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.4</oid>
	</CommitedBytes> 

	<CacheBytes> 
	<name>Cache Bytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.5</oid>
	</CacheBytes> 
	
	<PageFaultspersec> 
	<name>Page faults per sec</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.7</oid>
	</PageFaultspersec> 	
	
	<PagesInputPerSec> 
	<name>Page inputs per sec</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.8</oid>
	</PagesInputPerSec>	
	
	<PagesOutputPerSec> 
	<name>Page outputs per sec</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.9</oid>
	</PagesOutputPerSec>	
	
	<PagesPerSec> 
	<name>Pages per sec</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.10</oid>
	</PagesPerSec>	

	<PoolPagedBytes> 
	<name>Pool paged bytes</name> 
	<method>walk</method> 
	<source>value</source> 
	<direction>output</direction> 
	<oid>.1.3.6.1.4.1.9600.1.1.2.12</oid>
	</PoolPagedBytes>	

</fields> 
</query>
I guess that this approach shouldn't have worked because there is no SNMP index as such but by using the memory OID as input i can get the information that i need.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Right, you get a data query with one line ;) That works for now...

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 »

Well, what about the much fabled mutli-DS data template?
Is this beast at all possible?
I've seen a post in the forum that it shouldn't be allowed for some reason or another.

Still cant figure out a way to do it, all DS tabs share the same OID

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

Post by TheWitness »

Yea, I'm going to look at it. But the next release of Cacti is feature frozen at the moment, so it won't be out for a while, and it would be an awfull coplicated and risky patch. So, the DQ method may be the best way to go for now.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests