TECHZEN Zenoss User Community ARCHIVE  

zenoss 6.2.1 - zendmd - running commands on datasource templates failing

Subject: zenoss 6.2.1 - zendmd - running commands on datasource templates failing
Author: [Not Specified]
Posted: 2018-11-26 11:46

Hi,

I am thinking of moving from zenoss 5 to zenoss 6.2.1.
In zenoss 5 I use zendmd to add  and configure plugins to a new installation of zenoss.
However in zenoss 6 I can no longer do this using zendmd it seems.
An example extract of some of zenoss 5 zendmd commands that I would run can be seen below:



#####################################

class Feature(FeatureBase):


def defconfig(self):
return {'critical_load': 60.0,
'critical_load__enabled': False,
'warning_load': 55.0,
'warning_load__enabled': False}


def configure(self, template, dmd, config=None):

t = template

t.add_datasource("DsCheckLoad")
ds = t.get_datasource("DsCheckLoad")\
.set_command_template(COMMAND_TEMPLATE)\
.set_event_class('/Alarmed/CustomerList/')\
.set_severity(dmd.SEVCONVERT["warn"])\
.set_component("processes")\
.add_datapoint("one_minute_load")\
.add_datapoint("five_minute_load")\
.add_datapoint("fifteen_minute_load")
::::::
::::::

########################################

However with zenoss 6.2.1 I can no longer do this, and errors are thrown stating I cannot run the various commands on the datasource template.
​Has anybody else come across this issue with zenoss 6.2.1 and have any idea of how to overcome it?

John


Subject: RE: zenoss 6.2.1 - zendmd - running commands on datasource templates failing
Author: [Not Specified]
Posted: 2018-11-27 06:11

the issue seems to be that a None Type Datasource is returned by the get_datasource method, for example in zendmd when i run the below code you can see this:


t = dmd.Template.create("MyTemplate", "/zport/dmd/Devices")

# In [18]: t.add_datasource("DsCheckLoad")
Out[18]: <ZenPacks.TNF.QualityMonitor.util.dmd.objects.Template at 0xdf21e90>

# ds = t.get_datasource("DsCheckLoad")

# [20]: ds

#In [21]: type(ds)
Out[21]: NoneType

# In [30]: t.get_datasources()
Out[30]: []


In zenoss 5 this used to return a datasource object type.
Does anybody know what has changed here in zenoss6 with zendmd?

​​​​​



#####################################

class Feature(FeatureBase):


def defconfig(self):
return {'critical_load': 60.0,
'critical_load__enabled': False,
'warning_load': 55.0,
'warning_load__enabled': False}


def configure(self, template, dmd, config=None):

t = template

t.add_datasource("DsCheckLoad")
ds = t.get_datasource("DsCheckLoad")\
.set_command_template(COMMAND_TEMPLATE)\
.set_event_class('/Alarmed/CustomerList/')\
.set_severity(dmd.SEVCONVERT["warn"])\
.set_component("processes")\
.add_datapoint("one_minute_load")\
.add_datapoint("five_minute_load")\
.add_datapoint("fifteen_minute_load")
::::::
::::::

########################################

However with zenoss 6.2.1 I can no longer do this, and errors are thrown stating I cannot run the various commands on the datasource template.
​Has anybody else come across this issue with zenoss 6.2.1 and have any idea of how to overcome it?

John​​


< Previous
Zenoss 6 Control Center backup as export/import
  Next
Fortigate Firewall
>