Multiple Field Index

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

Moderators: Developers, Moderators

Post Reply
sribeiro
Posts: 2
Joined: Thu Dec 22, 2005 1:32 pm

Multiple Field Index

Post by sribeiro »

Cheers!

I’ve got this MIB I want to graph,
.1.3.6.1.4.1.9.9.84.1.1.1.1.3
cipPrecedenceSwitchedPkts from CISCO-IP-STAT-MIB.iso.org.dod.internet

It identifies the number of packets with a determined precedence and a direction.
So each interface has 16 rows under this MIB, so the interface 2:
.1.3.6.1.4.1.9.9.84.1.1.1.1.3.2
will have the direction IN(1) and OUT(2), defined by:
.1.3.6.1.4.1.9.9.84.1.1.1.1.3.2.1
and
.1.3.6.1.4.1.9.9.84.1.1.1.1.3.2.2
and, in this way each direction has 8 precedence types (0-7):
.1.3.6.1.4.1.9.9.84.1.1.1.1.3.2.1.0
. . .
.1.3.6.1.4.1.9.9.84.1.1.1.1.3.2.1.7
(for direction IN(1))

There are no other MIBs relevant to this like Indexes or so.
What I want to accomplish is to use the last 3 MIB levels to make the Index, so this is my solution.

Code: Select all

<interface>
        <name>Get SNMP Interfaces Precedence</name>
        <description>Queries a host for a list of monitorable cip precedence interfaces</description>
        <oid_index>.1.3.6.1.4.1.9.9.84.1.1.1.1.3</oid_index>
        <oid_index_parse>OID/REGEXP:.*\.([1-9][0-9]{0,1}\.[12]\.[0-7])$</oid_index_parse>
        <index_order>ifInterface</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <ifInterface>
                        <name>Interface</name>
                        <method>walk</method>
                        <source>index</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.9.9.84.1.1.1.1.3</oid>
                </ifInterface>
                <cipPreSwPkts>
                        <name>cipPrecedenceSwPkts</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.9.9.84.1.1.1.1.3</oid>
                </cipPreSwPkts>
        </fields>
</interface>
The regular expression filters the last 3 levels.
The problem is that it doesn’t work!
The XML is correctly parsed, but noting shows up at the Data Query.
Can anyone lend me a hand on this?

output code

Code: Select all

+ Running data query [14].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/home/cacti/www/resource/snmp_queries/interface_qos.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9.9.84.1.1.1.1.3'
+ Located input field 'ifInterface' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9.9.84.1.1.1.1.3'
+ Located input field 'cipPreSwPkts' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9.9.84.1.1.1.1.3'
+ Found item [cipPreSwPkts='6997895'] index: 3 [from value]
+ Found item [cipPreSwPkts='6704'] index: 3 [from value]
+ Found item [cipPreSwPkts='31925'] index: 3 [from value]
+ Found item [cipPreSwPkts='0'] index: 3 [from value]
+ Found item [cipPreSwPkts='4553'] index: 3 [from value]
+ Found item [cipPreSwPkts='0'] index: 3 [from value]
+ Found item [cipPreSwPkts='336283'] index: 3 [from value]
+ Found item [cipPreSwPkts='627458'] index: 3 [from value]
+ Found item [cipPreSwPkts='14633'] index: 3 [from value]
+ Found item [cipPreSwPkts='0'] index: 3 [from value]
+ Found item [cipPreSwPkts='1173'] index: 3 [from value]
. . .
+ Found item [cipPreSwPkts='2021354'] index: 43 [from value]
+ Found item [cipPreSwPkts='11513033'] index: 43 [from value]
+ Found data query XML file at '/home/cacti/www/resource/snmp_queries/interface_qos.xml'
+ Found data query XML file at '/home/cacti/www/resource/snmp_queries/interface_qos.xml'
+ Found data query XML file at '/home/cacti/www/resource/snmp_queries/interface_qos.xml'
Thank you
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Didn't you say there is not an Index for cipPrecedenceSwitchedPkts? If that's the case, that is why this xml template is not returning valid results (or is it?).

If it uses the same index numbers as the Interfaces, then you should be able to use:
<oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>

and use this instead:

Code: Select all

		<ifIndex>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.2.2.1.1</oid>
		</ifIndex>
Then the xml script will have the proper index numbers to base the results around...
sribeiro
Posts: 2
Joined: Thu Dec 22, 2005 1:32 pm

Post by sribeiro »

I’m parsing all the possible indexes from the walk done to this MIB

Code: Select all

<oid_index>.1.3.6.1.4.1.9.9.84.1.1.1.1.3</oid_index> 
<oid_index_parse>OID/REGEXP:.*\.([1-9][0-9]{0,1}\.[12]\.[0-7])$</oid_index_parse>
The indexes should be something like:

Code: Select all

1.1.0
1.1.1
. . .
1.1.7
1.2.0
. . .
1.2.7
2.1.0
. . .
Unless I’m wrong these should be used to index the MIB cipPreSwPkts and extract the correspondent values, has said in the SNMP Query XML Syntax from the Cacty Manual, by using:

Code: Select all

<source>index</source>
I still cant do it! Pay attention to the MIB, it does use the same index numbers as the Interfaces, but the MIB doesnt end there, it has more 2 values.
Sorry if this seems complicated, I'm just trying to make this work.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest