Event Management - Alert Short Description Not Setting as Expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2019 11:29 AM
Beyond the basic flow shown in documentation, does anyone have a details list / diagram of the steps and Event goes through to become an Alert?
Using London, I'm trying to set the Alert Short Description to be something different than the Description for , but I've run into some issues, and I'm hoping someone can point out to me how the Short Description is being set.
I tried doing this in my Event Rule but, oddly, this doesn't stick. It gets overwritten by the time the Alert is created.
So, I added code in the EvtMgmtCustom_PostBind_Create and EvtMgmtCustom_PostBind_Update script includes. This is where it gets weird.
The EvtMgmtCustom_PostBind_Create script works. Alert is created, and it has the Short Description that I want. But, the EvtMgmtCustom_PostBind_Update does not. It sets the Short Description to ${type}: ${node} - ${description}.
I've validated that my code is running (gs.info statements galore in the script), and even checked the value of the alert.short_description right before the final 'return true;' statement. And yet, the updated Alert now has the wrong Short Description.
I've tried looking through the other script includes to see if there is something else that is doing it, but no luck. If anyone has any ideas, or can point me in a direction to look, I promise I'll give you 50,000 fake internet points.
Steve
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2019 05:00 AM
I didn't think the short description was used to begin with. Can you provide an example of what it is getting overwritten with? Is it just being blanked out? Out of the box I believe only the description field is used on the em_alert table so there shouldn't be any out of the box code that touches the short description (the only time anything related to event management touches a short description is when it opens an incident). Can you show a screenshot of the code you did in the bind scripts? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2019 04:48 AM
Robert, it is not being used out of the box, but is being populated by ${type}: ${node} - ${description}
Our OEM team wanted different information in the Short Description, so I ended up at the PostBind scripts to get it there. I've grabbed just the code that does this specific change.
I'm setting the additional_info.orig_desc to the value I want (yeah, the naming of that field is bad. I will clean it up after I get it working...)
switch(String(event.source)){
case 'OEM 13c':
gs.log('Event_PostBind:' + 'PostBind_Create processing for "' + event.source + '" source event at '+ event.time_of_event + '".');
//set the 'Short Description' field to the value in 'additional_info.orig_desc'
//gs.log('Event_PostBind:' + event.additional_info);
gs.log('Event_PostBind:' + 'event.description:\n' + event.description);
addl_info = JSON.parse(event.additional_info);
//gs.log('Event_PostBind:' + addl_info);
orig_desc = addl_info.orig_desc || "";
gs.log('Event_PostBind:' + 'event.additional_info.orig_desc:\n' + orig_desc);
//gs.log('Event_PostBind:' + 'PostBind_Create - set orig_desc');
if (orig_desc == null || orig_desc == ""){
gs.log('Event_PostBind:' + 'PostBind_Create - orig_desc is blank, setting to event.description');
orig_desc = event.description;
}else{
gs.log('Event_PostBind:' + 'PostBind_Create - orig_desc: ' + orig_desc);
}
//gs.log('Event_PostBind:' + 'PostBind_Create - orig_desc = "' + orig_desc + '"');
alert.short_description = orig_desc;
//desc = event.description || "";
//alert.description = desc;
break;
} //end switch for event.source
gs.log('Event_PostBind:' + 'PostBind_Create custom script is Complete for ' + event.source);
return true;
Note that I change the source field as part of the Event Rule to make it more easily readable by the Operations teams.
It is the same code in the Create and Update includes, and the code is definitely running because all the messy gs.log statements show up in the System Log. It works just fine in the Create, but not in the Update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2019 05:00 AM
Yeah the code looks good. I've never checked it but it appears that even in my client current system short_description is being set to what the description is set to. I'm wondering if the back-end code is doing that (no clue why they would do it but I guess just to keep them synced). I think in this case you may need to do a business rule that runs that code and sets the short_description and give it the highest order so it runs last before saving. Give that a try but this is definitely a weird one and it's definitely the back-end code doing it (I checked business rules and none out of the box sync short_description).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2019 05:15 AM
Thanks Robert - the thing I just don't understand is that it is only happening with the Update code; the Create works great.
I'm going to open a HI ticket to see if they have some insight.
Steve