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
------------------------------