Return to section contents
This example assumes the use of the UNIX/Linux Authoring Library example MP. For more information on creating and building the MP authoring project, see Getting Started. This example demonstrates monitoring of CIM property, retrieved through a WS-Man Enumeration. In this case, the PercentUserTime property of the SCX_UnixProcessStatisticalInformation class is evaluated for the process instance with the name: mydaemon, with a “Greater Than” threshold evaluation. For additional information about the UnitMonitorType used in this example, as well as other WS-Man Enumeration monitor types, review the documentation of the following Monitor Types in the Unix.Authoring.Library Module Reference:
Note: contents located between pairs of ## characters should be customized for your environment. This includes ID and property values. Be sure to remove the ## characters before building the MP. <ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<
ManagementPackFragment
SchemaVersion
=
"2.0"
xmlns:xsd
"http://www.w3.org/2001/XMLSchema"
>
Monitoring
Monitors
UnitMonitor
ID
"##MyMP.WSManEnumGreaterThan.Monitor##"
Accessibility
"Internal"
Enabled
"true"
Target
"##MyMP.MyCustomRole##"
ParentMonitorID
"Health!System.Health.AvailabilityState"
Remotable
Priority
"Normal"
TypeID
"UnixAuth!Unix.Authoring.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType"
ConfirmDelivery
"false"
Category
>AvailabilityHealth</
AlertSettings
AlertMessage
"MyMP.WSManEnumGreaterThan.Monitor.AlertMessage"
AlertOnState
>##Warning##</
AutoResolve
>true</
AlertPriority
>Normal</
AlertSeverity
>##MatchMonitorHealth##</
AlertParameters
AlertParameter1
##$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$##
</
AlertParameter2
>##$Data/Context/Value$##</
OperationalStates
OperationalState
"StatusOK"
MonitorTypeStateID
HealthState
"Success"
/>
"StatusWarning"
"Warning"
"StatusError"
"Error"
Configuration
Interval
>300</
TargetSystem
$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$
Uri
##http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_UnixProcessStatisticalInformation?__cimnamespace=root/scx##
WSManFilter
>##Select Name,PercentUsedMemory,PercentUserTime from SCX_UnixProcessStatisticalInformation##</
ObjectName
>##Process##</
CounterName
>##Percent User Time##</
InstanceXPath
##/DataItem/WsManData/*[local-name(.)='SCX_UnixProcessStatisticalInformation']/*[local-name(.)='Name'] ##
InstanceName
>##mydaemon##</
FilterExpression
Not
Expression
Exists
ValueExpression
XPathQuery
Type
"String"
>WsManData/ErrorCode</
Value
##$Data/WsManData/*[local-name(.)='SCX_UnixProcessStatisticalInformation']/*[local-name(.)='PercentUserTime']$ ##
WarningThreshold
>##10##</
ErrorThreshold
>##20##</
NumSamples
>##2##</
Presentation
StringResources
StringResource
"##MyMP.WSManEnumGreaterThan.Monitor.AlertMessage##"
LanguagePacks
LanguagePack
"ENU"
IsDefault
DisplayStrings
DisplayString
ElementID
Name
>##mydaemon Percent User Time Monitor##</
Description
>##Monitors the Percent User Time of the process: mydaemon and generates an alert if the warning or error threshold is exceeded. ##</
>##mydaemon Percent User Time is too high##</
>##The Percent User Time for the mydaemon process on the host: {0} is greater than the threshold. The Percent User Time is: {1}##</
SubElementID
>StatusOK</
>StatusWarning</
>StatusError</