2 dimensional indexes

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
thardie
Posts: 4
Joined: Fri May 21, 2010 12:28 pm

2 dimensional indexes

Post by thardie »

[Edit: Apologies - This appears to have been posted in the wrong forum]

Hi,

I've read all the threads I could find on here (and there's a lot) on how to do 2 or multi dimensional indexes. I've tried every variation I can think of, but cannot get data out the other end.

Here's my walk:


IPTABLES-MIB::agentVersion = STRING: "0.1"
IPTABLES-MIB::iptablesVersion = STRING: "1.3.3"
IPTABLES-MIB::tableIndex.0 = INTEGER: 0
IPTABLES-MIB::tableIndex.1 = INTEGER: 1
IPTABLES-MIB::tableIndex.2 = INTEGER: 2
IPTABLES-MIB::tableName.0 = STRING: "nat"
IPTABLES-MIB::tableName.1 = STRING: "mangle"
IPTABLES-MIB::tableName.2 = STRING: "filter"
IPTABLES-MIB::ruleIndex.2.0.0 = INTEGER: 0
IPTABLES-MIB::ruleIndex.2.0.1 = INTEGER: 1
IPTABLES-MIB::chainIndexR.2.0.0 = INTEGER: 0
IPTABLES-MIB::chainIndexR.2.0.1 = INTEGER: 0
IPTABLES-MIB::tableIndexR.2.0.0 = INTEGER: 2
IPTABLES-MIB::tableIndexR.2.0.1 = INTEGER: 2
IPTABLES-MIB::chainNameR.2.0.0 = STRING: "INPUT"
IPTABLES-MIB::chainNameR.2.0.1 = STRING: "INPUT"
IPTABLES-MIB::chainTableNameR.2.0.0 = STRING: "filter"
IPTABLES-MIB::chainTableNameR.2.0.1 = STRING: "filter"
IPTABLES-MIB::ruleOctets.2.0.0 = Counter64: 21302517890
IPTABLES-MIB::ruleOctets.2.0.1 = Counter64: 0
IPTABLES-MIB::rulePackets.2.0.0 = Counter64: 4259219
IPTABLES-MIB::rulePackets.2.0.1 = Counter64: 0
IPTABLES-MIB::chainRule.2.0.0 = STRING: ";p=6;j=Port8080"
IPTABLES-MIB::chainRule.2.0.1 = STRING: ";p=6;j=Port8181"
IPTABLES-MIB::sourceIP.2.0.0 = IpAddress: 0.0.0.0
IPTABLES-MIB::sourceIP.2.0.1 = IpAddress: 0.0.0.0
IPTABLES-MIB::sourceMask.2.0.0 = IpAddress: 0.0.0.0
IPTABLES-MIB::sourceMask.2.0.1 = IpAddress: 0.0.0.0
IPTABLES-MIB::destinationIP.2.0.0 = IpAddress: 0.0.0.0
IPTABLES-MIB::destinationIP.2.0.1 = IpAddress: 0.0.0.0
IPTABLES-MIB::destinationMask.2.0.0 = IpAddress: 0.0.0.0
IPTABLES-MIB::destinationMask.2.0.1 = IpAddress: 0.0.0.0

And in OIDs:

