Multi-dimensional Tables - SNMP Data Query Walkthrough

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

Moderators: Developers, Moderators

Post Reply
stx73
Posts: 3
Joined: Wed Aug 08, 2012 11:19 am

Multi-dimensional Tables - SNMP Data Query Walkthrough

Post by stx73 »

Hi all, any advanced user who can help me out there?

From file TIMETRA-NAT-MIB.mib here's the definition of the tmnxNatIsaResrcStatsTable table:

Code: Select all

[size=85]tmnxNatIsaResrcStatsTable   OBJECT-TYPE
    SYNTAX      SEQUENCE OF TmnxNatIsaResrcStatsEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
       "..."
    ::= { tmnxNatIsaMdaStatObjs 4 }

tmnxNatIsaResrcStatsEntry   OBJECT-TYPE
    SYNTAX      TmnxNatIsaResrcStatsEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
       "..."
    INDEX { tmnxChassisIndex,
            tmnxCardSlotNum,
            tmnxMDASlotNum,
            tmnxNatIsaResrcStatsId }
    ::= { tmnxNatIsaResrcStatsTable 1 }

TmnxNatIsaResrcStatsEntry ::=
    SEQUENCE {
        tmnxNatIsaResrcStatsId           Unsigned32,
        tmnxNatIsaResrcStatsName         DisplayString,
        tmnxNatIsaResrcStatsValMax       CounterBasedGauge64,
        tmnxNatIsaResrcStatsValMaxLw     Gauge32,
        tmnxNatIsaResrcStatsValMaxHw     Gauge32,
        tmnxNatIsaResrcStatsVal          CounterBasedGauge64,
        tmnxNatIsaResrcStatsValLw        Gauge32,
        tmnxNatIsaResrcStatsValHw        Gauge32
    }

tmnxNatIsaResrcStatsVal OBJECT-TYPE
    SYNTAX      CounterBasedGauge64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
       "The value of the object tmnxNatIsaResrcStatsVal indicates
        the actual value of the resource statistics
        contained in this conceptual row."
    ::= { tmnxNatIsaResrcStatsEntry 6 }[/size]
As you can see the index is made of four values:

Code: Select all

[size=85]snmptranslate .1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1 -m ALL -M +/usr/share/snmp/mibs/TIMETRA -Tp -Td
+--tmnxNatIsaResrcStatsEntry(1)
   |  Index: tmnxChassisIndex, tmnxCardSlotNum, tmnxMDASlotNum, tmnxNatIsaResrcStatsId
   |
   +-- ---- Unsigned  tmnxNatIsaResrcStatsId(1)
   +-- -R-- String    tmnxNatIsaResrcStatsName(2)
   |        Textual Convention: DisplayString
   |        Size: 1..64
   +-- -R-- Counter64 tmnxNatIsaResrcStatsValMax(3)
   |        Textual Convention: CounterBasedGauge64
   +-- -R-- Gauge     tmnxNatIsaResrcStatsValMaxLw(4)
   +-- -R-- Gauge     tmnxNatIsaResrcStatsValMaxHw(5)
   +-- -R-- Counter64 tmnxNatIsaResrcStatsVal(6)
   |        Textual Convention: CounterBasedGauge64
   +-- -R-- Gauge     tmnxNatIsaResrcStatsValLw(7)
   +-- -R-- Gauge     tmnxNatIsaResrcStatsValHw(8)[/size]

Code: Select all

[size=85]snmptable -v 2c -c XXXXXXXX N.N.N.N -m ALL -M +/usr/share/snmp/mibs/TIMETRA TIMETRA-NAT-MIB::tmnxNatIsaResrcStatsTable -Cb -Ci
SNMP table: TIMETRA-NAT-MIB::tmnxNatIsaResrcStatsTable

   index                      Name      ValMax ValMaxLw ValMaxHw     Val ValLw ValHw
 1.1.2.0                     Flows     6291456        0        0      23     0     0
 1.1.2.1                  Policies         256        0        0       1     0     0
 1.1.2.2               Port-ranges     1310720        0        0 1257472     0     0
 1.1.2.3                     Ports 12884901888        0        0      23     0     0
 1.1.2.4              IP-addresses       65536        0        0    4096     0     0
 1.1.2.5         Large-scale hosts      262144        0        0       1     0     0
 1.1.2.6  Subscriber-cache entries      262144        0        0       0     0     0
 1.1.2.7      L2-aware subscribers       65536        0        0       0     0     0
 1.1.2.8            L2-aware hosts       65536        0        0       0     0     0
 1.1.2.9            Delayed ICMP's         200        0        0      30     0     0
