Subject: |
RE: PythonCollector try to access the components with config.datasources (dsplugin.py) |
Author: |
Laurent Hemeryck |
Posted: |
2019-05-14 03:52 |
Hello Daniel,
Why this :
for k,v in ds.__dict__.items():
Please try with:
for k,v in ds.items():
If you are investigating how it works, start at a highe level and display the full content of the variable ds.
Ouf of my head, I would say it's very possible that 'component' is an object. If you want to get the name, you will find it in "component.name".
Cheers,
Laurent
------------------------------
Laurent Hemeryck
Monitoring Engineer
FedNot
------------------------------
Subject: |
RE: PythonCollector try to access the components with config.datasources (dsplugin.py) |
Author: |
Patrick McMahon |
Posted: |
2019-05-14 07:50 |
Double check that the template/datasource is on the component and not on the device
I would have expected context.id to be zpool0 instead of '192.168.11.63' in the config_key
config_key and v is ('192.168.11.63', 300, '192.168.11.63', 'testpack-alerts')
-Patrick
------------------------------
Patrick McMahon
Sr. Security and Compliance Specialist
Zenoss
------------------------------
Subject: |
RE: PythonCollector try to access the components with config.datasources (dsplugin.py) |
Author: |
Daniel Vogel |
Posted: |
2019-05-14 10:27 |
Hello Patrick,
Yes you are right. Wow I defined a new template related to the component label in zenpack.yaml.
Now I got the component:
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is cycletime and v is 300
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is severity and v is 3
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is component and v is zpool0
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is manageIp and v is 192.168.11.63
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is points and v is []
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is config_key and v is ('192.168.11.63', 300, 'zpool0', 'testpack-alerts')
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is datasource and v is alerts
2019-05-14 13:39:09,710 DEBUG zen.TestPack: ds k is template and v is ZFSPoolInfo
2019-05-14 13:39:09,711 DEBUG zen.TestPack: ds k is device and v is 192.168.11.63
2019-05-14 13:39:09,711 DEBUG zen.TestPack: ds k is params and v is {}
2019-05-14 13:39:09,711 DEBUG zen.TestPack: ds k is eventClass and v is /Scout/zfsSum
2019-05-14 13:39:09,711 DEBUG zen.TestPack: ds k is plugin_classname and v is ZenPacks.ABC.TestPack.dsplugins.Alerts
2019-05-14 13:39:09,711 DEBUG zen.TestPack: ds k is eventKey and v is
Many thanks for your help,
Cheers Daniel
------------------------------
Daniel Vogel
IT Infrastructure Architect
ABC Systems AG
Schlieren
------------------------------