TECHZEN Zenoss User Community ARCHIVE  

Transform process events

Subject: Transform process events
Author: Chris De Coster
Posted: 2019-06-13 14:42

Hi,
We have setup some process events.
They work as expected, but the events are a bit cryptic.

Example: the summary displays : "threshold of count not met: current value 1.000000"
It would be nicer to see something like: "Process count failed + name of the process that is causing the event"

I think everybody needs this kind of meaning full events, so I wonder, why is this not implemented out of the box?
Is it really the goal we have to dig in the transforms to get a meaningful event?

Is there some "default good transform" for processes available?


Thx,

------------------------------
Chris
------------------------------


Subject: RE: Transform process events
Author: Jane Curry
Posted: 2019-06-14 04:33

I have written the following transform for /Status/OSProcess:

# Check for production State. If device in Maintenance then drop the event
# Only close / drop non-clearing events
if evt.prodState == 400 and evt.severity > 0:
    evt._action = 'drop'
if evt.summary.find('Process set contains') != -1 and evt.severity > 0:
    evt.summary = evt.summary.replace('Process set contains 0 running processes','Process not running')


Cheers,
Jane

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


Subject: RE: Transform process events
Author: Chris De Coster
Posted: 2019-06-14 09:31

Thx, this gave me the good direction.

I implemented this:

if evt.eventKey == "ps|ps_count|count":
    evt.eventClass = "/Status/Process"
    evt.summary = evt.current + " of " + evt.min[:-2] + " Process not running "


Now I wonder if it is possible to put the 'Process Class Name' in the 'EventClassKey'.
This seems so logi to have it there instead of haveing nothing in the EventClassKey at all.

But the probem.. I can't find the 'Process Class Name' in the event.

Any idea?

------------------------------
Chris
------------------------------


Subject: RE: Transform process events
Author: Jay Stanley
Posted: 2019-06-18 09:57

Here you go

if component and hasattr(component, 'osProcessClass'):
  processClass = component.osProcessClass()
  className = processClass.titleOrId()


------------------------------
jstanley
------------------------------


Subject: RE: Transform process events
Author: Chris De Coster
Posted: 2019-06-19 05:32

thx, works fine !

------------------------------
Chris
------------------------------


< Previous
Help with Zenpack monitoring and general upgrade/use questions
  Next
ZenOSS Core 6.2 unable to model Windows devices
>