Using Summarizers to Determine the Health of a Site
Summarizers are summary classes that help you determine the health, or status, of different aspects of your Microsoft® Systems Management Server (SMS) site. The summaries, which are produced from status messages, states, and counts, give you a real-time view of the health of SMS sites, components, packages, and advertisements.
For example, you can determine the overall health of your site using the stoplight status value in the SMS_SummarizerSiteStatus class, or you can determine the health of your storage objects using the SMS_SiteSystemSummarizer class. You can access these and other classes by getting, enumerating, and querying summarizer objects. However, the SMS_ComponentSummarizer and SMS_SiteDetailSummarizer classes can only be queried — you cannot get or enumerate these objects. Your queries must include a tally interval that defines the period of time from which you want summary information. For more information on using the tally intervals in your query, see Determining a Tally Interval.
The following example shows you how to get the stoplight value status of a site.
_bstr_t bstrPath; _bstr_t bstrSiteCode = L"\"<sitecode>\""; _variant_t vStatus; IWbemClassObject *pinstSiteStatus = NULL; bstrPath = L"SMS_SummarizerSiteStatus.SiteCode=" + bstrSiteCode; hr = pServices->GetObject(bstrPath, 0, NULL, &pinstSiteStatus, NULL); pinstSiteStatus->Get(_bstr_t(L"Status"), 0, &vStatus, NULL, NULL); pinstSiteStatus->Release(); switch(vStatus.lVal) { case 0: //ENUM_GREEN: //do something break; case 1: //ENUM_YELLOW: // do something break; case 2: //ENUM_RED: // do something break; }