SNMP newbie: data query without index

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

Moderators: Developers, Moderators

Post Reply
sejtam
Posts: 27
Joined: Wed Feb 23, 2005 10:11 pm

SNMP newbie: data query without index

Post by sejtam »

I have so far used cacti only with the preloaded definitions and several script data input methods. I am now getting ready to monitor a new device for which I just got the MIBS and am running into some
issues.

First question:

I have a set of OIDs which are returned non-indexed (the index
is a type defined as a TEXTUAL-CONVENTION in the MIB).

# snmpwalk ... -On ...
.1.3.6.1.4.1.n.4.5.1.4.1.1.2.1.1.0.1 = Counter64: 7288
.1.3.6.1.4.1.n.4.5.1.4.1.1.2.1.1.0.2 = Counter64: 5166
.1.3.6.1.4.1.n.4.5.1.4.1.1.2.1.1.0.6 = Counter64: 5168
.1.3.6.1.4.1.n.4.5.1.4.2.1.2.1.1.0.1 = Counter64: 10333
.1.3.6.1.4.1.n.4.5.1.4.2.1.2.1.1.0.6 = Counter64: 7289

Each of these represent a counter for a certain given type, the types
are themselves defined in the MIB as a TEXTUAL-CONVENTION (SYNTAX INTEGER).

Some values/types may not be returned if they haven't been used.

I found that I can set up a separate data template (Get SNMP Data)
and then a seperate data source for each variable. This seems wasteful,
esp as a apparently as eparate snmpget needs to get sent for each of these?


Can I combine these into some XML specifying the individual fields like in a table but w/o an index and thus grab all of them in one snmp operation and store them in a singel data source?

(I am referring to http://forums.cacti.net/about11647.html)

Is there any way I can load the MIB into cacti so it can learn the type/integer association and use the typename in labels etc?

Where is the XML format and the valid parameters defined anyway (ie, valid values for index_order_type, method, source etc?)

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

Post by gandalf »

You may want to look at Script Data Queries. I've not yet done a HowTo for this. But you'll find help in cacti's online manual for that
Reinhard
sejtam
Posts: 27
Joined: Wed Feb 23, 2005 10:11 pm

Post by sejtam »

lvm wrote:You may want to look at Script Data Queries. I've not yet done a HowTo for this. But you'll find help in cacti's online manual for that
Reinhard
Thanks. I gather this means that I'd have to install Net-SNMP on the cacti server (along with the MIBs) and the script would execute an snmpwalk or such to get at the data (rather than using the single OID method)?
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Script Query example

Post by kwabbernoot »

Sejtam,

I am currently working on a script query to process SAN Fiber Channel information from a MDS9020 Cisco router.

The SNMP information there is sometimes stored as Hex values. I created a data query script that treats these hex values and returns decimals to cacti.
Another point is that the snmp oids are device dependant, the oid value is not the same on every device. Also this is treated by the script.

I am only providing the scripts, this is due to the fact that Cacti config of the Data query is not yet completely finished. but I hope that these scripts can help you out.

I also provided the scripts and xml file for retrieving Compaq server temperatures using snmp. Here the scripts handle the fact that the oid has additional chars when an snmpget should occur. I solved this by using 2 arrays (one for query/index and one for get)

attached are 2 zip files:
- fc-ports.zip -> for the SAN data query
- compaq_temp.zip -> for compaq temperature

The scripts are written in PHP

Hope this helps,
kwabbernoot
Attachments
compaq_temp.zip
(1.28 KiB) Downloaded 107 times
fc-ports.zip
(1.98 KiB) Downloaded 103 times
sejtam
Posts: 27
Joined: Wed Feb 23, 2005 10:11 pm

Re: Script Query example

Post by sejtam »

kwabbernoot wrote:Sejtam,
- fc-ports.zip -> for the SAN data query
- compaq_temp.zip -> for compaq temperature
Thanks, I appreciate it. Will check them out.

Terimah Kasih
sejtam
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests