Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Highlighted
Contributor.. rleonard Contributor..
Contributor..
1205 views

SiteScope to OMi, how to fix event description all on one line?

Jump to solution

Hi all,

I currently have SiteScope labbed up out the back at work, I've succesfully integrated with OMi and I have an event flow.
I do however, have an issue where my event description is coming in on one line, I would like the event to have line breaks so that our service desk can read it easier at a glance.

My event mapping appears as so:

<<monitorClass>> <<etiType>> for server <<targetHost>> has breached threshold '<<thresholdCrossedFull>>', current value is '<<metricValue>>'.
Node: <<targetHost>>
Node Type: <<remoteMachineName>>
Severity: <<severity>>
Monitor Name: <<monitorName>>
Alarm URL: <<monitorDrilldownUrlSecured>>
SiteScope Server Time: <<time-date>> <<time-time>>
SiteScope Server Name: <<siteScopeHost>>

 

However when an event is created, all of the information is on one line, how do I get around this issue? (I have CPU threshold set to 1 so simulate events).

2016/10/21 14:38:45:234	MINOR	SiteScope	SiteScope:SiteScopeWin.cwc.local:Windows Servers: Monitors for SITESCOPEWIN.cwc.local: Performance Monitors:CPU Monitor for SITESCOPEWIN.cwc.local	sitescopewin.cwc.local	CPULoad utilization changed from 'good' to 'warning'. Threshold: 'utilization == 1', current value: '1'	CPUMonitor CPULoad for server sitescopewin.cwc.local has breached threshold 'utilization == 1 warning', current value is '1'. Node: sitescopewin.cwc.local Node Type: SITESCOPEWIN.cwc.local - Remote Windows Server Severity: MINOR Monitor Name: CPU Monitor for SITESCOPEWIN.cwc.local Alarm URL: http://SiteScopeWin.cwc.local:8080/Sit... SiteScope Server Time: 21/10/16 2:38 PM SiteScope Server Name: SiteScopeWin.cwc.local	CPU	utilization	SiteScopeWin.cwc.local:10cdbeb0-4ee9-40fd-bae6-5fd6574b36db:utilization:Busy:MINOR	SiteScopeWin.cwc.local:10cdbeb0-4ee9-40fd-bae6-5fd6574b36db:utilization	CiHint:@@sitescopewin.cwc.local	CPULoad:Busy:1	SiteScope@@SiteScopeWin.cwc.local	SiteScope:SiteScopeWin.cwc.local:utilization	http://SiteScopeWin.cwc.local:8080/Sit...	SiteScopeMonitor:201723029:201723031	1	 	 	 	 	 

Thanks for your help in advance!
-Ryan

Labels (2)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: SiteScope to OMi, how to fix event description all on one line?

Jump to solution

Hi Ryan,

SiteScope cannot sent multiline events. Therefore, the newlines from your description get lost when sending the event.

As a workaround, you could use a special tag in your description such as "_SIS_NEWLINE_" and then use an EPI script on the OMi side to replace this tag with a newline:

      event.setDescription(event.getDescription().replaceAll(/_SIS_NEWLINE_/,"\n"))

Feel free to contact me if you need help with the script.

Best Regards

       Bernhard

3 Replies
Micro Focus Expert
Micro Focus Expert

Re: SiteScope to OMi, how to fix event description all on one line?

Jump to solution

Hi Ryan,

SiteScope cannot sent multiline events. Therefore, the newlines from your description get lost when sending the event.

As a workaround, you could use a special tag in your description such as "_SIS_NEWLINE_" and then use an EPI script on the OMi side to replace this tag with a newline:

      event.setDescription(event.getDescription().replaceAll(/_SIS_NEWLINE_/,"\n"))

Feel free to contact me if you need help with the script.

Best Regards

       Bernhard

Contributor.. rleonard Contributor..
Contributor..

Re: SiteScope to OMi, how to fix event description all on one line?

Jump to solution

Hi Bernhard,

Thanks for your response, this was exactly what I was after!

For anyone else with the issue in the future:
Note: getDescription returns nothing, instead I used getOriginalData

I used the following site as reference for scripting: https://todorov.ca/files/bsm/com/hp/opr/api/scripting/Event.html

Here is my working script:

import java.util.Date;
import java.util.List;
			
import com.hp.opr.api.scripting.Action;
import com.hp.opr.api.scripting.Event;
import com.hp.opr.api.scripting.EventActionFlag;
import com.hp.opr.api.scripting.LifecycleState;
import com.hp.opr.api.scripting.MatchInfo;
import com.hp.opr.api.scripting.NodeInfo;
import com.hp.opr.api.scripting.PolicyType;
import com.hp.opr.api.scripting.Priority;
import com.hp.opr.api.scripting.ResolutionHints;
import com.hp.opr.api.scripting.Severity;
			
/*
 * This script replaces _SIS_NEWLINE_ with a line break.
 */
class SiteScopeLineBreak
{
	def init()
	{
	}

	def destroy()
	{
	}

	def process(List<Event> events)
	{
		events.each {
                                                   event -> event.setOriginalData(event.getOriginalData().replaceAll(/_SIS_NEWLINE_/,"\n"));
			}
	}	
}

Thanks a lot,
-Ryan

RogerMacrae Trusted Contributor.
Trusted Contributor.

Re: SiteScope to OMi, how to fix event description all on one line?

Jump to solution

Ryan,

Having a need for something similar, I used your script as a basis for my own.

Working with SNMP traps which can have rather lengthy oid string, adopting this apporach I was able to split the string on variable boundaries onto separate lines in the description field of an event making it much easier to read.

I placed the script in the "Before Storing Events" EPI Steps area.

Thanks for posting, spurred me on to solve my own problem.

 

Regards,

Roger

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.