Writing SNMP Queries

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

Moderators: Developers, Moderators

Post Reply
Guest

Writing SNMP Queries

Post by Guest »

How can I query a range of SNMP OIDs in one data query. These aren't indexed but would like to be able to read all the values at once without having to create multiple data templates. I dont have any .pl etc ... experience so not sure where to start.

say for example is there a way to read them from something like this.

<oid-1>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.15.2</oid>
</oid-1>
<oid-2>
<name>Number</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.17.0</oid>
</oid-2>

If I do need a script could someone donate along with a kick in the right direction.

Cheers
renaatski
Posts: 24
Joined: Tue Apr 27, 2004 4:39 am

Post by renaatski »

God yes man, I asked that question before too!

Surely this must be possible! Imagine like having one XML per device-type (Netapp filer, Netapp cache, Win2K3, etc)

Would be so cool wouldn't it ..? so...

BUMP
Guest

Post by Guest »

That's cumbersome, but it seems to me that there is no other way to do this. Using some sort of SNMP query just does not work (because there is no index needed at all).
I'm just doing this "multiple data sources definition work" right now for UDP, TCP, ICMP and SNMP-related counters from the UDP-MIB, TCP-MIB and IP-MIB. Over 20 data source templates just to change the OID and the name... That's cumbersome indeed. :(
It would be nice in fact to have a "Get Multiple SNMP Data" data input method... with one OID per data source item. Maybe that would be a reasonable request, dunno.

PS: Of course, the ideal solution would be to integrate a MIB browser in the Cacti and select counters by name... :D
Rodolphe Ortalo
Posts: 5
Joined: Tue Aug 05, 2003 2:06 am

BTW, it was me...

Post by Rodolphe Ortalo »

:oops:
User avatar
golemb
Posts: 30
Joined: Mon Jun 02, 2003 12:47 pm

Post by golemb »

Yea, I was looking the exact same thing.
query a range of SNMP OIDs in one data query
User avatar
macan
Cacti Guru User
Posts: 1101
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re:

Post by macan »

golemb wrote:Yea, I was looking the exact same thing.
I have same problem. I need one data source with 2 or more OIDs and one graph (without aggregate plugin).
Without this "feature", I must create a lot of datasources with one OID :-(
Let the Cacti grow!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Writing SNMP Queries

Post by gandalf »

resources/*/*.xml is used for Data Query (== indexed data) only. Full stop.

For multiple data fetched "in one go", a script is the only solution. You may either perform an snmpget or a walk within that to fetch whatever you want and process that data if need be. Then, you may define a data template that defines multiple data source items.

Be warned: That's no a very flexible solution! E.g. in case you later need a single additional data source item, you will have to throw away all your rrd files related to that data query. RRDTool does not allow to add a new data source item to an existing rrd file!

So the recommended solution indeed is to better use a data template with a single data source item for that very approach. Of course, you may use the script stuff as described above.

Find more hints and walkthroughs at the 1st link of my sig
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests