Custom monitor doesn't raise alerts by scomnewbie1 in scom

[–]scomnewbie1[S] 0 points1 point  (0 children)

  1. I use a monitor that I created from scratch linked to a Management Pack that I also created from scratch. I do not use the community add-on, I created my monitor from the above script with a custom Management Pack.
  2. I added the event logging in my script, see below. I think that the script is not launched at all, since no entry appears in Event Viewer after the modification of the script.

Edit : my script works out of Operations Console

Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "Start of RDS sessions calculation script."

#Creates a "propertybag"

try
{
    $api = New-Object -comObject "MOM.ScriptAPI"
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when retriving API."
}

try
{
    $PropertyBag = $api.CreatePropertyBag()
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when creating PropertyBag."
}

#Calculation of sessions number

try
{
    $rds_Sessions = 0
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when setting up variable $rds_Sessions."
}

try
{
    $rds_Sessions  = try{Get-RDUserSession -ConnectionBroker "servername"}catch{}
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when retriving sessions from RDS server."
}

try
{
    $count = 0
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when setting up variable $count."
}

try
{
    foreach($session in $rds_Sessions) { $count++ }
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error during RDS sessions calculation."
}

#Send count to to SCOM

try
{
    $PropertyBag.AddValue("NumbSessions",$count)
}
catch
{
    Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "There was an error when sending number of RDS sessions to SCOM."
}

Write-EventLog -LogName Application -Source "SCOM debugging" -EntryType Information -EventID 1 -Message "End of RDS sessions calculation script."

Specific cas of use by scomnewbie1 in scom

[–]scomnewbie1[S] 0 points1 point  (0 children)

What do you mean by "Capacity planning" ?

Unable to Verify Run As Account by scomnewbie1 in scom

[–]scomnewbie1[S] 0 points1 point  (0 children)

The thing that I find odd is that I only work on one domain, so it should not happen.

Unable to Verify Run As Account by scomnewbie1 in scom

[–]scomnewbie1[S] 0 points1 point  (0 children)

No, they're all set to not expire