Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Thu Aug 25, 2016 1:21 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: How to fix a dual Index issue using new oid_rewrite_pattern
PostPosted: Fri Sep 19, 2014 4:14 pm 
Offline
Cacti User

Joined: Wed Feb 01, 2006 10:29 am
Posts: 113
Problems and solutions (Arris E6000, CableMac, Dual Index, octet OID string)

this is a bit of a chubby post -- but for those having the same issues it fix a lot of problems :) -- I'm only the messenger here, this is the work of my brilliant college :)

the patch supplied is against 0.88b (we have used the same patch on older systems successfully but then you have do the patching it on your own)

cadCmtsCmStatusMacChSummaryTable OBJECT-TYPE
SYNTAX SEQUENCE OF CadCmtsCmStatusMacChSummaryEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { cadMacMib 27 }

cadCmtsCmStatusMacChSummaryEntry OBJECT-TYPE
SYNTAX CadCmtsCmStatusMacChSummaryEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { cadIfMacDomainIfIndex,
cadMacChlChannelIfIndex}
::= { cadCmtsCmStatusMacChSummaryTable 1 }

CadCmtsCmStatusMacChSummaryEntry ::= SEQUENCE {
cadCmtsCmStatusMacChNumOther Integer32,
cadCmtsCmStatusMacChNumInitRanging Integer32,
cadCmtsCmStatusMacChNumRangingComplete Integer32,
cadCmtsCmStatusMacChNumStartEae Integer32,
cadCmtsCmStatusMacChNumStartDhcpv4 Integer32,
cadCmtsCmStatusMacChNumStartDhcpv6 Integer32,
cadCmtsCmStatusMacChNumDhcpv4Complete Integer32,
cadCmtsCmStatusMacChNumDhcpv6Complete Integer32,
cadCmtsCmStatusMacChNumStartCfgFileDownload Integer32,
cadCmtsCmStatusMacChNumCfgFileDownloadComplete Integer32,
cadCmtsCmStatusMacChNumStartRegistration Integer32,
cadCmtsCmStatusMacChNumRegistrationComplete Integer32,
cadCmtsCmStatusMacChNumOperational Integer32,
cadCmtsCmStatusMacChNumBpiInit Integer32,
cadCmtsCmStatusMacChNumForwardingDisabled Integer32,
cadCmtsCmStatusMacChNumRfMuteAll Integer32,
cadCmtsCmStatusMacChNumTotal Integer32,
cadCmtsCmStatusMacChNumRangingAborted Integer32,
cadCmtsCmStatusMacChNumRangFlaps Integer32,
cadCmtsCmStatusMacChNumProvFlaps Integer32,
cadCmtsCmStatusMacChNumRegFlaps Integer32
}

this has a dual Index (cadIfMacDomainIfIndex,cadMacChlChannelIfIndex) both linked to IfTable

but Cacti does not how to handle dual indexes

this will teach Cacti a new trick lets expose this solution

Code:
1 <interface>
2   <name>Get SNMP Modems/Interfaces/SNR</name>
3   <description>Queries a host for a list of monitorable modems/interfaces</description>
4   <oid_index>.1.3.6.1.4.1.4998.1.1.20.2.27.1.9</oid_index>
5   <oid_index_parse>OID/REGEXP:.*\.([0-9]+\.[0-9]+)$</oid_index_parse>
6      <fields>
7      <Index>
8            <name>Index</name>
9            <method>walk</method>
10           <source>OID/REGEXP:.*\.([0-9]+\.[0-9]+)$</source>
11           <direction>input</direction>
12           <oid>.1.3.6.1.4.1.4998.1.1.20.2.27.1.9</oid>
13       </Index>
14       <cadIfMacDomainIfIndex>
15            <name>MacDomain IfIndex</name>
16            <method>walk</method>
17            <source>OID/REGEXP:.*\.([0-9]+)\.[0-9]+$</source>
18            <direction>input</direction>
19            <oid>.1.3.6.1.4.1.4998.1.1.20.2.27.1.9</oid>
20       </cadIfMacDomainIfIndex>
21       <cadIfChlChannelIfIndex>
22            <name>ChlChannel IIndex</name>
23            <method>walk</method>
24            <source>OID/REGEXP:.*\.([0-9]+)$</source>
25            <direction>input</direction>
26            <oid>.1.3.6.1.4.1.4998.1.1.20.2.27.1.9</oid>
27       </cadIfChlChannelIfIndex>



