This Question is Answered

1 "correct" answer available (4 pts) 5 "helpful" answers available (2 pts)
5,808 Views 8 Replies Last post: Jul 30, 2010 4:37 PM by Matthew Kitchin (public) RSS
Matthew Kitchin (public) Rank: White Belt 72 posts since
Nov 12, 2009
Currently Being Moderated

Jul 28, 2010 11:10 PM

Transform error - AttributeError: 'NoneType' object has no attribute

I'm running 3.0 upgraded from 2.x (whatever the latest pre 3 version was). I realized we weren't getting 
any alerts today. I checked, and zenactions is down. It will not start. The log entries are below.
Line 13 is a transform line I added. It adds circuit IDs and phone numbers to e-mail alerts. Not all devices
have something in the comments field. I got this same complaint when I ran the pre 3.0 upgrade zenpack.
I removed the transform, upgraded, and then put it back in. It hasn't caused any apparent issues for a
week or so. It ran fine on previous versions of Zenoss. Now it seems to be causing a big problem. I
searched the archives. I found something about deleting pickles, but that didn't apply for me. I found
something about referencing non existent fields. That shouldn't apply to me, unless it is unhappy about
processing events for devices that have no entries in the comments field.

Any ideas?
Thanks,
Matthew

2010-07-28 21:46:09,488 WARNING zen.Events: Error processing transform/mapping on Event Class /
Problem on line 13: AttributeError: 'NoneType' object has no attribute 'comments'
evt.message = evt.message + ('\n') + str(device.comments)

Transform:
  0 # Suppress any non-ping, non-clear events from devices that have outstanding
  1 # ping down events.
  2 #
  3 # This transform is sensitive to the event cache timeout. If the ping down
  4 # event comes in less than "timeout" seconds before the subsequent events, the
  5 # subsequent events will not be suppressed. You can find the event cache
  6 # timeout setting on the Event Manager page in the web interface.
  7 if getattr(evt, 'severity', 0) > 0 \
  8    and getattr(evt, 'eventClass', '/Unknown') != '/Status/Ping' \
  9    and device and device.getPingStatus() > 0:
10    evt.eventState = 2
11
12 #add comments to email
13 evt.message = evt.message + ('\n') + str(device.comments)

Tags: 3.0, transform, email
istoptofly Rank: Green Belt 277 posts since
Apr 20, 2010
Currently Being Moderated
2. Jul 30, 2010 3:28 PM in response to: Matthew Kitchin (public)
Re: Transform error - AttributeError: 'NoneType' object has no attribute

Does your transform need to be in /Events or can it be moved to a specific event class?  Also, don't you need to add 'import re' if you're going to use a regex in your transform?

 

# description

import re

evt.message = some transform that uses a regex

 

John

istoptofly Rank: Green Belt 277 posts since
Apr 20, 2010
Currently Being Moderated
4. Jul 30, 2010 3:48 PM in response to: Matthew Kitchin (public)
Re: Transform error - AttributeError: 'NoneType' object has no attribute

It needs to go in the event class that your down alerts are in, most likely /Status/Ping.

 

EDIT - I say needs to but probably better to say it should go in the best fitting class.

istoptofly Rank: Green Belt 277 posts since
Apr 20, 2010
Currently Being Moderated
5. Jul 30, 2010 4:04 PM in response to: Matthew Kitchin (public)
Re: Transform error - AttributeError: 'NoneType' object has no attribute

You didn't mention if you added "import re" to the transform, does that affect it?

 

John

istoptofly Rank: Green Belt 277 posts since
Apr 20, 2010
Currently Being Moderated
6. Jul 30, 2010 4:08 PM in response to: Matthew Kitchin (public)
Re: Transform error - AttributeError: 'NoneType' object has no attribute

I am curious about another thing here, is the first transform in the /Status/Ping class also?  Your error says line 13 which makes me wonder if it is.  If it is, it should be moved to /Events so it can do what it's designed to do - suppress other alerts when a ping-down alert already exists for a given device. 

 

John

More Like This

  • Retrieving data ...

Bookmarked By (0)