How to find SCOM web console servers

Hi ,
Today we will be finding the scom management servers that has the web console feature installed

Go to Monitoring tab
Click Discovered Inventory
On the Task pane , click change target type
type web console watcher
You can see Web console watcher target type
select it and give ok
The servers with web console role will be shown in the discovered inventory

Management Pack Structure

Many of use used to create advanced management packs using MP Author
Have anyone got chance to read the lines in the MP we created.
If you see the .XML file of MP , you can see the structure of that MP
> Whats the difference in creating a management pack in Operations Console and MP author

Answer :

MP created in operations manager console will have the reference management pack from the current setup of operations manager itself

While in MP author you can select the reference management packs for a MP

So when you are importing a MP , the reference management packs in the mp should already be present in the operations manager where you are importing

Reference management pack differs from each version of operations manager

If you wanna see this , open the XML version of a MP using notepad and there you can see the MP’s used as reference management packs in below section


Powershell HTML Table Color

# Create header for HTML Report

$Head = “<style>”
$Head +=”BODY{font-family:Calibri,sans-serif; font-size: small;}”
$Head +=”TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse; width: 98%;}”
#$Head +=”TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#ff0000;color:white;padding: 5px; font-weight: bold;text-align:left;}”
#$Head +=”TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#ff0000; padding: 2px;}”
$Head +=”</style>”
$values = 1,2,3,4,5

$thold = 3

$output += “<table><th style = ‘text-align:left;’>Values</th>”

foreach ( $i in $values)
{

if ($i -le 3)

{

$output += “<tr><td style = ‘border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#ff0000; padding: 5px;’>Lower</td></tr>”

}
else
{

$output += “<tr><td style = ‘border-width: 1px;padding: 0px;border-style: solid;border-color: black;padding: 5px;’>Upper</td></tr>”

}
}

$output += “</table>”

# Close the Body of the Report
$output += “</body>”

# Send Final Report by email…

Write-Host “Emailing Report”
$SMTPServer =””
$Body = ConvertTo-HTML -head $Head -body “$output”
$SmtpClient = New-Object Net.Mail.SmtpClient($smtpServer);
$mailmessage = New-Object system.net.mail.mailmessage
$mailmessage.from = “”
#$mailmessage.To.add(“”)
#$mailmessage.To.add(“”)
$mailmessage.to.add(“”)
# Want more recipient’s? Just add a new line
#$mailmessage.To.add(“anotherrecipient@company.com”)
$mailmessage.Subject = “Disk Space Check Report”
$MailMessage.IsBodyHtml = $true
$mailmessage.Body = $Body
$smtpclient.Send($mailmessage)

State Change Event – Clean Up

SCOM state change event grooming should happen as per the settings present in the database grooming settings

SCOM Console ->Administration ->Settings -> General ->Database Settings

The grooming process should remove unnecessary data in the operations manager to maintain performance

as per the settings , scom should groom the state change event data of monitors older than 1 day for example

To confirm this we need to run the sql query in operationsmanagerdb

“SELECT DATEDIFF(d, MIN(TimeAdded), GETDATE()) AS [Current] FROM statechangeevent”

If the value of the output is greater than the value set in the scom database grooming settings

then grooming is not happening as expected

To clean up the older data , we need to run below sql query in operationsmanagerdb

USE [OperationsManager]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
BEGIN

    SET NOCOUNT ON

    DECLARE @Err int
DECLARE @Ret int
DECLARE @DaysToKeep tinyint
DECLARE @GroomingThresholdLocal datetime
DECLARE @GroomingThresholdUTC datetime
DECLARE @TimeGroomingRan datetime
DECLARE @MaxTimeGroomed datetime
DECLARE @RowCount int
SET @TimeGroomingRan = getutcdate()

    SELECT @GroomingThresholdLocal = dbo.fn_GroomingThreshold(DaysToKeep, getdate())
FROM dbo.PartitionAndGroomingSettings
WHERE ObjectName = ‘StateChangeEvent’

    EXEC dbo.p_ConvertLocalTimeToUTC @GroomingThresholdLocal, @GroomingThresholdUTC OUT
SET @Err = @@ERROR

    IF (@Err 0)
BEGIN
GOTO Error_Exit
END

    SET @RowCount = 1  

    — This is to update the settings table
— with the max groomed data
SELECT @MaxTimeGroomed = MAX(TimeGenerated)
FROM dbo.StateChangeEvent
WHERE TimeGenerated < @GroomingThresholdUTC

    IF @MaxTimeGroomed IS NULL
GOTO Success_Exit

    — Instead of the FK DELETE CASCADE handling the deletion of the rows from
— the MJS table, do it explicitly. Performance is much better this way.
DELETE MJS
FROM dbo.MonitoringJobStatus MJS
JOIN dbo.StateChangeEvent SCE
ON SCE.StateChangeEventId = MJS.StateChangeEventId
JOIN dbo.State S WITH(NOLOCK)
ON SCE.[StateId] = S.[StateId]
WHERE SCE.TimeGenerated < @GroomingThresholdUTC
AND S.[HealthState] in (0,1,2,3)

    SELECT @Err = @@ERROR
IF (@Err 0)
BEGIN
GOTO Error_Exit
END

    WHILE (@RowCount > 0)
BEGIN
— Delete StateChangeEvents that are older than @GroomingThresholdUTC
— We are doing this in chunks in separate transactions on
— purpose: to avoid the transaction log to grow too large.
DELETE TOP (10000) SCE
FROM dbo.StateChangeEvent SCE
JOIN dbo.State S WITH(NOLOCK)
ON SCE.[StateId] = S.[StateId]
WHERE TimeGenerated < @GroomingThresholdUTC
AND S.[HealthState] in (0,1,2,3)

        SELECT @Err = @@ERROR, @RowCount = @@ROWCOUNT

        IF (@Err 0)
BEGIN
GOTO Error_Exit
END
END   

    UPDATE dbo.PartitionAndGroomingSettings
SET GroomingRunTime = @TimeGroomingRan,
DataGroomedMaxTime = @MaxTimeGroomed
WHERE ObjectName = ‘StateChangeEvent’

    SELECT @Err = @@ERROR, @RowCount = @@ROWCOUNT

    IF (@Err 0)
BEGIN
GOTO Error_Exit
END
Success_Exit:
Error_Exit:
END

Output will be the below message if the query execution is successful

“Command(s) completed successfully.”

Now verify still how many days state change event data is present by running this sql query

“SELECT DATEDIFF(d, MIN(TimeAdded), GETDATE()) AS [Current] FROM statechangeevent”

It should be days set in grooming + current day(1)

 

Rules and monitors of a agent computer

In this topic i will show how to find rules and monitors running on a agent computer successfully in SCOM 2012

In operations manager console

Go to  Monitoring workspace

In monitoring navigate to operations manager view

in this view open agent details view

click agents by version then type the server name in Look for box and give find now

in the right side pane click “Show running rules and monitors for this health service”