locked
Dynamically create script based 3 state performance monitor in scom via c# code RRS feed

  • Question

  • hi..

    how can i create script based 3 state performance monitor in scom through(via) c# code?

    i want to create alert from this monitor when its state changed.

    i got one sample code from this link;

    http://msdn.microsoft.com/en-us/library/bb437626.aspx 

    but it not help me, i want code for script based 3 state monitor.

    any one help me with sample code or link.

     

    regards

    satheesh

    Wednesday, June 29, 2011 12:10 PM

Answers

  • you would need to write a management pack that contains this monitor.  You can write the management pack in XML, or in C# by manipulating an XML DOM, or in C# by manipulating the SCOM server SDK or the offline SDK that ships with the R2 authoring console.

    It's confusing what you mean by dynamic.  Once you create a management pack, you then import it, and it will need to discover or target things that exist, and then this will activate the monitor in the correct server/agent context.  If you need to change the script, or the parameters to the monitor, you can either delete the MP and recreate it and re-import it as a different MP, or you can create overrides (by writing an MP with C# that contains override elements) and have the behavior of the earlier imported monitor change due to parameter shifts.


    Microsoft Corporation
    • Marked as answer by Vivian Xing Friday, July 8, 2011 10:17 AM
    Wednesday, June 29, 2011 3:31 PM
  • I wouldn't make it that hard on yourself by trying to do this with C#, if you're skilled in C# you'll easily create an MP with PowerShell scripts by reading the Authoring Guide.

    http://technet.microsoft.com/en-us/library/ee957010.aspx

    • Marked as answer by Vivian Xing Friday, July 8, 2011 10:17 AM
    Thursday, June 30, 2011 4:58 PM

All replies

  • you would need to write a management pack that contains this monitor.  You can write the management pack in XML, or in C# by manipulating an XML DOM, or in C# by manipulating the SCOM server SDK or the offline SDK that ships with the R2 authoring console.

    It's confusing what you mean by dynamic.  Once you create a management pack, you then import it, and it will need to discover or target things that exist, and then this will activate the monitor in the correct server/agent context.  If you need to change the script, or the parameters to the monitor, you can either delete the MP and recreate it and re-import it as a different MP, or you can create overrides (by writing an MP with C# that contains override elements) and have the behavior of the earlier imported monitor change due to parameter shifts.


    Microsoft Corporation
    • Marked as answer by Vivian Xing Friday, July 8, 2011 10:17 AM
    Wednesday, June 29, 2011 3:31 PM
  • I wouldn't make it that hard on yourself by trying to do this with C#, if you're skilled in C# you'll easily create an MP with PowerShell scripts by reading the Authoring Guide.

    http://technet.microsoft.com/en-us/library/ee957010.aspx

    • Marked as answer by Vivian Xing Friday, July 8, 2011 10:17 AM
    Thursday, June 30, 2011 4:58 PM
  • hi,..

    thanks for ur comments..

     

    regards

    satheesh

    Friday, July 1, 2011 10:11 AM