TECHZEN Zenoss User Community ARCHIVE  

dsplugins - params method is passing Null Values to below method

Subject: dsplugins - params method is passing Null Values to below method
Author: Alex Pandian Mani
Posted: 2022-03-29 00:21

Hello Team, 
Good day, 
I am working on collecting memory metrics for Juniper Routing Engine. On Modelling I can see the memory metrics for the Routing Engine. Later I started adding monitoring section. I have added required details to perform monitoring. I am using pythondatasource plugin and created a dsplugin to update datasource/datapoint.  After the code changes, I have restarted all the zenoss services under zenoss resmgr (includes zenhub). 

Later after modelling, I have attached to zenpython service and started running zenpython. I am observing exceptions keyerror  in success method.
While debugging I found that the params method in dsplugin is passing null arguments to collect method. Any idea how to resolve this issue. 

I had the same issue for CPU as well, but later after multiple restart(not sure how it got fixed) I can see config.datasource passed to collect method. 

I have log.info in success method to show datasource.params . I can see it is returning null, due to which I get keyerror. 
please see below logs. Thank you 



------------------------------
Alex
Developer
Melbourne VIC
------------------------------


Subject: RE: dsplugins - params method is passing Null Values to below method
Author: Jane Curry
Posted: 2022-03-30 02:44

The params wethod of a datasource logs to zenhub.log, not zenpython.log.  I suggest you put some log statements (info or higher) into your params method and see what is going on.   It looks like, in params you are probably trying to use an element of a list or dictionary with the key of 'hostname' - and that key doesn't exist.  If it was me, I probably called the key 'host' when I set it up and then forgot and used 'hostname' later in the code ;)

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


  Next
SNMP Plugin with multiple indexes
>