Showing posts with label SCOM. Show all posts
Showing posts with label SCOM. Show all posts

Friday, October 19, 2018

SCOM and Orchestrator Voice Notification Solution with Twilio and Automys


SCOM and Orchestrator Voice Notification Solution with Twilio and Automys.


Cherry Picking SCOM alerts…

Problem:

Issue # 1 : Spam (and I don’t mean the canned pork meat)

Alert spam has been a challenge for anyone that uses SCOM. Finding the perfect balance between notifying IT folks on important issues and avoiding overwhelming them with alerts has proven difficult.

However, when a large number of alerts are generated, generally means a big problem is brewing in your network.

Issue # 2 : Timing

Email and SMS Text notifications can be very effective during working hours. After hours is a different issue all together since most people put their devices down (as they should) and a large number of alerts or a network outage could be missed.

That is where Voice notification comes into play.

However, we wouldn’t want to wake up our IT Admin at 3:00 am for just any issue. Totally fine if you’re testing or if you dislike the person, you know the one always complaining about the amount of alerts they get or when issues do arise, they complaint why they didn’t get more alerts and when.. (ahem), excuse me, back to the subject.


Solution: Voice notification, appropriately named 'Alert Cherry Picker'


The solution provided below is a combination of SCOM, Orchestrator and third party solutions Twillio and Automys.

Logic:

Orchestrator side:


  • An SCORCH Runbook monitors SCOM alerts and writes the alert’s details to a Database.
  • A PowerShell scripts converts the alert’s UTC time to local time.
  • An SQL query is later run to verify if the same alert has been written to the Database in the last x number of minutes. (Here you can customize it to monitor only critical alerts, alerts from specific group, etc.)
  • If the alert meets the time and frequency criteria, an event is written to the Orchestrator server event log.


SCOM side:


  • A SCOM rule reads the Orchestrator log file and generates another alert. (Voice Notification Alert Trigger)
  • A SCOM Command notification configured to listen for the above alert is executed which places the phone call.


This is where the third party comes in.

Noah Stahl has done an amazing job integrating SCOM to communication solution Twilio.

Follow the steps in the guide below to integrate SCOM with twilio.

https://automys.com/library/asset/sms-voice-notifications-with-powershell-system-center-operations-manager-and-t

My contribution:

My contribution here is in the form of the Orchestrator Runbook and the custom SCOM Management Pack that perform the steps described in the logic section above.

Runbooks

The Trimmer Runbook




Activities:

Monitor Alert:
As part of the Operations Manager Integration Pack this activity monitor all SCOM alerts.



‘The Times They Are a-Changin’ script:
Simple script to change the alert’s UTC time to local time:




Write to Database:
This activity writes the alerts details to the custom database. You can find the AlertCherryPickerTable.sql file in this solution to create the needed SQL table that exactly matches the activity parameters.




To the Picker Invoke Runbook Control:
Passes alert’s details to the Picker Runbook, which determines if our thresholds are met.



The Picker Runbook




Activities:

Query Database if Alert Exists:
Feel free to modify the details. Here we query SQL to find another alert with the same name in the last 5 minutes.



SQL Query Result Greater Than or equals to X Link:
This link determine if the results from the query are pass to the next activity, which creates an event
Add the minimum number of rows in the Query Result as a condition to pass to the next activity




Create an Event:
An event is created in a Custom EventLog on the Orchestrator server.




SCOM Management Pack:

Management Pack ‘Mundo SCOM SCORH Runbook Event Log Monitoring’ contains the rule “Voice Notification Alert Trigger”.

The alert is disabled. Enable it for the Orchestrator server via an override



Command Channel
Follow Noah’s steps on how to set up a channel. Below is what the end product looks like. Note the message type is Voice.



Alert Subscription
This is what triggers the command channel, which executes the script (Noah’s solution), which makes the call. That’s a lot…

Very important to include the dummy subscriber, and  I don’t mean your IT Admin… ba-dum-pump chsh!




Downloads AlertCherryPicker.zip


Tuesday, June 9, 2015

AD User Attribute Changes Audit Report



The following SCOM 2012 R2 ACS report provides detailed attribute changes done to any Active Directory user.
The Challenge
There are many reports that provide similar information included in SCOM Audit reports. One example is located in Reporting>>Audit Reports>>DAC_-_Object_Attribute_Changes

However, there are thousands of AD Attributes which include hundreds of AD User-related attributes making the above mentioned report very convoluted. The use of sometimes cryptic attribute names, values and operation description adds to the complexity of the report making it hard to read especially for non-tech people whom are, most of the time, the recipients of many SCOM reports.

Sample out-of-the-box report



The Solution:

