as the index (or instance - both terms can be used), to distinguish between the different access points (or components in Zenoss terminology). So the trick is, in your modeler when you collect the component data, you need to arrange for that index string ( 248.11.203.178.49.192 as an example) to be the snmpindex attribute of your component (see chapter 9.6.2 of the ZenPack Developers' Guide, especially around pages 156 - 158). It is the snmpindex attribute that determines the SNMP instance that is used to collect performance data.
I have a couple of ZenPacks that manipulate data to construct the snmpindex attribute - have a look at the Juniper ZenPack modeler at
. Note that snmpindex should be a string attribute.
Subject: |
RE: Creating ZenPack. Question from novice |
Author: |
Eduard |
Posted: |
2018-09-13 11:06 |
Yes, I used snmpindex. My code for "process" below:
def process(self, device, results, log):
AP = results[1].get('bsnAPEntry', {})
log.info('Process Cisco Monitored AP')
rm = self.relMap()
for snmpindex, row in AP.items():
name = row.get('bsnAPDot3MacAddress')
log.info('MAC: %s, APName: %s, APip: %s', name, row.get('bsnAPName'), row.get('bsnApIpAddress'))
if not name:
log.warn('Skipping AP with no mac')
continue
rm.append(self.objectMap({
'id': self.prepId(name),
'title': row.get('bsnAPName'),
'snmpindex': snmpindex.strip('.'),
'AP_Mac': name,
'APip': row.get('bsnApIpAddress'),
}))
ap_cnt = self.objectMap({
'AP_count': len(AP.keys()),
})
return [rm, ap_cnt]
So, the problem is that datasource(oids) like
1.3.6.1.4.1.14179.2.2.1.1.13.248.11.203.178.49.192.13.0 is not collecting.But oids like
1.3.6.1.4.1.14179.2.2.1.1.13.248.11.203.178.49.192.0 collecting.------------------------------
Eduard
------------------------------
Subject: |
RE: Creating ZenPack. Question from novice |
Author: |
Jane Curry |
Posted: |
2018-09-14 04:03 |
In your example:
So, the problem is that datasource(oids) like
1.3.6.1.4.1.14179.2.2.1.1.13.248.11.203.178.49.192.13.0 is not collecting.But oids like
1.3.6.1.4.1.14179.2.2.1.1.13.248.11.203.178.49.192.0 collecting.
Presumably the first one is a table value and the second a scalar? The .0 on the end is necessary for scalar values; however I would not expect to see a .0 on the end of an SNMP table value - they almost always start at .1. So I guess my question is "Where is the .0 coming from"?
Have you looked at zenperfsnmp.log in detail? You might try running that in debug mode against your test device:
zenperfsnmp run -v 10 -d zen42.class.example.org > /tmp/fred 2>&1 (changing the device to match yours)
and then inspect /tmp/fred.
Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------
Subject: |
RE: Creating ZenPack. Question from novice |
Author: |
Eduard |
Posted: |
2018-09-16 12:37 |
In zenperfsnmp.log i have error like this:
2018-09-16 19:24:31,462 WARNING zen.zenperfsnmp: Error reading value for ['M5_bldg1_5lvl_2'] (1.3.6.1.4.1.14179.2.2.15.1.21.180.222.49.196.184.160) on 192.168.0.1832018-09-16 19:24:31,462 ERROR zen.zenperfsnmp: SNMP get returned empty value: 192.168.0.183 1.3.6.1.4.1.14179.2.2.15.1.21.76.119.109.52.85.160
In monitoring template I was configured SNMP datasource with OID: 1.3.6.1.4.1.14179.2.2.15.1.21
So, zenperfsnmp get snmpindex.
And what I want to collect:
[root@test ~]# snmpwalk 192.168.0.183:1024 .1.3.6.1.4.1.14179.2.2.15.1.21 | grep 21.180.222.49.196.184.160RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.1 = INTEGER: -94RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.2 = INTEGER: -93RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.3 = INTEGER: -94RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.4 = INTEGER: -87RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.5 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.6 = INTEGER: -95RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.7 = INTEGER: -96RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.8 = INTEGER: -96RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.9 = INTEGER: -95RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.10 = INTEGER: -96RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.11 = INTEGER: -95RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.12 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.0.13 = INTEGER: -96RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.36 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.40 = INTEGER: -93RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.44 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.48 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.52 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.56 = INTEGER: -98RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.60 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.64 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.132 = INTEGER: -98RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.136 = INTEGER: -98RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.140 = INTEGER: -98RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.149 = INTEGER: -96RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.153 = INTEGER: -95RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.157 = INTEGER: -97RFC1155-SMI::enterprises.14179.2.2.15.1.21.180.222.49.196.184.160.1.161 = INTEGER: -96And this is for each component.
------------------------------
Eduard
------------------------------
Subject: |
RE: Creating ZenPack. Question from novice |
Author: |
Eduard |
Posted: |
2018-09-19 21:53 |
Is it possible to collect tables like in example above?
------------------------------
Eduard
------------------------------
Subject: |
RE: Creating ZenPack. Question from novice |
Author: |
Jane Curry |
Posted: |
2018-09-21 05:45 |
Absolutely it is possible to collect tabular data but I think, looking at your snmpwalk data, that the index/instance that you need to construct for your snmpindex attribute, is a particularly complicated one.
It looks like it is more than the MAC address -
180.222.49.196.184.160 - in your latest example; the index has 2 more digits on the end where (again in your example) the first instance has 0.1 on the end and the last has 1.161. I suspect these are elements that further identify the specific component and you can probably work out where they come from with a very close inspection of the MIB. Once you have that sorted out, you will need to do a bit more work in your modeler to construct the snmpindex attribute.
If you really are a ZenPack novice, you have done really well to get this far and I am afraid you have picked a particularly hard MIB / device type to try to model. You might have another look at the Juniper ZenPack - I have a feeling that had to do some hard work creating snmpindex values in some of the modeler plugins.
Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------