Showing posts with label Monitor. Show all posts
Showing posts with label Monitor. Show all posts

Thursday, November 28, 2013

[OpsMgr 2012] How to find a specific rule/monitor/discovery in the console - SQL queries / Powershell command ( #SQL #Powershell #OpsMgr #OpsMgr2012 )


Sometimes in the Operations Manager Event log, we have some event/alert  for script error or WMI query error and all the time, the description give your the exact name of the rule/monitor/discovery that cause the issue. In SCOM console, you cannot find the rule/monitor/discovery by their exact name, only by the display name.



For example, here is an event 5500 we have on one server due to an invalid configuration for a monitor: Microsoft.SystemCenter.Agent.HealthService.PrivateBytesThreshold



Log Name:      Operations Manager
Source:        HealthService
Date:          11/28/2013 3:10:43 PM
Event ID:      5500
Task Category: Health Service
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      MyServer.MyDom.Dom
Description:
Frequent state change requests caused the incoming state change request to be dropped due to it being older than the currently recorded state change for this monitor. This could also be due to an invalid configuration for this monitor. 

Affected monitor: Microsoft.SystemCenter.Agent.HealthService.PrivateBytesThreshold
Instance: MyServer.MyDom.Dom
Instance ID: 293C0099-290F-C53C-340E-A5E710CA5B9F
Management Group: MyMgtGroup

Request generated time: 2013-11-28T15:10:43.1658766+01:00
Requested state: Success

Recorded time: 2013-11-28T15:20:35.7827611+01:00
Recorded state Success


To start investigation, you need to retrieve the display name of the rule/monitor/discovery. You can also execute SQL queries on views in the OpsMgrDB or PowerShell commands connected to your management group :

Rules:

SQL:

select DisplayName from ruleview where name = 'Rule.Name'

Command Shell:

(Get-SCOMRule | Where {$_.name -match 'Rule.Name'}).DisplayName

Monitors:

SQL:


select DisplayName from monitorview where Name = 'Monitor.Name'

Command Shell:

(Get-SCOMMonitor| Where {$_.name -match 'Monitor.Name'}).DisplayName

Discoveries:

SQL:

select DisplayName from DiscoveryView where name = 'Discovery.Name'

Command Shell:

(Get-SCOMDiscovery| Where {$_.name -match 'Discovery.Name'}).DisplayName


In our case, powershell command or SQL query give a display name (replace Monitor.Name by Microsoft.SystemCenter.Agent.HealthService.PrivateBytesThreshold in the line) : Health Service Private Bytes Threshold for monitor Microsoft.SystemCenter.Agent.HealthService.PrivateBytesThreshold

We can now retrieve the monitor in the SCOM console and try to investigate the issue  ! :)



This posting is provided "AS IS" with no warranties.

Thursday, June 20, 2013

[OpsMgr 2007R2][OpsMgr 2012] Local Resolution Time monitor in the OpsMgr DNS Management Pack may show unexpected results ( #OpsMgr #SCOM #DNS #MP )


The Operations Manager Engineering Team has published a post on the #DNS Management Pack for #SystemCenterOperationsManager.




When viewing the Local Resolution Time monitor in the DNS#MP for Operations Manager, you may notice that the response time reported does not reflect your own real world results.


Two solutions exist:

1. Configure the DNS service so that it listens only on the IPv4 address. To do this select “Only the following IP addresses:” in the dialog above and choose only the IPv4 address from the list.
Note that disabling IPv6 at the OS level is not recommended as there is no way for us to predict how this may effect your environment. Also, if IPv6 is disabled on Windows Vista, Windows Server 2008 and later versions, some components will not function as expected. See Support for IPv6 in Windows Server 2008 R2 and Windows 7 for more information.

2. The preferred fix for this is to create a reverse lookup zone as well as the associated PTR records on the DNS.
One last note: You can run into the same issue If you don’t have a reverse look up zone for the IPv4 address of the DNS server as well. This is not isolated to IPv6 but rather is a function of the lack of a proper reverse lookup zone on the DNS.




This posting is provided "AS IS" with no warranties.

Thursday, January 31, 2013

[OpsMgr 2007 R2][OpsMgr 2012] Get Rule/Monitor full information from Rule/Monitor name - Powershell script



Today, I've had a request to retrieve all informations for a rule that was generating too much alerts. The rule was give, by it's name and the name was not really user friendly : _08C092E8_FD6F_48b2_BA1E_473C3B84A2F3_.RaiseAlert

Thanks to the Exchange Server 2010 Management pack developper team :)

So I've create a short powershell function to add to my powershell profile :

  1. Function RuleInfo  ([string]$RuleName)
  2. {
  3. get-rule | where {$_.Name -eq $RuleName} | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}}, @{Name="MP Version";Expression={ foreach-object {$_.GetManagementPack().Version }}}, Name, DisplayName, XmlTag, Enabled, Category, Target, ConfirmDelivery, Remotable, Priority, DiscardLevel, ConditionDetection, DataSourceCollection, WriteActionCollection, Id, Description, Comment, Status, LastModified, TimeAdded
  4. }
Then I've launch it in my powershell console using the line :

RuleInfo  _08C092E8_FD6F_48b2_BA1E_473C3B84A2F3_.RaiseAlert

Result is like :



 Well done ! :)


I've also created the same function for monitors :

  1. Function MonitorInfo  ([string]$MonitorName)
  2. {
  3. get-monitor | where {$_.Name -eq $MonitorName} | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}}, @{Name="MP Version";Expression={ foreach-object {$_.GetManagementPack().Version }}}, Name, DisplayName, XmlTag, Enabled, Category, Configuration, Id, ConfirmDelivery, OperationalStateCollection, Target, ParentMonitorID, Remotable, Priority, RunAs, AlertSettings, Accessibility, Description, LanguageCode, Comment, Status, LastModified, TimeAdded
  4. }
Have fun !

This posting is provided "AS IS" with no warranties.