The attached report focuses on AD User attributes displayed via Outlook which are a representation of LDAP fields and are by far the most commonly modified.

Most Common User Attributes




In my report I have replaced all AD User attributes with user-friendly names.


AD User Attribute Name
Friendly Name
displayname
Display Name
givenname
First Name
initials
Initials
sn
Last Name
mailNickname
Email Alias
streetAddress
Address
description
Description
title
Title
company
Company
department
Department
physicalDeliveryOfficeName
Office
msExchAssistantName
Assistant
telephoneNumber
Phone Number
L
City
st
State/Province
Postal Code
Zip/Postal Code
co
Country/Region
thumbnailPhoto
Photo


Sample Report

Mundo SCOM AD User Attribute Changes Report

The report takes two variable in between two %% signs: ‘User Name Contains’ (Affected User) and/or ‘Attribute Name Contains’ (Changed Attribute) or just enter two %% to get all possible results.



Preparing the AD environment:

How to enable AD Object Auditing, Audit Policies or Advanced Audit Policies setup is out of the scope of this post. 

However here is quick description of what is needed in order to produce the report:
On you Domain Controllers, enable ‘Directory Service Changes’ Audit Policy Subcategory, which is part of the Directory Service Audit Policy Category. Make sure to enable both.

AD object attribute changes are captured in Event ID 5136: A directory service object was modified which is part of the above Subcategory.

Enable Auditing to all Users via GPO or manually for a small number of users.

For a single user go to ‘Advanced’ security setting, Auditing. Add ‘Write all properties’.


Disclaimer: 
All software and the information is provided “AS IS” with no warranties. Use at your own risk! Please test it in a Lab environment first!




Monday, April 13, 2015

BlackBerry BES 12 Management Pack for SCOM 2012 R2


Update:

Thanks all for your feedback.

<<<For those asking for a customized MP, you can email me directly if you wish to "brand" this or any MP with your company name instead of "MundoSCOM".>>>.


This management pack is for monitoring BlackBerry Enterprise Server version 12.

This MP is designed for BES 12 servers that have been upgraded from BES version 5. This setup is done in order to manage BlackBerry legacy and BB10 devices.

(Link to download xml file below)

Console View:



Discoveries:

This management pack uses a seed class that searches for the following registry key:
HKLM\SOFTWARE\Wow6432Node\BlackBerry\BES12.


 Monitored BES and BES12 Services:



NOTE: All Monitors are enabled by default. In a Cluster setup, monitors for services set to ‘Manual’ could be disabled in order to avoid alerts from the passive node when servers are rebooted.


Distributed Application:



Disclaimer: 
The Management Pack and the information is provided “AS IS” with no warranties. Use at your own risk!

Link:



Thursday, April 9, 2015

SCOM 2012 R2 Command Notification Channel using PowerShell Fails


This issue may be common but I couldn't find any information on the different SCOM blogs hence I decided to post it.

Problem:
I added a second Management Server (MS) to my lab management group.
I have some Command channels that execute different PowerShell scripts copied locally on the RMSe which are triggered by an event rule.
The trigger rule was being generated successfully but the PowerShell scripts did not get executed.

Solution:

1. The new MS is automatically added to the “Notification Resource Pool” therefore it needs the same scripts copied locally. (Same folder structure for both MS servers)





2. The Notifications account needs appropriate permission on the folder/share where these scripts are stored to execute them.




3.  To maintain the same information on both Script shares I have created a batch file with a Robocopy command which is executed weekly via a Scheduled Task




       Command in Batch file:
       robocopy "C:\SCOM\ScriptFolder" "\\MS2\C$\SCOM\ScriptFolder" 
       /E /ZB /X /PURGE /COPYALL /TEE /LOG:E:\Copy_from_HD_to_Ext_HD.log

       Meaning of switches used in above command explained below

         /E :: copy subdirectories, including Empty ones.     

        /ZB :: use restartable mode; if access denied use Backup mode.

       /COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).

       /PURGE :: delete dest files/dirs that no longer exist in source.

       /X :: report all eXtra files, not just those selected.

      /TEE :: output to console window, as well as the log file.

      /LOG:file :: output status to LOG file (overwrite existing log).



      Thanks to ITBloggerTips for posting this very useful Robocopy command!!

     http://itbloggertips.com/2013/05/robocopy-command-copy-only-new-changed-files-sync-both-the-drive/


Disclaimer:
The information is provided “AS IS” with no warranties. Use at your own risk!


SCOM and Orchestrator Voice Notification Solution with Twilio and Automys

SCOM and Orchestrator Voice Notification Solution with Twilio and Automys. Cherry Picking SCOM alerts… Problem: Issue # 1 : Spam (a...