.1.3.6.1.4.1.12806.6.1.1.0.1 = STRING: "0.1"
.1.3.6.1.4.1.12806.6.1.1.0.2 = STRING: "1.3.3"
.1.3.6.1.4.1.12806.6.1.1.1.1.1.0 = INTEGER: 0
.1.3.6.1.4.1.12806.6.1.1.1.1.1.1 = INTEGER: 1
.1.3.6.1.4.1.12806.6.1.1.1.1.1.2 = INTEGER: 2
.1.3.6.1.4.1.12806.6.1.1.1.1.2.0 = STRING: "nat"
.1.3.6.1.4.1.12806.6.1.1.1.1.2.1 = STRING: "mangle"
.1.3.6.1.4.1.12806.6.1.1.1.1.2.2 = STRING: "filter"
.1.3.6.1.4.1.12806.6.1.1.3.1.1.2.0.0 = INTEGER: 0
.1.3.6.1.4.1.12806.6.1.1.3.1.1.2.0.1 = INTEGER: 1
.1.3.6.1.4.1.12806.6.1.1.3.1.2.2.0.0 = INTEGER: 0
.1.3.6.1.4.1.12806.6.1.1.3.1.2.2.0.1 = INTEGER: 0
.1.3.6.1.4.1.12806.6.1.1.3.1.3.2.0.0 = INTEGER: 2
.1.3.6.1.4.1.12806.6.1.1.3.1.3.2.0.1 = INTEGER: 2
.1.3.6.1.4.1.12806.6.1.1.3.1.4.2.0.0 = STRING: "INPUT"
.1.3.6.1.4.1.12806.6.1.1.3.1.4.2.0.1 = STRING: "INPUT"
.1.3.6.1.4.1.12806.6.1.1.3.1.5.2.0.0 = STRING: "filter"
.1.3.6.1.4.1.12806.6.1.1.3.1.5.2.0.1 = STRING: "filter"
.1.3.6.1.4.1.12806.6.1.1.3.1.6.2.0.0 = Counter64: 21532164123
.1.3.6.1.4.1.12806.6.1.1.3.1.6.2.0.1 = Counter64: 0
.1.3.6.1.4.1.12806.6.1.1.3.1.7.2.0.0 = Counter64: 4303797
.1.3.6.1.4.1.12806.6.1.1.3.1.7.2.0.1 = Counter64: 0
.1.3.6.1.4.1.12806.6.1.1.3.1.8.2.0.0 = STRING: ";p=6;j=Port8080"
.1.3.6.1.4.1.12806.6.1.1.3.1.8.2.0.1 = STRING: ";p=6;j=Port8181"
.1.3.6.1.4.1.12806.6.1.1.3.1.9.2.0.0 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.9.2.0.1 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.10.2.0.0 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.10.2.0.1 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.11.2.0.0 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.11.2.0.1 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.12.2.0.0 = IpAddress: 0.0.0.0
.1.3.6.1.4.1.12806.6.1.1.3.1.12.2.0.1 = IpAddress: 0.0.0.0

As you can see, my 2 dimensions are "tableName" and "rule" - How do I parse this?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) moving forums.

2) I don't think its going to be possible to combine those two with standard a snmp xml script, since they don't share remotely the same OID suffix. You'll have to write a php script server script instead and manually combine them in your query. All of the rule stuff (x.2.0.0 etc) stuff would be simple to graph with an xml snmp template though.
thardie
Posts: 4
Joined: Fri May 21, 2010 12:28 pm

Post by thardie »

BSOD2600 wrote:1) moving forums.

2) I don't think its going to be possible to combine those two with standard a snmp xml script, since they don't share remotely the same OID suffix. You'll have to write a php script server script instead and manually combine them in your query. All of the rule stuff (x.2.0.0 etc) stuff would be simple to graph with an xml snmp template though.
Thanks. It's nice to know I wasn't just being dumb :)

Unfortunately, it's not always x.2.0.0. Sometimes it's x.0.0.0 or x.1.0.0, depending on how many tables there are... Any suggestions for this, even if I fold all the tables into a flat space, that would be fine.
dionvdc
Posts: 46
Joined: Tue Feb 16, 2010 3:54 pm

Post by dionvdc »

Perhaps you could do without the tablename, what purpose does it has in your setup?
Did you try to parse on 26th character (if i'm not mistaking making the index everything beyond .1.3.6.1.4.1.12806.6.1.1.).
I did one once, albeit simpler, and eventually got it running using info from http://docs.cacti.net/howto:data_query_ ... s_a_string downwards.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

thardie wrote:Unfortunately, it's not always x.2.0.0. Sometimes it's x.0.0.0 or x.1.0.0, depending on how many tables there are...
That's fine. snmp xml script can handle a regex to split off the last 3 OID number suffixes and use those as the unique index number for stuff. Details on getting started in the doc site.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests