TECHZEN Zenoss User Community ARCHIVE  

Transform changes between Zenoss v3 and v5

Subject: Transform changes between Zenoss v3 and v5
Author: [Not Specified]
Posted: 2016-06-17 14:50

I have been running Zenoss v3 (core) for several years. Works great. I am now evaluating Zenoss v5(still core) and my experience with transforms has been frustrating. My search-Fu may be failing me, I can't seem to find any good summary of how to manage the v5 changes. Additionally, some of the transform logic just doesn't work the same anymore. I am not python proficient, so some of this may be the result of python version changes.

Without further delay - Questions with examples:

1) How can I force an event to Archive status I see the key "eventState" is set to "Aged" for archived events. Can I force-age an event via a transform I tried the obvious "evt.eventState='Aged'" (results in transform error) as well as attemping to set evt.evetState to an integer value (seems to do nothing at all)

2) Did the logic for searching event key names change

v3 transform -- doesn't work in v5:

for key, value in evt.__dict__.items():
 if key.find('portname') >=0:
   tekPort = value

v5 transform that works;

for thing in evt.details._map.keys():
 if re.search('portname', thing):
   tekPort = getattr(evt, thing)

I cannot get any manner of".find" to work at all, so resorted to re.search.

3) Did integer evaluation change

v3 transform -- doesn't work in v5:

if tekClear == 1:
tekSeverity=0

v5 transform that works:

if re.search(tekClear, '1'):
tekSeverity=0

Thank you



< Previous
Container can't connect to serviced
  Next
Commands' output automatically remove consecutive spaces
>