TECHZEN Zenoss User Community ARCHIVE  

Error processing transform/mapping on Event Class /Status/instances/IISSiteStatu ...

Subject: Error processing transform/mapping on Event Class /Status/instances/IISSiteStatus
Author: [Not Specified]
Posted: 2015-02-12 22:18

Hi, We are just in the process of implementing Zenoss Core into our environment. It is going quite well, but we are getting the below error all of the time, when I suspect when Windows ZenPak queries IIS Service. I have updated to latest version, but still no go. Error details as follows which is coming from the Zenoss server:

summary Error processing transform/mapping on Event Class /Status/instances/IISSiteStatus
message Problem with line 4: if getattr(component, 'status') != currentstate:
exception AttributeError: 'NoneType' object has no attribute 'status'
transform 0 import re 1 2 @transact 3 def change_properties(currentstate): 4 if getattr(component, 'status') != currentstate: 5 setattr(component, 'status', currentstate) 6 7 msg = evt.summary 8 summaryObj = re.match(r'IIS Service (.*) is in (.*) state(.*)', msg) 9 10 change_properties(summaryObj.group(2))

I suspect since the transform is not working, which them is causing a lot of info events stating that IIS service is in running state

Please advise.
Thanks, Chris.



Subject: I have seen lots of things do
Author: Jane Curry
Posted: 2015-02-14 09:58

I have seen lots of things do this - I think it is a problem somewhere in Zenoss-shipped transforms and/or some common community ones. In my experience it generally does not cause lots of pain other than these events. The error message is basically trying to say that "component" is not instantiated in this case, so trying to get its "status" attribute doesn't work.

You could fix it by editing this transform and adding an extra "if" statement to check whether component exists:


import re

@transact
def change_properties(currentstate):
if component:
if getattr(component, 'status') != currentstate:
setattr(component, 'status', currentstate)

msg = evt.summary
summaryObj = re.match(r'IIS Service (.*) is in (.*) state(.*)', msg)
change_properties(summaryObj.group(2))

Bah!! The wiki has lost the indentation - beware that Python needs indents. The "if component" added line is on its own level of indent.

Cheers,
Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



< Previous
Device web console link using zLinks
  Next
Edit user groups via zendmd?
>