Configuration & Administration

Expand all | Collapse all

Transform process events

  • 1.  Transform process events

    Posted 06-13-2019 01:42 PM
    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
    ------------------------------


  • 2.  RE: Transform process events

    Posted 06-14-2019 03:33 AM
    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
    ------------------------------



  • 3.  RE: Transform process events

    Posted 06-14-2019 08:31 AM
    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
    ------------------------------



  • 4.  RE: Transform process events

    Posted 06-18-2019 08:57 AM

    Here you go

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


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



  • 5.  RE: Transform process events

    Posted 06-19-2019 04:32 AM
    thx, works fine !

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