1.1.2.10               ALG session      786432        0        0       0     0     0
1.1.2.11   Upstream fragment lists       16384        0        0       0     0     0
1.1.2.12 Downstream fragment lists       16384        0        0       0     0     0
1.1.2.13   Upstream fragment holes      131072        0        0       0     0     0
1.1.2.14 Downstream fragment holes      131072        0        0       0     0     0
1.1.2.15    Upstream fragment bufs       13824        0        0       0     0     0
1.1.2.16  Downstream fragment bufs       13824        0        0       0     0     0
 1.2.2.0                     Flows     6291456        0        0    1722     0     0
 1.2.2.1                  Policies         256        0        0       1     0     0
 1.2.2.2               Port-ranges     1310720        0        0 1257472     0     0
 1.2.2.3                     Ports 12884901888        0        0      46     0     0
 1.2.2.4              IP-addresses       65536        0        0    4096     0     0
 1.2.2.5         Large-scale hosts      262144        0        0       3     0     0
 1.2.2.6  Subscriber-cache entries      262144        0        0       0     0     0
 1.2.2.7      L2-aware subscribers       65536        0        0       0     0     0
 1.2.2.8            L2-aware hosts       65536        0        0       0     0     0
 1.2.2.9            Delayed ICMP's         200        0        0      25     0     0
1.2.2.10               ALG session      786432        0        0       0     0     0
1.2.2.11   Upstream fragment lists       16384        0        0       0     0     0
1.2.2.12 Downstream fragment lists       16384        0        0       0     0     0
1.2.2.13   Upstream fragment holes      131072        0        0       0     0     0
1.2.2.14 Downstream fragment holes      131072        0        0       0     0     0
1.2.2.15    Upstream fragment bufs       13824        0        0       0     0     0
1.2.2.16  Downstream fragment bufs       13824        0        0       0     0     0
 1.3.2.0                     Flows     6291456        0        0       0     0     0
 1.3.2.1                  Policies         256        0        0       1     0     0
 1.3.2.2               Port-ranges     1310720        0        0 1257472     0     0
 1.3.2.3                     Ports 12884901888        0        0       0     0     0
 1.3.2.4              IP-addresses       65536        0        0    4096     0     0
 1.3.2.5         Large-scale hosts      262144        0        0       0     0     0
 1.3.2.6  Subscriber-cache entries      262144        0        0       0     0     0
 1.3.2.7      L2-aware subscribers       65536        0        0       0     0     0
 1.3.2.8            L2-aware hosts       65536        0        0       0     0     0
 1.3.2.9            Delayed ICMP's         200        0        0      25     0     0
1.3.2.10               ALG session      786432        0        0       0     0     0
1.3.2.11   Upstream fragment lists       16384        0        0       0     0     0
1.3.2.12 Downstream fragment lists       16384        0        0       0     0     0
1.3.2.13   Upstream fragment holes      131072        0        0       0     0     0
1.3.2.14 Downstream fragment holes      131072        0        0       0     0     0
1.3.2.15    Upstream fragment bufs       13824        0        0       0     0     0
1.3.2.16  Downstream fragment bufs       13824        0        0       0     0     0
 1.4.2.0                     Flows     6291456        0        0    1357     0     0
 1.4.2.1                  Policies         256        0        0       1     0     0
 1.4.2.2               Port-ranges     1310720        0        0 1257472     0     0
 1.4.2.3                     Ports 12884901888        0        0      33     0     0
 1.4.2.4              IP-addresses       65536        0        0    4096     0     0
 1.4.2.5         Large-scale hosts      262144        0        0       1     0     0
 1.4.2.6  Subscriber-cache entries      262144        0        0       0     0     0
 1.4.2.7      L2-aware subscribers       65536        0        0       0     0     0
 1.4.2.8            L2-aware hosts       65536        0        0       0     0     0
 1.4.2.9            Delayed ICMP's         200        0        0      22     0     0
