locked
how to delete existing overrides in Mangementpack in scom RRS feed

  • Question

  • hi

    i create one unit monitor in scom with disable.

    afterthat override to enable it. It  created one override entry in MP.

    i want to delete that override entry or tags in Mp through C# code.

    its possible to do this?

    help me with smple code and links

    regards

    satheesh


    Sunday, October 2, 2011 12:52 PM

All replies

  • in oder to delete override you need to set its status "PendingDelete" and then commit changes.
    Managementpack Element Status

    here is powershell example
    http://scompro.wordpress.com/2011/09/14/opsmgr-bulk-overrides-deletion-thru-powershell/

    and SDK example How to Delete Views and Folders which is easy to covert to Overrides deletion.


    Sunday, October 2, 2011 7:52 PM
  • Hi,

    i create override for monitor with specific Instance through c# code.

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

    it created and working fine. Now show as "not monitored" state in monitoring pane.

    aftersumtime i want to enable this monitor and change as to healthy state.

    So here i tried to delete existing overrides(created before sumtime).

    overrideQuery= overrideID used in existing overrides( <value>true</value>).

    c# code(change value to true):

    overrideQuery ="Name like '" + "myovrrideid" + "%." + measures + "'";

    MonitoringOverrideCriteria criteria = new MonitoringOverrideCriteria (overrideQuery);

    ReadOnlyCollection<ManagementPackOverride> managementPackOverrides = managementGroup.GetMonitoringOverrides(criteria);

    foreach (ManagementPackOverride managementPackOverride in

    managementPackOverrides)

    {

    managementPackOverride.Value ="true" ;

    managementPackOverride.Status =ManagementPackElementStatus.PendingDelete;

    }

    managementPack.AcceptChanges();

    here this code working fine without any error.

    but it not effect override in MP, all ovrrides are remaining there. No Ovrrides are deleted from MP. how to delete it from MP?

     help me with sample code and links.

     

    regards

    satheesh  


    Tuesday, October 18, 2011 10:34 AM
  • asking third time the same in three different threads? we hear you :)
    Tuesday, October 18, 2011 11:13 AM