on line 4 we send the parser into an arbitrary part of this table (to expose the indexes) and line 5 we parse the last 2 values as the index
7-13 will do the same for the visible index (this is the input) and parse the OID with an OID/REGEXP otherwise we would have the result from this snmpwalk as the index
on the stanza cadIfMacDomainIfIndex we parse and remember the first number (longest match on end 2 numbers of the OID end)
and the same trick is repeated in the cadIfChlChannelIfIndex (remembers the last numberpair at the end)

all pretty straight forward :)

the rest of the xml file describes the vales we will use for the graphs

but now comes the neat trick (remember the indexes were linked to the IfTable)

Code:
1 <cadIfMacDomainIfDescr>
2           <name>MacDomain IfDescr</name>
3            <!-- no walk! rewrite only works for get method with input direction -->
4            <method>get</method>
5            <source>value</source>
6            <direction>input</direction>
7            <oid>.1.3.6.1.2.1.2.2.1.2</oid>
8            <!-- remove cadMacChlChannelIfIndex from the index and parse the index back to IfDescr-->
9            <oid_rewrite_pattern>OID/REGEXP:\.[0-9]+$</oid_rewrite_pattern>
10            <oid_rewrite_replacement></oid_rewrite_replacement>
11 </cadIfMacDomainIfDescr>
12 <cadIfChlChannelIfDescr>
13           <name>ChlChannel IfDescr</name>
14            <!-- no walk! rewrite only works for get method with input direction -->
15            <method>get</method>
16            <source>value</source>
17            <direction>input</direction>
18            <oid>.1.3.6.1.2.1.2.2.1.2</oid>
19            <!-- remove cadMacChChannelIfIndex from the index and parse it back to IfDescr -->
20            <oid_rewrite_pattern>OID/REGEXP:\.[0-9]+(\.[0-9]+)$</oid_rewrite_pattern>
21            <oid_rewrite_replacement>\1</oid_rewrite_replacement>
22 </cadIfChlChannelIfDescr>


we need both indexes translated back to the (in this case ifDescr) string
We have to break the dual index again and parse the result so line 9 will match the last part of the OID string (the dual index) and removes the last part (only cadIfMacDomainIfIndex remains and append that to the IfDescr OID) remember we here only only translating so the method (line 4) is a get (no walk) on line 20 we repeat this for the last part (cadIfChlChannelIfIndex)

let see this in action (verbose query)

+ Running data query [40].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/arris-cablemac-info.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.4998.1.1.20.2.27.1.9'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017289' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017297' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017305' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017313' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017321' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017329' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017337' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017345' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191688' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191696' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191704' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191712' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191720' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191728' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191736' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191744' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191752' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191760' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191768' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191776' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191784' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191792' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191800' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191808' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870915.34017353' value: '0'
+ Index found at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870915.34017361' value: '0'
.
.
this exposes the dual index
.
.
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017289' results: '536870914.34017289'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017297' results: '536870914.34017297'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017305' results: '536870914.34017305'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017313' results: '536870914.34017313'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017321' results: '536870914.34017321'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017329' results: '536870914.34017329'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017337' results: '536870914.34017337'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.34017345' results: '536870914.34017345'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191688' results: '536870914.101191688'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191696' results: '536870914.101191696'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191704' results: '536870914.101191704'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191712' results: '536870914.101191712'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191720' results: '536870914.101191720'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191728' results: '536870914.101191728'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191736' results: '536870914.101191736'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191744' results: '536870914.101191744'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191752' results: '536870914.101191752'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191760' results: '536870914.101191760'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191768' results: '536870914.101191768'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191776' results: '536870914.101191776'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191784' results: '536870914.101191784'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191792' results: '536870914.101191792'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191800' results: '536870914.101191800'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870914.101191808' results: '536870914.101191808'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870915.34017353' results: '536870915.34017353'
+ index_parse at OID: '1.3.6.1.4.1.4998.1.1.20.2.27.1.9.536870915.34017361' results: '536870915.34017361'
.
.
we have parsed the dual index as the index
.
.
+ Located input field 'Index' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.4998.1.1.20.2.27.1.9'
+ Found item [Index='536870914.34017289'] index: 536870914.34017289 [from regexp oid parse]
+ Found item [Index='536870914.34017297'] index: 536870914.34017297 [from regexp oid parse]
+ Found item [Index='536870914.34017305'] index: 536870914.34017305 [from regexp oid parse]
+ Found item [Index='536870914.34017313'] index: 536870914.34017313 [from regexp oid parse]
+ Found item [Index='536870914.34017321'] index: 536870914.34017321 [from regexp oid parse]
+ Found item [Index='536870914.34017329'] index: 536870914.34017329 [from regexp oid parse]
+ Found item [Index='536870914.34017337'] index: 536870914.34017337 [from regexp oid parse]
+ Found item [Index='536870914.34017345'] index: 536870914.34017345 [from regexp oid parse]
+ Found item [Index='536870914.101191688'] index: 536870914.101191688 [from regexp oid parse]
+ Found item [Index='536870914.101191696'] index: 536870914.101191696 [from regexp oid parse]
+ Found item [Index='536870914.101191704'] index: 536870914.101191704 [from regexp oid parse]
+ Found item [Index='536870914.101191712'] index: 536870914.101191712 [from regexp oid parse]
+ Found item [Index='536870914.101191720'] index: 536870914.101191720 [from regexp oid parse]
+ Found item [Index='536870914.101191728'] index: 536870914.101191728 [from regexp oid parse]
+ Found item [Index='536870914.101191736'] index: 536870914.101191736 [from regexp oid parse]
+ Found item [Index='536870914.101191744'] index: 536870914.101191744 [from regexp oid parse]
+ Found item [Index='536870914.101191752'] index: 536870914.101191752 [from regexp oid parse]
+ Found item [Index='536870914.101191760'] index: 536870914.101191760 [from regexp oid parse]
+ Found item [Index='536870914.101191768'] index: 536870914.101191768 [from regexp oid parse]
+ Found item [Index='536870914.101191776'] index: 536870914.101191776 [from regexp oid parse]
+ Found item [Index='536870914.101191784'] index: 536870914.101191784 [from regexp oid parse]
+ Found item [Index='536870914.101191792'] index: 536870914.101191792 [from regexp oid parse]
+ Found item [Index='536870914.101191800'] index: 536870914.101191800 [from regexp oid parse]
+ Found item [Index='536870914.101191808'] index: 536870914.101191808 [from regexp oid parse]
+ Found item [Index='536870915.34017353'] index: 536870915.34017353 [from regexp oid parse]
+ Found item [Index='536870915.34017361'] index: 536870915.34017361 [from regexp oid parse]
+ Found item [Index='536870915.34017369'] index: 536870915.34017369 [from regexp oid parse]
.
.
Now the Index alive :)
.
.
+ Located input field 'cadIfMacDomainIfIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.4998.1.1.20.2.27.1.9'
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017289 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017297 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017305 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017313 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017321 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017329 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017337 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.34017345 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191688 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191696 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191704 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191712 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191720 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191728 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191736 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191744 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191752 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191760 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191768 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191776 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191784 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191792 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191800 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870914'] index: 536870914.101191808 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870915'] index: 536870915.34017353 [from regexp oid parse]
+ Found item [cadIfMacDomainIfIndex='536870915'] index: 536870915.34017361 [from regexp oid parse]
.
.
cadIfMacDomainIfIndex is determed
.
.
+ Located input field 'cadIfChlChannelIfIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.4998.1.1.20.2.27.1.9'
+ Found item [cadIfChlChannelIfIndex='34017289'] index: 536870914.34017289 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017297'] index: 536870914.34017297 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017305'] index: 536870914.34017305 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017313'] index: 536870914.34017313 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017321'] index: 536870914.34017321 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017329'] index: 536870914.34017329 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017337'] index: 536870914.34017337 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017345'] index: 536870914.34017345 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191688'] index: 536870914.101191688 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191696'] index: 536870914.101191696 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191704'] index: 536870914.101191704 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191712'] index: 536870914.101191712 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191720'] index: 536870914.101191720 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191728'] index: 536870914.101191728 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191736'] index: 536870914.101191736 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191744'] index: 536870914.101191744 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191752'] index: 536870914.101191752 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191760'] index: 536870914.101191760 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191768'] index: 536870914.101191768 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191776'] index: 536870914.101191776 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191784'] index: 536870914.101191784 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191792'] index: 536870914.101191792 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191800'] index: 536870914.101191800 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='101191808'] index: 536870914.101191808 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017353'] index: 536870915.34017353 [from regexp oid parse]
+ Found item [cadIfChlChannelIfIndex='34017361'] index: 536870915.34017361 [from regexp oid parse]
.
.
cadIfChlChannelIfIndex is determed
.
.
+ Located input field 'cadIfMacDomainIfDescr' [get]
+ Found OID rewrite rule: 's/\.[0-9]+$//'
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017289' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017297' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017305' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017313' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017321' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017329' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017337' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017345' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191688' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191696' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191704' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191712' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191720' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191728' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191736' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191744' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191752' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191760' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191768' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191776' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191784' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191792' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191800' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191808' new OID: '.1.3.6.1.2.1.2.2.1.2.536870914'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870914' [value='cable-mac 1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870915.34017353' new OID: '.1.3.6.1.2.1.2.2.1.2.536870915'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.536870915' [value='cable-mac 2']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870915.34017361' new OID: '.1.3.6.1.2.1.2.2.1.2.536870915'
.
.
parsing of the newly found index back to IFDescr value
.
.
+ Located input field 'cadIfChlChannelIfDescr' [get]
+ Found OID rewrite rule: 's/\.[0-9]+(\.[0-9]+)$/\1/'
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017289' new OID: '.1.3.6.1.2.1.2.2.1.2.34017289'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017289' [value='cable-upstream 1/0/0.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017297' new OID: '.1.3.6.1.2.1.2.2.1.2.34017297'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017297' [value='cable-upstream 1/0/1.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017305' new OID: '.1.3.6.1.2.1.2.2.1.2.34017305'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017305' [value='cable-upstream 1/0/2.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017313' new OID: '.1.3.6.1.2.1.2.2.1.2.34017313'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017313' [value='cable-upstream 1/0/3.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017321' new OID: '.1.3.6.1.2.1.2.2.1.2.34017321'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017321' [value='cable-upstream 1/0/4.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017329' new OID: '.1.3.6.1.2.1.2.2.1.2.34017329'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017329' [value='cable-upstream 1/0/5.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017337' new OID: '.1.3.6.1.2.1.2.2.1.2.34017337'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017337' [value='cable-upstream 1/0/6.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.34017345' new OID: '.1.3.6.1.2.1.2.2.1.2.34017345'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.34017345' [value='cable-upstream 1/0/7.0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191688' new OID: '.1.3.6.1.2.1.2.2.1.2.101191688'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191688' [value='cable-downstream 5/0/0']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191696' new OID: '.1.3.6.1.2.1.2.2.1.2.101191696'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191696' [value='cable-downstream 5/0/1']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191704' new OID: '.1.3.6.1.2.1.2.2.1.2.101191704'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191704' [value='cable-downstream 5/0/2']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191712' new OID: '.1.3.6.1.2.1.2.2.1.2.101191712'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191712' [value='cable-downstream 5/0/3']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191720' new OID: '.1.3.6.1.2.1.2.2.1.2.101191720'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191720' [value='cable-downstream 5/0/4']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191728' new OID: '.1.3.6.1.2.1.2.2.1.2.101191728'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191728' [value='cable-downstream 5/0/5']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191736' new OID: '.1.3.6.1.2.1.2.2.1.2.101191736'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191736' [value='cable-downstream 5/0/6']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191744' new OID: '.1.3.6.1.2.1.2.2.1.2.101191744'
+ Executing SNMP get for data @ '.1.3.6.1.2.1.2.2.1.2.101191744' [value='cable-downstream 5/0/7']
+ oid_rewrite at OID: '.1.3.6.1.2.1.2.2.1.2.536870914.101191752' new OID: '.1.3.6.1.2.1.2.2.1.2.101191752'
.
.
parse the Index into the regex and backrefernce the result value

Problem solved :D


Attachments:
File comment: Arris E6000 Temperature
cacti_graph_template_arris_-_e6000_-_temperature.zip [2.58 KiB]
Downloaded 99 times
File comment: Arris E6000 SNR information
cacti_data_query_arris_-_e6000_-_snr.xml [17 KiB]
Downloaded 117 times
File comment: patch for 0.88b fixes 2 issues adds <oid_rewrite_pattern> and adds textual translation (rewrite octet OID strings)
data_query.patch [2.31 KiB]
Downloaded 112 times
File comment: Arris E6000 cablemac information (needs a patch to data_query to work)
arris-cablemac-info.xml [5.59 KiB]
Downloaded 115 times

_________________
All the problems of the world could be settled if people were only willing to think...


Last edited by sodium on Mon Mar 02, 2015 5:05 am, edited 8 times in total.
Top
 Profile  
 
 Post subject: Re: How to fix a dual Index problem
PostPosted: Fri Sep 19, 2014 4:15 pm 
Offline
Cacti User

Joined: Wed Feb 01, 2006 10:29 am
Posts: 113
The explanation for the second part of the patch : sometimes there is text 'hidden' as octet string in OID's this can be translated back to usable fields

+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2636.3.26.1.4.1.6.5'
+ Found OCTET STRING '10.103.101.45.53.47.48.47.55.46.49' decoded value: 'ge-5/0/7.1'
+ Found item [jnxVpnPwVpnName='ge-5/0/7.1'] index: 10.103.101.45.53.47.48.47.55.46.49.4707 [from regexp oid parse]
+ Found OCTET STRING '10.120.101.45.50.47.50.47.49.46.49' decoded value: 'xe-2/2/1.1'
+ Found item [jnxVpnPwVpnName='xe-2/2/1.1'] index: 10.120.101.45.50.47.50.47.49.46.49.4891 [from regexp oid parse]
+ Found OCTET STRING '10.120.101.45.50.47.50.47.49.46.50' decoded value: 'xe-2/2/1.2'

<jnxVpnPwVpnName>
<name>VPN name</name>
<method>walk</method>
<source>OID/REGEXP:1\.3\.6\.1\.4\.1\.2636\.3\.26\.1\.4\.1\.6\.5\.([0-9]+(\.[0-9]+)+)\.[0-9]+$</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.2636.3.26.1.4.1.6.5</oid>
</jnxVpnPwVpnName>

_________________
All the problems of the world could be settled if people were only willing to think...


Top
 Profile  
 
 Post subject: Re: How to fix a dual Index issue using new oid_rewrite_patt
PostPosted: Mon Mar 02, 2015 5:07 am 
Offline
Cacti User

Joined: Wed Feb 01, 2006 10:29 am
Posts: 113
Some Images


Attachments:
File comment: Temperature Information
temp.png
temp.png [ 18.48 KiB | Viewed 1489 times ]
File comment: SNR Information
snr.png
snr.png [ 21.36 KiB | Viewed 1489 times ]
File comment: CableMac Information
cmac.png
cmac.png [ 32.34 KiB | Viewed 1489 times ]

_________________
All the problems of the world could be settled if people were only willing to think...
Top
 Profile  
 
 Post subject: Re: How to fix a dual Index issue using new oid_rewrite_patt
PostPosted: Sat Feb 27, 2016 4:38 am 
Offline

Joined: Sat Feb 27, 2016 4:03 am
Posts: 2
This patch is only use for input direction.
How can we apply them in output direction?


Top
 Profile  
 
 Post subject: Re: How to fix a dual Index issue using new oid_rewrite_patt
PostPosted: Sat Feb 27, 2016 4:42 am 
Offline
Cacti User

Joined: Wed Feb 01, 2006 10:29 am
Posts: 113
please explain (preferably with examples)

_________________
All the problems of the world could be settled if people were only willing to think...


Top
 Profile  
 
 Post subject: Re: How to fix a dual Index issue using new oid_rewrite_patt
PostPosted: Sat Feb 27, 2016 11:33 am 
Offline

Joined: Sat Feb 27, 2016 4:03 am
Posts: 2
In the image of sample, sodium has 2 data_queries:
- SNR: using single Index . It's value is same of cadMacChlChannelIfIndex.
- CableMac Information Graph: dual Index as the same time: Index format is: cadIfMacDomainIfIndex.cadMacChlChannelIfIndex

So, how to graph all info in 01 graph only.
This patch is apply only for data_query for input direction


<cadIfChlChannelIfDescr>
<name>ChlChannel IfDescr</name>
<!-- no walk! rewrite only works for get method with input direction -->
<method>get</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.2.2.1.2</oid>
<!-- remove cadMacChChannelIfIndex from the index and parse it back to IfDescr -->
<oid_rewrite_pattern>OID/REGEXP:\.[0-9]+(\.[0-9]+)$</oid_rewrite_pattern>
<oid_rewrite_replacement>\1</oid_rewrite_replacement>
</cadIfChlChannelIfDescr>

But we can not graph SNR & CableMac Information like this:


<docsIfSigQSignalNoise>
<name>docsIfSigQSignalNoise</name>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.10.127.1.1.4.1.5</oid>
<oid_rewrite_pattern>OID/REGEXP:\.[0-9]+(\.[0-9]+)$</oid_rewrite_pattern>
<oid_rewrite_replacement>\1</oid_rewrite_replacement>

</docsIfSigQSignalNoise>

<cadCmtsCmStatusMacChNumTotal>
<name>cadCmtsCmStatusMacChNumTotal</name>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.4998.1.1.20.2.27.1.17</oid>
</cadCmtsCmStatusMacChNumTotal>

Regards,


Top
 Profile  
 
 Post subject: Re: How to fix a dual Index issue using new oid_rewrite_patt
PostPosted: Wed May 11, 2016 3:29 pm 
Offline

Joined: Wed May 11, 2016 2:03 pm
Posts: 4
Any success with this ? i have been trying to do 'oid_index_parse' to use a dual index. This works flawlessly with input but output it seems to only use the FIRST output field as the index.


Code:
<interface>
        <name>Get ONU Statistics</name>
        <oid_index>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid_index>
        <oid_index_parse>OID/REGEXP:.*\.([0-9]{1,9}\.[0-9]{1,3})$</oid_index_parse>
        <oid_num_indexes>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid_num_indexes>
        <index_order>objindex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

        <fields>
                <objindex>
                        <name>Index</name>
                        <method>walk</method>
                        <direction>input</direction>
                        <source>OID/REGEXP:.*\.([0-9]{1,9}\.[0-9]{1,3})$</source>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid>
                </objindex>
                <onuIndex>
                        <name>ONU ID</name>
                        <method>walk</method>
                        <source>OID/REGEXP:.*\.([0-9]{1,3})$</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid>
                </onuIndex>
                <PortIndex>
                        <name>Port Index</name>
                        <method>walk</method>
                        <source>OID/REGEXP:.*\.([0-9]{1,10})\.[0-9]{1,5}$</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid>
                </PortIndex>
                <onuModel>
                        <name>ONU Model</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.1.1.1</oid>
                </onuModel>
                <onuSerialNumber>
                        <name>ONU Serial</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.1.1.5</oid>
                </onuSerialNumber>
                <onuNonIdleGEMUpstream>
                        <name>Upstream GEM Frames</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.6.1.1</oid>
                </onuNonIdleGEMUpstream>
                <onuPerformanceERR>
                        <name>ERR Counter</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.12.13.1.8</oid>
                </onuPerformanceERR>
                <onuPerformanceREI>
                        <name>REI Counter</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.12.13.1.9</oid>
                </onuPerformanceREI>
                <onuPerformanceLostBurst>
                        <name>Lost Upstream Burst</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.6.1.10</oid>
                </onuPerformanceLostBurst>
                <onuPerformanceLoFI>
                        <name>Lost of Frame Indicator</name>
                        <method>get</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3902.1012.3.28.6.1.20</oid>
                </onuPerformanceLoFI>
        </fields>
</interface>



Every single data is only source from the first output field..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group