Hi!,

You are targeting Acme.Application.AppServerRole  How are that class defined? 
Is it derived from Microsoft.SystemCenter.NTService?

If not, the statement 
$Target/Property[Type="Microsoft.SystemCenter.NTService"]/DisplayName$ has no 
meaning at all.

/Henrik

Fra: [email protected] [mailto:[email protected]] På 
vegne af Orlebeck, Geoffrey
Sendt: 25. november 2015 19:19
Til: '[email protected]'
Emne: [msmom] Alert Parameter Replacement: Service Name

All:

Goal: Get the Service Name passed as a parameter into the Alert Description. I 
have the server name working, but whatever I try for the service name results 
in blank output.

Issue:
I am authoring an unit monitor in Visual Studio using 
"Windows!Microsoft.Windows.CheckNTServiceStateMonitorType"). The alert 
parameter 
"$Target/Property[Type="Microsoft.SystemCenter.NTService"]/DisplayName$" 
results in a blank output in the Alert Description. I created a service monitor 
in the SCOM console and exported that to XML in order to determine what Alert 
Parameter is being used-and it's the one listed above. However, when I am 
insert it into my MP, the Alert Parameter is blank in the Alert Description 
when the alert is generated. Below is the relevant MP code (scrubbed).


<ManagementPackFragment SchemaVersion="2.0" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <Monitoring>
    <Monitors>
      <UnitMonitor ID="Acme.Application.Monitor.Spooler.ServiceRunning" 
Accessibility="Public" Enabled="true" Target="Acme.Application.AppServerRole" 
ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" 
Priority="Normal" 
TypeID="Windows!Microsoft.Windows.CheckNTServiceStateMonitorType" 
ConfirmDelivery="false">
        <Category>AvailabilityHealth</Category>
        <AlertSettings 
AlertMessage="Acme.Application.Monitor.Spooler.ServiceRunning.AlertMessage">
          <AlertOnState>Error</AlertOnState>
          <AutoResolve>true</AutoResolve>
          <AlertPriority>Normal</AlertPriority>
          <AlertSeverity>MatchMonitorHealth</AlertSeverity>
          <AlertParameters>
            
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
            
<AlertParameter2>$Target/Property[Type="Microsoft.SystemCenter.NTService"]/DisplayName$</AlertParameter2>
          </AlertParameters>
        </AlertSettings>
        <OperationalStates>
          <OperationalState ID="Running" MonitorTypeStateID="Running" 
HealthState="Success" />
          <OperationalState ID="NotRunning" MonitorTypeStateID="NotRunning" 
HealthState="Error" />
        </OperationalStates>
        <Configuration>
          
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
          <ServiceName>Spooler</ServiceName>
          <CheckStartupType>true</CheckStartupType>
        </Configuration>
      </UnitMonitor>
    </Monitors>
  </Monitoring>
  <Presentation>
    <StringResources>
      <StringResource 
ID="Acme.Application.Monitor.Spooler.ServiceRunning.AlertMessage" />
    </StringResources>
  </Presentation>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString 
ElementID="Acme.Application.Monitor.Spooler.ServiceRunning">
          <Name>Service Running: Acme Print Spooler</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString 
ElementID="Acme.Application.Monitor.Spooler.ServiceRunning.AlertMessage">
          <Name>Acme Spooler service is not running</Name>
          <Description>The {1} service is currently stopped on 
{0}.</Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>



Confidentiality Notice: This is a transmission from Community Hospital of the 
Monterey Peninsula. This message and any attached documents may be confidential 
and contain information protected by state and federal medical privacy 
statutes. They are intended only for the use of the addressee. If you are not 
the intended recipient, any disclosure, copying, or distribution of this 
information is strictly prohibited. If you received this transmission in error, 
please accept our apologies and notify the sender. Thank you.




Reply via email to