Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
snmpindex_dct example usage
from Products.DataCollector.plugins.CollectorPlugin import SnmpPlugin
from Products.DataCollector.plugins.CollectorPlugin import GetTableMap
class MyPlugin(SnmpPlugin):
relname = 'myrelation'
modname = 'ZenPacks.example.MyStuff'
snmpGetTableMaps = (
'', {
'.1': 'someIndex',
'.2': 'someAlternateIndex',
'.3': 'someName',
def process(self, device, results, log):
rm = self.relMap()
for snmpindex, row in results[1].get('sometable').items():
# Any SNMP datasources with the
# prefix will use someAlternateIndex as their snmpindex
# instead of the component's snmpindex attribute.
snmpindex_dct = {
'': row.get('someAlternateIndex'),
om = self.objectMap({
'id': self.prepId(row['someName']),
'title': row.get('someName'),
'snmpindex_dct': snmpindex_dct,
return rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.