HP dx7200 HP Client Management Interface Technical White Paper - Page 20
WScript.Echo Err.Number, Err.Description, Err.Source
View all HP dx7200 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 20 highlights
Case 5 strReturn = "Invalid Parameter" Case 6 strReturn = "Access Denied" Case Else strReturn = "..." End Select WScript.Echo "SetSystemDefaults() returned: (" & oReturn _ & ") " & strReturn Monitoring Events Monitoring system health events is one of the more advanced aspects of the HP Client Management Interface. The approach to monitoring event presented here is designed to illustrate the capabilities of the interface, however, in an enterprise environment a more robust event consumer model would be recommended to monitor events without impacting system resources. HP CMI supports semi-synchronous and asynchronous event notifications. For more information on WMI event consumers, consult the Microsoft WMI SDK. on error resume next strService = "winmgmts:\\" strComputer = "." strNamespace = "\root\WMI" strQuery = "select * from HPBIOS_BIOSEvent" set objWMIService = GetObject( strService & strComputer _ & strNamespace ) set events = objWMIService.ExecNotificationQuery( strQuery ) if err 0 then WScript.Echo Err.Description, Err.Number, Err.Source end if WScript.Echo "Waiting for CMI Events..." WScript.Echo "Press Ctrl-C to exit." WScript.Echo "" Dim strCategory Dim strSeverity Dim strStatus Counter = 1 do ' Note this next call will wait indefinitely. set CMIEvent = events.nextevent if err 0 then WScript.Echo Err.Number, Err.Description, Err.Source Exit Do else Select Case CMIEvent.category Case 0 strCategory = "Unknown" Case 1 strCategory = "Configuration Change" Case 2 strCategory = "Button Pressed" Case 3 strCategory = "Sensor" Case 4 strCategory = "BIOS Settings" Case Else strCategory = "..." 20