1.4.2.10               ALG session      786432        0        0       0     0     0
1.4.2.11   Upstream fragment lists       16384        0        0       0     0     0
1.4.2.12 Downstream fragment lists       16384        0        0       0     0     0
1.4.2.13   Upstream fragment holes      131072        0        0       0     0     0
1.4.2.14 Downstream fragment holes      131072        0        0       0     0     0
1.4.2.15    Upstream fragment bufs       13824        0        0       0     0     0
1.4.2.16  Downstream fragment bufs       13824        0        0       0     0     0[/size]
I need to create a proper file /var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml to retrieve and display the values of the tmnxNatIsaResrcStatsVal column for every row and for every Card Slot number (4 in total.)

Below my first attempt:

Code: Select all

[size=85]<query>
    <name>Get tmnxNatIsaResrcStatsTable Information</name>
    <description>Get SNMP based Nat Information out of tmnxNatIsaResrcStatsTable</description>
    <oid_index>.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1</oid_index>
    <oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
    <index_order_type>numeric</index_order_type>

    <fields>
        <tmnxNatIsaResrcStatsName>
            <name>Name</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.2</oid>
        </tmnxNatIsaResrcStatsName>
        <tmnxNatIsaResrcStatsVal>
            <name>Val</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.6</oid>
        </tmnxNatIsaResrcStatsVal>
    </fields>
</query>[/size]
But: I'm not sure this is the correct way to SNMP poll the device.

This is the Verbose Output:

Code: Select all

[size=85]+ Running data query [23].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1'
+ Located input field 'tmnxNatIsaResrcStatsName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.2'
+ Found item [tmnxNatIsaResrcStatsName='Flows'] index: 1.1.2.0 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Policies'] index: 1.1.2.1 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Port-ranges'] index: 1.1.2.2 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Ports'] index: 1.1.2.3 [from value]
+ Found item [tmnxNatIsaResrcStatsName='IP-addresses'] index: 1.1.2.4 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Large-scale hosts'] index: 1.1.2.5 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Subscriber-cache entries'] index: 1.1.2.6 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware subscribers'] index: 1.1.2.7 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware hosts'] index: 1.1.2.8 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Delayed ICMPs'] index: 1.1.2.9 [from value]
+ Found item [tmnxNatIsaResrcStatsName='ALG session'] index: 1.1.2.10 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment lists'] index: 1.1.2.11 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment lists'] index: 1.1.2.12 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment holes'] index: 1.1.2.13 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment holes'] index: 1.1.2.14 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment bufs'] index: 1.1.2.15 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment bufs'] index: 1.1.2.16 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Flows'] index: 1.2.2.0 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Policies'] index: 1.2.2.1 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Port-ranges'] index: 1.2.2.2 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Ports'] index: 1.2.2.3 [from value]
+ Found item [tmnxNatIsaResrcStatsName='IP-addresses'] index: 1.2.2.4 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Large-scale hosts'] index: 1.2.2.5 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Subscriber-cache entries'] index: 1.2.2.6 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware subscribers'] index: 1.2.2.7 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware hosts'] index: 1.2.2.8 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Delayed ICMPs'] index: 1.2.2.9 [from value]
+ Found item [tmnxNatIsaResrcStatsName='ALG session'] index: 1.2.2.10 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment lists'] index: 1.2.2.11 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment lists'] index: 1.2.2.12 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment holes'] index: 1.2.2.13 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment holes'] index: 1.2.2.14 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment bufs'] index: 1.2.2.15 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment bufs'] index: 1.2.2.16 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Flows'] index: 1.3.2.0 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Policies'] index: 1.3.2.1 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Port-ranges'] index: 1.3.2.2 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Ports'] index: 1.3.2.3 [from value]
+ Found item [tmnxNatIsaResrcStatsName='IP-addresses'] index: 1.3.2.4 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Large-scale hosts'] index: 1.3.2.5 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Subscriber-cache entries'] index: 1.3.2.6 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware subscribers'] index: 1.3.2.7 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware hosts'] index: 1.3.2.8 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Delayed ICMPs'] index: 1.3.2.9 [from value]
+ Found item [tmnxNatIsaResrcStatsName='ALG session'] index: 1.3.2.10 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment lists'] index: 1.3.2.11 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment lists'] index: 1.3.2.12 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment holes'] index: 1.3.2.13 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment holes'] index: 1.3.2.14 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment bufs'] index: 1.3.2.15 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment bufs'] index: 1.3.2.16 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Flows'] index: 1.4.2.0 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Policies'] index: 1.4.2.1 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Port-ranges'] index: 1.4.2.2 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Ports'] index: 1.4.2.3 [from value]
+ Found item [tmnxNatIsaResrcStatsName='IP-addresses'] index: 1.4.2.4 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Large-scale hosts'] index: 1.4.2.5 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Subscriber-cache entries'] index: 1.4.2.6 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware subscribers'] index: 1.4.2.7 [from value]
+ Found item [tmnxNatIsaResrcStatsName='L2-aware hosts'] index: 1.4.2.8 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Delayed ICMPs'] index: 1.4.2.9 [from value]
+ Found item [tmnxNatIsaResrcStatsName='ALG session'] index: 1.4.2.10 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment lists'] index: 1.4.2.11 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment lists'] index: 1.4.2.12 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment holes'] index: 1.4.2.13 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment holes'] index: 1.4.2.14 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Upstream fragment bufs'] index: 1.4.2.15 [from value]
+ Found item [tmnxNatIsaResrcStatsName='Downstream fragment bufs'] index: 1.4.2.16 [from value]
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Located output field tmnxNatIsaResrcStatsVal
+ Inserting poller_item [oid='.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.6.1.1.2.0']
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/tmnxNatIsaResrcStatsTable.xml'
+ Located output field tmnxNatIsaResrcStatsVal
+ Inserting poller_item [oid='.1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.6.1.1.2.3'][/size]
Anyone who wants to help me?

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

