This article explains an issue where incorrect element names are updated when ForceOccurredOn = TRUE i.e.,
BEGIN_TRAP <OID> <GenericOID> <SpecificOID>
ClassName: <ClassName>
InstanceName: <InstanceName>
ForceOccurredOn: TRUE
ElementClassName: <UserSpecific ElementClassName>
ElementName: <UserSpecific ElementName>
EventName: <Event>
SysNameOrAddr: <UserSpecific System Name>
UnknownAgent: CREATE
ForceOccurredOn: TRUE
.........<Any other custom parameters that are useful for traps>
END_TRAP
Note: When the ForceOccurredOn = TRUE, it is expected to add the ElementClass and ElementName fields to modify the OccuredOn relationship on the Notification.# <force-occurred-on> Set this to 'TRUE', if you want to overwrite the ElementClass and ElementName which will modify the 'OccurredOn' Object.Note: The object(ELEMENTCLASSNAME, ELEMENTNAME) should exist, otherwise the trap will default to having Agent's Name, if it exists in the topology.
All supported release of Smarts
The parameter: suppress_agent_as_occurredon = "TRUE" is not set when ForceOccurredOn is detected with valid ElementName and ElementClassName in the file: <Base-Dir>/smarts/rules/icoi-trapd/trap_mgr_parse.asl
/* Check if HookScript is telling us change the sourceObj i.e OccurredOn Object
------------------------------------------------------------------------------- */
if ( force_occurredon == "TRUE" ) {
if ( elementclassname != "" && elementinstancename != "" ) {
sourceObj = object(elementclassname, elementinstancename) ? IGNORE;
if (debug) {
print(printHeader."NOTIFY_EVENT : OccurredOn was set to '".elementclassname."::".elementinstancename."'.");
}
}
else if (debug) {
print(printHeader."NOTIFY_EVENT : OccurredOn cannot be changed, ElementClassName and/or ElementInstanceName were not set.");
}
}
/* Check if instructed to skip setting Agent as OccurredOn
------------------------------------------------------------------------------- */
if ( suppress_agent_as_occurredon == "TRUE" ) {
if (debug) {
print(printHeader."NOTIFY_EVENT : supressing setting of Agent as OccurredOn");
}
}
In an ideal scenario, the suppress_agent_as_occurredon = "TRUE" needs to be set if the force_occurredon =TRUE and (Elementclassname != "" && Elementinstancename != "")Hence, add the highlighted parameter to this section and save the file.
/* Check if HookScript is telling us change the sourceObj i.e OccurredOn Object
------------------------------------------------------------------------------- */
if ( force_occurredon == "TRUE" ) {
if ( elementclassname != "" && elementinstancename != "" ) {
sourceObj = object(elementclassname, elementinstancename) ? IGNORE;
suppress_agent_as_occurredon = "TRUE";
if (debug) {
print(printHeader."NOTIFY_EVENT : OccurredOn was set to '".elementclassname."::".elementinstancename."'.");
}
}
else if (debug) {
print(printHeader."NOTIFY_EVENT : OccurredOn cannot be changed, ElementClassName and/or ElementInstanceName were not set.");
}
}
/* Check if instructed to skip setting Agent as OccurredOn
------------------------------------------------------------------------------- */
if ( suppress_agent_as_occurredon == "TRUE" ) {
if (debug) {
print(printHeader."NOTIFY_EVENT : supressing setting of Agent as OccurredOn");
}
}
else {
..... further processing to lookup for Agent and ElementName/ElementClassName mapping based on OI topology