Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.

DISCLAIMER

All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.

Cireson does not and will not support or maintain these enhancements, extensions, and scripts.

For Team Cireson uploads click here.

Portal Task - Enable "View SCOM Alert"

Adam_DzyackyAdam_Dzyacky Customer Contributor Monkey ✭✭✭✭✭
edited March 2017 in Community Uploads
For those amongst us heavily leveraging SCOM/SCSM it goes without saying how valuable it is to view the Health of a Configuration Item as well as its respective Incident. It only makes sense that if you're having SCOM auto create Incidents within SCSM that you wouldn't mind having the "View Alert Details" as seen in the SCSM Console on these class of Incidents within the Cireson Analyst Portal.

The following crazy simple custom.js will add a new "View SCOM Alert" task on Incidents that have the Incident viewModel containing the AlertId. Which is to say you'll only see this task on Incidents that were actually created from SCOM! Finally, when clicked it will take you to the configured SCOM portal as defined within the "viewSCOMAlert.js" file.

NOTE: This is currently built around the stock SCOM Silverlight portal. I haven't tested this against SquaredUp or Savison, but chances are incredibly high this will not work for them. I can't recall what those URLs format is, but I can't imagine this would be all that difficult to adapt.




Comments

  • Brad_McKennaBrad_McKenna Customer Advanced IT Monkey ✭✭✭
    Thank you sooo much for the contribution Adam!

    We just received and implemented SquaredUp, and I was able to use your code which is FANTASTIC.
    Only need to change one line, the url variable, for SquaredUp integration.

    See new line below (line 13 to replace url variable):
    • var url = portalURL + "/drilldown/scomalert?id=" + alertID;
    My reference to easily find this was with this: https://github.com/squaredup/Scripts/blob/master/New-SCOMHtmlNotificationChannel.ps1 - as they essentially build the URL. Only necessary item was to remove the URL encoding to get to the line above that works flawlessly.
     
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    We added 2 more tasks, for a total of 3:
    • SCOM: This Alert
    • SCOM: All Alerts on CI
    • SCOM: Health Explorer
    app.custom.formTasks.add('Incident', taskNameThisAlert, function (formObj, viewModel)
    { 
    	var url = portalURL + "/OperationsManager/default.aspx?DisplayMode=Pivot&AlertId=" + pageForm.viewModel.AlertId;
    	var win = window.open(url, '_blank'); win.focus(); return;
    });
    app.custom.formTasks.add('Incident', taskNameAllCiAlerts, function (formObj, viewModel) {
    	var url = portalURL + "/OperationsManager/default.aspx?ViewType=AlertView&PmoID=" + pageForm.viewModel.MonitoringObjectId;
    	var win = window.open(url, '_blank'); win.focus(); return;
    });
    app.custom.formTasks.add('Incident', taskNameHealthExp, function (formObj, viewModel) {
    	var url = portalURL + "/OperationsManager/ResultViews/ViewTypeHealthExplorer.aspx?targetId=" + viewModel.MonitoringObjectId + "&monitorId=" + viewModel.MonitoringRuleId;
    	var win = window.open(url, '_blank'); win.focus(); return;
    });

    These URL's target the SCOM 2016 Web Console, so your mileage may vary with 2012. 
    It is not shown here, but you would only want to load these tasks if the form class is the SCOM Alert Incident, rather than just any Incident.

    The other two tasks are particularly helpful later on, if the alert has been groomed out, or if you just want to quickly get some more context around the alert.
Sign In or Register to comment.