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
SNMP newbie: data query without index
Moderators: Developers, Moderators
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)?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
- kwabbernoot
- Cacti User
- Posts: 99
- Joined: Mon Oct 13, 2003 4:11 am
- Location: Zottegem, Belgium
Script Query example
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
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
Re: Script Query example
Thanks, I appreciate it. Will check them out.kwabbernoot wrote:Sejtam,
- fc-ports.zip -> for the SAN data query
- compaq_temp.zip -> for compaq temperature
Terimah Kasih
sejtam
Who is online
Users browsing this forum: No registered users and 0 guests