Reference two indices in one data query

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

Moderators: Developers, Moderators

Post Reply
k435
Posts: 1
Joined: Wed Dec 30, 2015 2:47 am

Reference two indices in one data query

Post by k435 »

Hello,

I currently have a problem gathering the hardware description of a Cisco IOS XR device component and the corresponding performance data in one query. In order to get the hardware description, I need the value of an OID as index. Furthermore, I also need an index parsed from the same OID in order to get the performance data.

More precisely, I've created the following data query:

Code: Select all

<cpu>
    <name>Cisco IOS XR - CPU</name>
    <description>Get Cisco IOS XR CPU information</description>
    <index_order>entPhysCpuIndex:entPhysicalName</index_order>
    <index_order_type>numeric</index_order_type>
    <oid_index>1.3.6.1.4.1.9.9.109.1.1.1.1.2</oid_index>
    <oid_index_parse>OID/REGEXP:^.*\.([0-9]+)$</oid_index_parse>

    <fields>
        <entPhysCpuIndex>
            <name>CPM CPU Index</name>
            <source>index</source>
            <direction>input</direction>
        </entPhysCpuIndex>

        <entPhysicalName>
            <name>Physical Entity Name</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>1.3.6.1.2.1.47.1.1.1.1.7</oid>
        </entPhysicalName>

        <cpuMinAvg>
            <name>Cpu Minute Average</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>1.3.6.1.4.1.9.9.109.1.1.1.1.7</oid>
        </cpuMinAvg>

        <cpu5MinAvg>
            <name>Cpu 5 Minute Average</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>1.3.6.1.4.1.9.9.109.1.1.1.1.8</oid>
        </cpu5MinAvg>
    </fields>
</cpu>
As an example, snmpwalk provides the following values using OID 1.3.6.1.4.1.9.9.109.1.1.1.1.2:
Name/OID: .1.3.6.1.4.1.9.9.109.1.1.1.1.2.66; Value (Integer): 38557239
Name/OID: .1.3.6.1.4.1.9.9.109.1.1.1.1.2.82; Value (Integer): 56744940
For the description, I need the value as index (marked blue):
Name/OID: 1.3.6.1.2.1.47.1.1.1.1.7.38557239; Value (OctetString): module 0/RSP0/CPU0
Name/OID: 1.3.6.1.2.1.47.1.1.1.1.7.56744940; Value (OctetString): module 0/RSP1/CPU0
For the performance data value, I need a parsed index from the OID:
Name/OID: .1.3.6.1.4.1.9.9.109.1.1.1.1.7.66; Value (Gauge): 10
Name/OID: .1.3.6.1.4.1.9.9.109.1.1.1.1.7.82; Value (Gauge): 23
Is it possible to use both indices in one data query? I'm using the currently latest cacti release 0.8.8f.

Thanks in advance
yfherzog
Posts: 1
Joined: Wed Jan 20, 2016 3:03 am

Re: Reference two indices in one data query

Post by yfherzog »

Hi,

I implemented something similar with a script. Don't know if this is possible without a script.
I Wanted to query for several values that had different indices sets.

In the script, I implemented some simple translation between the two sets of indices, thus made Cacti think that it uses one indexing method for all fields.

in your case, let's assume that you choose the OIDs that uses the 62,68,... indices as the main index, and then implement a translation from these indices to the longer indices (your translation can be based on a walk on the 1.3.6.1.4.1.9.9.109.1.1.1.1.2 OID).

Hope this helps.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests