I wanna use SNMP data query for getting module statuses and their names in Cisco VSS. I use one OID to retrieve indexes and module statuses and completely different OID to get their names. The problem is the latter OID returns much larger list of names (it contains all desired modules and a lot of unnecessary ones). I tried to solve this problem by using get method in "method" field of XML template and it worked. But then the other problem occured. I'm using VALUE/REGEXP in "source" field to parse a string containing module name (I keep first 3 words). It worked while using walk method, but does not with get method. If I simply use value as a source, everything is fine except that modules' names are too long, so I guess something is wrong with combining get method and VALUE/REGEXP.
Any ideas? Can the first problem (having too many indexes for OID returning names) be solved with walk method?
My template:
Code: Select all
<?xml version="1.0"?>
<interface>
<name>VSS modules status</name>
<description>VSS modules status</description>
<oid_index>.1.3.6.1.4.1.9.9.117.1.2.1.1.2</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]+)$</oid_index_parse>
<index_order>VSSmodule_index:VSSmodule_name:VSSmodule_statusIN</index_order>
<index_order_type>numeric</index_order_type>
<fields>
<VSSmodule_index>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</VSSmodule_index>
<VSSmodule_name>
<name>Module Name</name>
<method>get</method>
<source>VALUE/REGEXP:(^.{10}[-A-Za-z0-9]*).*$</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.47.1.1.1.1.2</oid>
</VSSmodule_name>
<VSSmodule_statusIN>
<name>Module status</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9.9.117.1.2.1.1.2</oid>
</VSSmodule_statusIN>
<VSSmodule_status>
<name>Module status</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9.9.117.1.2.1.1.2</oid>
</VSSmodule_status>
</fields>
</interface>
+ Index found at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.8009' value: '2'
+ Index found at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.9000' value: '2'
+ Index found at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.9009' value: '2'
+ Index found at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.10000' value: '2'
+ Index found at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.10007' value: '2'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.1000' results: '1000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.1009' results: '1009'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.2000' results: '2000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.2007' results: '2007'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.3000' results: '3000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.3013' results: '3013'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.3018' results: '3018'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.4000' results: '4000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.5000' results: '5000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.5009' results: '5009'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.7000' results: '7000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.7013' results: '7013'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.7018' results: '7018'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.8000' results: '8000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.8009' results: '8009'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.9000' results: '9000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.9009' results: '9009'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.10000' results: '10000'
+ index_parse at OID: '1.3.6.1.4.1.9.9.117.1.2.1.1.2.10007' results: '10007'
+ Inserting index data for field 'VSSmodule_index' [value='1000']
+ Inserting index data for field 'VSSmodule_index' [value='1009']
+ Inserting index data for field 'VSSmodule_index' [value='2000']
+ Inserting index data for field 'VSSmodule_index' [value='2007']
+ Inserting index data for field 'VSSmodule_index' [value='3000']
+ Inserting index data for field 'VSSmodule_index' [value='3013']
+ Inserting index data for field 'VSSmodule_index' [value='3018']
+ Inserting index data for field 'VSSmodule_index' [value='4000']
+ Inserting index data for field 'VSSmodule_index' [value='5000']
+ Inserting index data for field 'VSSmodule_index' [value='5009']
+ Inserting index data for field 'VSSmodule_index' [value='7000']
+ Inserting index data for field 'VSSmodule_index' [value='7013']
+ Inserting index data for field 'VSSmodule_index' [value='7018']
+ Inserting index data for field 'VSSmodule_index' [value='8000']
+ Inserting index data for field 'VSSmodule_index' [value='8009']
+ Inserting index data for field 'VSSmodule_index' [value='9000']
+ Inserting index data for field 'VSSmodule_index' [value='9009']
+ Inserting index data for field 'VSSmodule_index' [value='10000']
+ Inserting index data for field 'VSSmodule_index' [value='10007']
+ Located input field 'VSSmodule_name' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.47.1.1.1.1.2'
+ Found item [VSSmodule_name='Cisco System'] index: 1 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 2 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 3 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 4 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 5 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 6 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 7 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 8 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 9 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 10 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 11 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 Cisco'] index: 12 [from regexp value parse]
+ Found item [VSSmodule_name='Chassis 1 fan-tray'] index: 13 [from regexp value parse]