Re: Multi-dimensional Tables - SNMP Data Query Walkthrough

Post by gandalf »

Well, that looks fine. Please find some help for creating an XML step by step at 1st link of my sig
R.
stx73
Posts: 3
Joined: Wed Aug 08, 2012 11:19 am

Re: Multi-dimensional Tables - SNMP Data Query Walkthrough

Post by stx73 »

Hi gandalf,

of course I read your manual, and without that I wouldn't have been able to create this XML file; but now I'd like to add some columns (input fields) in the selection table (in addition to tmnxNatIsaResrcStatsName: .1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.2), in particular:

tmnxChassisIndex: .1.3.6.1.4.1.6527.3.1.2.2.1.3.1.1
tmnxCardSlotNum: .1.3.6.1.4.1.6527.3.1.2.2.3.2.1.1
tmnxMDASlotNum: .1.3.6.1.4.1.6527.3.1.2.2.3.8.1.1
tmnxNatIsaResrcStatsId: .1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1.1

because these are the (four) columns that DEFINE the INDEX of the entries in the tmnxNatIsaResrcStatsTable table.

The problem is that these last four OIDs are "outside" the <oid_index> range (which is .1.3.6.1.4.1.6527.3.1.2.65.1.1.3.4.1), and if I shorten the <oid_index> (in order to take into account these four OIDS too) I won't be able to use the <oid_index_parse>OID/REGEXP (which takes the last four OID octets from the snmpwalk) any more!

So how can I do? I searched the website and the web for similar problems, but the index is always simple (like ifIndex for example) or compound but in that case every input OID is always contained in the snmpwalk.

Any help would be very very appreciated :-)

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

Re: Multi-dimensional Tables - SNMP Data Query Walkthrough

Post by gandalf »

Currently, you can only tackle the index as a single object of it's own. You can't combine multiple indexes!
When dealing with multi-level-indexes, understand them like a strin index of type "i.j.k.l" for example. Thus, when creating the Data Query select table (for "Create Graphs for this Host"), it is a single index column only! It will then list all available tupels of type "i.j.k.l" and you may select those you need.
Else, you will have to use a script. There you may do whatever you want ...
R.
Piratos
Posts: 28
Joined: Thu May 03, 2007 6:22 am

Re: Multi-dimensional Tables - SNMP Data Query Walkthrough

Post by Piratos »

I am very interested in how to do this.

Is there a sample script that shows how to do this?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest