Hi,
How can I retrieve the Alert ID (GUID) through SCOM console? Is it possible?
Thanks!
Where to retrieve Alert ID
December 11th, 2009 7:46pm
From the SCOM console, don't think so.
If you are using powershell then get-alert will retrieve all alert properties of all alerts (which will include the id).
get-alert -criteria 'ResolutionState = ''0'''| select id, principalname, name to get the id, name of server and name of alert
What are you trying to do? You can have a powershell task in the console so that you select an alert and "do something else" - you can pass the alert id. I have used this:
$alert = get-alert -criteria "Id = '$($Args)'" | select id, principalname, Name, Owner
to have a task that sends an email to someone containing the information specified.
But it would help to understand your requirements.
Cheers
Graham
If you are using powershell then get-alert will retrieve all alert properties of all alerts (which will include the id).
get-alert -criteria 'ResolutionState = ''0'''| select id, principalname, name to get the id, name of server and name of alert
What are you trying to do? You can have a powershell task in the console so that you select an alert and "do something else" - you can pass the alert id. I have used this:
$alert = get-alert -criteria "Id = '$($Args)'" | select id, principalname, Name, Owner
to have a task that sends an email to someone containing the information specified.
But it would help to understand your requirements.
Cheers
Graham
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2009 8:02pm
Thanks! I am exploring SCOM SDK and would like to get information around an alert. The easiest way to get an alert is through ManagementGroup.GetMonitoringAlert(GUID alertID). It's aPITY that SCOM console doesn't expose alert ID. Now, I am just querying the Database directly to get the alert ID. Powershell is definitely another work around.
December 11th, 2009 8:15pm
Powershell is (imo) probably the preferred option over querying the database. Just be careful to query the views rather than the underlying tables in the database as the table schema may change while there is more of an obligation to keep the views consistent.
There are lots of resources on Powershell and Marco Shaw is on the Extensibility site with assistance on powershell:
http://social.technet.microsoft.com/Forums/en-US/operationsmanagerextensibility/threads
Good Luck
Graham
There are lots of resources on Powershell and Marco Shaw is on the Extensibility site with assistance on powershell:
http://social.technet.microsoft.com/Forums/en-US/operationsmanagerextensibility/threads
Good Luck
Graham
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2009 8:22pm
Thanks! I agree. Since I am working with a test SCOM environment and SQL management studio on my desktop can connect to the SCOM DBs directly, querying the DBs is just handy.
December 11th, 2009 8:32pm
A good resource for all things SCOM (including SQL queries) is Kevin Holmans blog:
http://blogs.technet.com/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx
Have fun
Graham
http://blogs.technet.com/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx
Have fun
Graham
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2009 8:38pm
Thanks for the plug Graham. Also - I have a handy cross reference spreadsheetwhich links up the database table values, db views,sdk/powershell, notification variables,and the connector values:
http://blogs.technet.com/kevinholman/archive/2009/09/23/alert-notification-subscription-variables-and-linking-that-to-the-console-database-and-sdk.aspx
From that spreadsheet - you can see that you can put the alert ID in your notifications at least.
$Data/Context/DataItem/AlertId$
http://blogs.technet.com/kevinholman/archive/2009/09/23/alert-notification-subscription-variables-and-linking-that-to-the-console-database-and-sdk.aspx
From that spreadsheet - you can see that you can put the alert ID in your notifications at least.
$Data/Context/DataItem/AlertId$
December 12th, 2009 4:24am
Ya know - using a connector... or a script - you should be able to run on a cycle, and add the alert ID guid to a custom field.
You could even use the notification command channel to run a script that adds this to a custom field. It would just be a bit painful to run a script every time on the RMS for each alert.... especially if you generate a lot of alerts. It would be better to run it on a schedule and just pol for the new alrts that dont have the custom field populated.
You could even use the notification command channel to run a script that adds this to a custom field. It would just be a bit painful to run a script every time on the RMS for each alert.... especially if you generate a lot of alerts. It would be better to run it on a schedule and just pol for the new alrts that dont have the custom field populated.
Free Windows Admin Tool Kit Click here and download it now
December 12th, 2009 8:46pm
And out of curiosity - why would you want the alert ID in the console?
December 12th, 2009 8:47pm
Thanks all for the suggestions!!
We build connector applications and alert ID is the most effective way to trace how an alert is being handled.
Thanks!
We build connector applications and alert ID is the most effective way to trace how an alert is being handled.
Thanks!
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2009 6:58pm
No activity for 30 days. I will close the thread now. Feel free to re-open it.
February 8th, 2010 9:04pm
And out of curiosity - why would you want the alert ID in the console?
Looking into why, why, why there is no alert ID in console, and I was just flabbergasted that Kevin Holman of all people asked this question. Must have been a bad day for him, which is still probably better then most of my good days.
Of course alert ID is a major key in using pws for any alerts. Why wouldn't we need it is a better question?
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2013 9:34am


