I tried to update properties of a object in Web Application Availability Monitoring in SCOM Server by using SDK, value in database is changed, but
value on Operation Manager Console is not changed.
Could you give a suggestion or show me a another way to changing property for it?
Below code is detail information for changing “test frequency” property to 4567:
1.C# Code :
public void Change()
{
ManagementPack mp = GetManagementPackByName("Microsoft.SystemCenter.WebApplicationSolutions.Library");
ManagementPackClass requestClass = mp.GetClass("Microsoft.SystemCenter.WebApplicationSolutions.SingleUrlTest");
IObjectReader<EnterpriseManagementObject> reader;
var criteria = new EnterpriseManagementObjectCriteria("", requestClass);
reader = mg.EntityObjects.GetObjectReader<EnterpriseManagementObject>(criteria, ObjectQueryOptions.Default);
foreach (var item in reader)
{
EnterpriseManagementObjectProjection projection = new EnterpriseManagementObjectProjection(item);
if (item.DisplayName == "HaiWAT")
{
//Change property for object
projection.Object[requestClass, "IntervalInSeconds"].Value = 4567;
projection.Overwrite();
}
}
}
2.To verify value changed in database, I use SQL Query
SELECT TOP 1000 [ManagedEntityPropertyRowId]
,[ManagedEntityRowId]
,[PropertyXml]
,[DeltaXml]
,[FromDateTime]
,[ToDateTime]
,[DWCreatedDateTime]
,[DWLastModifiedDateTime]
FROM [dbo].[ManagedEntityProperty]
WHERE
CAST(PropertyXml AS VARCHAR(MAX)) LIKE '%HaiWAT%'
AND (CAST(PropertyXml AS VARCHAR(MAX)) LIKE '%4567%' )
From result for this query, click on PropertyXml column to view xml content :
<Root>
<Property
Guid="AFB4F9E6-BF48-1737-76AD-C9B3EC325B97">microsoft
page [MPSDVMOLSCOM.redmond.corp.microsoft.com]</Property>
<Property
Guid="11927069-6957-DFCF-A277-08A784221325">ACDCEDB7-100C-8C91-D664-4629A218BD94</Property>
<Property
Guid="6916F554-56BC-7576-7BBF-041EA88A6A1F">4567</Property>
<Property
Guid="3C8A48D4-97FA-59E9-5E92-7071257875CF">1</Property>
<Property
Guid="70268268-00E8-6426-FC52-75CD0974F42C">HaiWAT</Property>
<Property
Guid="B32B63AE-7D02-0EC7-8852-B066EEDF4AF9">94c42855-be18-e4a6-a4c8-f4be72a4c5d9</Property>
<Property
Guid="720EF4AA-ACB6-29CA-318C-BD9AEBDD07DB">1</Property>
<Property
Guid="59EC4EB8-BB19-CA4C-7E2A-C4E371012203"><TestConfig
version="1.0"><Requests><Request><RequestID>1</RequestID><URL>http://www.microsoft.com</URL><HttpHeaders><HttpHeader><Name>Accept</Name><Value>*/*</Value></HttpHeader><HttpHeader><Name>Accept-Language</Name><Value>en-us</Value></HttpHeader><Htt</Property>
<Property
Guid="28398B92-E7D6-DE9D-D3F2-D0682153E640"><Parameters><Parameter
name="URL">http://www.microsoft.com</Parameter></Parameters></Property>
<Property
Guid="88E1C043-2612-71FC-690E-EB47736DE37C">a96e1e1c-8892-4d3b-81a4-a46fa4323d76</Property>
</Root>
We can view on DeltaXml column as well
<Root>
<Property
Guid="6916F554-56BC-7576-7BBF-041EA88A6A1F">
<NewValue>4567</NewValue>
<OldValue>1234</OldValue>
</Property>
</Root>
Thank you,
Henry