This monitor runs a script to check Apache configuration, and alerts if warnings or errors are found in the configuration.
There is a configuration problem with the Apache HTTP Server configuration files. The server may not start correctly if it is restarted. This monitor runs the httpd or apache2ctl program with the –t option to validate configuration. An error or warning state is set if the program finds a problem with the configuration.
The configuration (in httpd.conf or an include file) is incorrect. Review the alert message and context for details of the configuration problem.
Resolve the configuration problem that was reported.
Target | Microsoft.ApacheHTTPServer.ManagedServer.Unix | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | ConfigurationHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Oss.ShellScript.Status.ThreeState.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.ApacheHTTPServer.ManagedServer.Unix.ConfigurationCheck.Monitor" Accessibility="Public" Target="Microsoft.ApacheHTTPServer.ManagedServer.Unix" TypeID="Oss!Microsoft.Oss.ShellScript.Status.ThreeState.MonitorType" ParentMonitorID="Health!System.Health.ConfigurationState" Enabled="onStandardMonitoring">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.ApacheHTTPServer.ManagedServer.Unix.ConfigurationCheck.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context///*[local-name()="StdOut"]$</AlertParameter1>
<AlertParameter2>$Data/Context///*[local-name()="StdErr"]$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="StatusOK" ID="StatusOK"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="StatusWarning" ID="StatusWarning"/>
<OperationalState HealthState="Error" MonitorTypeStateID="StatusError" ID="StatusError"/>
</OperationalStates>
<Configuration>
<Interval>14400</Interval>
<TargetSystem>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<Script>
#!/bin/bash
if [ -x "/usr/sbin/apache2ctl" ]
then
result=`/usr/sbin/apache2ctl -t `
fi
if [ -x "/usr/sbin/httpd" ]
then
result=`/usr/sbin/httpd -t `
fi
if [ -x "/usr/local/apache2/bin/apachectl" ]
then
result=`/usr/local/apache2/bin/apachectl -t `
fi
printf "$result"
exit 0</Script>
<ScriptArgs/>
<Timeout>120</Timeout>
<UserName>$RunAs[Name="Unix!Microsoft.Unix.ActionAccount"]/UserName$</UserName>
<Password>$RunAs[Name="Unix!Microsoft.Unix.ActionAccount"]/Password$</Password>
<WarningStatus>[w|W]arn</WarningStatus>
<ErrorStatus>Syntax [E|e]rr</ErrorStatus>
</Configuration>
</UnitMonitor>