event component name

34 views
Skip to first unread message

pa...@fielding.ca

unread,
Jul 18, 2023, 10:36:58 AM7/18/23
to Zenoss Core
So I'm trying to write a transform that (among other things) stuffs the component name of an OS Process into the Summary.  However, the resulting name I'm getting differs from the readable name.  In the event in the UI I see:

Component: PC7_DC.exe

However, evt.component gives me "zport_dmd_Processes_PowerSpring_osProcessClasses_PC7_DC_b2c1db346f9a88fd56a4c8fdf5e76118"

I seem to recall that I could get the short name using SOMETHING along the lines of 'evt.componentString' or 'evt.componentName' or even 'evt.component.name'.   Something along those lines.  Anyone know what I'm looking for?

thanks, 

Paul

jstanley

unread,
Jul 19, 2023, 8:31:29 PM7/19/23
to Zenoss Core
You could use the component object if it exists. This object gets created if the component exists on the device at the time of event enrichment (zeneventd).

You could also do some janky loops on the dev object or simply take the evt.component and pull out the Process Class from the string.


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

jstanley

unread,
Jul 19, 2023, 9:00:10 PM7/19/23
to Zenoss Core
Also worth noting that if you wanted the component title you could use "component.titleOrId()". But component titles are the path + exe (usually).

Paul Fielding

unread,
Jul 19, 2023, 9:32:08 PM7/19/23
to jstanley, Zenoss Core
Yeah I ended up using component.titleOrId(), it did the job nicely…….

Sent from my iPhone

On Jul 19, 2023, at 7:00 PM, jstanley <jstan...@gmail.com> wrote:

Also worth noting that if you wanted the component title you could use "component.titleOrId()". But component titles are the path + exe (usually).
--
You received this message because you are subscribed to the Google Groups "Zenoss Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zenoss-core...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zenoss-core/23acda27-d20d-44c1-897c-866dd63e80c1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages