Reverse monitor a server, alert when it's up not down

We have a situation where we want to be alerted if a normally powered down server is powered up for a set number of days, i.e. if someone forgot to power it back down. Its default state is powered off, only powering on to perform a specific task, then being powered down again.
I was asked to create an alert if it is left powered on.
Was thinking of a simple icmp ping as we need nothing fancier, but still, how to alert when a number of pings succeed rather than fail.
Any ideas?

Hi Ervia

How comfortable are you authoring your own monitoring outside of the SCOM console? You could use ICMP Ping Probe - Microsoft.SystemCenter.ICMPProbe (ProbeActionModuleType) to create a monitor type that looks for a status code of 0 (ping succeeds) as it’s unhealthy condition detection. I don’t have any examples to hand, but I could put something together if you’re not sure how.

Keith

You could monitor the ‘System\System Up Time’ performance counter.

Here is an example:

<UnitMonitor ID="Custom.UnitMonitor.SystemUpTime" Accessibility="Internal" Enabled="true" Target="Windows!Microsoft.Windows.Server.OperatingSystem" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Perf!System.Performance.ThresholdMonitorType" ConfirmDelivery="false">
	<Category>ConfigurationHealth</Category>
	<AlertSettings AlertMessage="Custom.UnitMonitor.SystemUpTime.AlertMessage">
		<AlertOnState>Warning</AlertOnState>
		<AutoResolve>true</AutoResolve>
		<AlertPriority>Normal</AlertPriority>
		<AlertSeverity>MatchMonitorHealth</AlertSeverity>
	</AlertSettings>
	<OperationalStates>
		<OperationalState ID="UnderThreshold" MonitorTypeStateID="UnderThreshold" HealthState="Success" />
		<OperationalState ID="OverThreshold" MonitorTypeStateID="OverThreshold" HealthState="Warning" />
	</OperationalStates>
	<Configuration>
		<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
		<CounterName>System Up Time</CounterName>
		<ObjectName>System</ObjectName>
		<AllInstances>false</AllInstances>
		<Frequency>600</Frequency><!--10 minutes in seconds-->
		<Threshold>86400</Threshold><!--1 day in seconds-->
	</Configuration>
</UnitMonitor>
<Presentation>
	<StringResources>
		<StringResource ID="Custom.UnitMonitor.SystemUpTime.AlertMessage" />
	</StringResources>
</Presentation>
<LanguagePacks>
	<LanguagePack ID="ENU" IsDefault="true">
		<DisplayStrings>
			<DisplayString ElementID="Custom.UnitMonitor.SystemUpTime">
				<Name>System Up Time</Name>
				<Description>Monitors the "System\System Up Time" performance counter to alert when a Windows Server has been up too long.</Description>
			</DisplayString>
			<DisplayString ElementID="Custom.UnitMonitor.SystemUpTime.AlertMessage">
				<Name>System Up Time</Name>
				<Description>Monitors the "System\System Up Time" performance counter to alert when a Windows Server has been up too long.</Description>
			</DisplayString>
			<DisplayString ElementID="Custom.UnitMonitor.SystemUpTime" SubElementID="UnderThreshold">
				<Name>UnderThreshold</Name>
				<Description>UnderThreshold</Description>
			</DisplayString>
			<DisplayString ElementID="Custom.UnitMonitor.SystemUpTime" SubElementID="OverThreshold">
				<Name>OverThreshold</Name>
				<Description>OverThreshold</Description>
			</DisplayString>
		</DisplayStrings>
	</LanguagePack>
</LanguagePacks>

Hi Keith,
The answer is not comfortable at all :slight_smile: It would be great if you could put something together as the idea is great, but creating it is way out of my knowledge.

Hi Ervia

I’ve put an example MP on github. Its pretty simple, but should cover your requirement. Or if it doesn’t the source code should point you in the right direction.

Hope that helps.

1 Like