Service Monitor

<< Click to Display Table of Contents >>

Navigation:  ELM Console (MMC) > Monitoring and Management > Agents and Monitors Library > All Monitors >

Service Monitor

Service Monitor items monitor services and devices on Windows computers. The Monitor will trigger Actions when a service or device state changes (e.g., running to stopped, stopped to started, etc.). Service Monitor items also allow you to take action and/or be notified of services or devices that are set to Automatic startup but aren't running.

If a service or device is set to manual startup and its state changes from started to stopped, the Event Log Message that is generated is a Warning message. If a service or device is set to automatic startup and its state changes from started to stopped, the Event Log Message that is generated is an Error message.

If you have a service or device that is set to Automatic startup but not running, the Service Monitor item will generate an event to notify you about this condition. If you want to be repeatedly notified about this condition, put a check in the box labeled Execute configured Action(s) at every scheduled interval for AutoStart services that are stopped. This will cause the designated actions to be executed at each scheduled interval

Note
A checkmark will not cause repeated action if a service or device is set to Manual startup and is not running. Repeated action is executed with this checkmark only when the service or device is set to Automatic startup and is not currently running.

Add Service

To add a service or device, enter the service or device name in the Service field. Wildcards are supported in this field. To monitor all services and devices enter an asterisk (*). You can use other Boolean operators, such as and (&) and Not (!). The Service Monitor looks for matches based on both the display name (long name) and the internal name (short name) of a service or device. For example, the long name of the Windows Web service is World Wide Web Publishing and its short name is W3SVC. If a service's long name or short name matches the filter, it is added to the internal list of services and devices to monitor.

Since both names are monitored, to exclude a service requires matches for both names. For example, to exclude the Windows Web service, enter strings that matches both its names.  Service names can be entered on separate lines for exclusion.  For example:

!*World*Wide*Web*Publishing*

!*W3SVC*

Actions

Running (Informational) 5530 - A service state has changed to a started status.

Stopped (Error) 5528 - A service state has changed to a stopped status.

Stopping (Error) 5529 - A service state has changed to a stopping (stop pending) status.

Starting (Informational) 5531 - A service state has changed to a starting (start pending) status.

Paused (Warning) 5573 - A service state has changed to a paused status.

 

Run Command

Each Action also has an associated Run Command that is able to execute a script after a state change has occurred. Here is an example cmd script to restart failed services on a Service or Virtual agent:

:: Restart Failed Service on Service Agent or Virtual Agent

:: If the computer being monitored is the local computer

:: use NET START, otherwise use SM.EXE to restart

:: the service on the remote computer

if "%COMPUTER%"=="" goto failed

if "%SERVICE%"=="" goto failed

:: Check to see if the failed service is on the

:: local computer or a remote computer

if /I "%COMPUTER%"=="%COMPUTERNAME%" goto do_local

if /I NOT "%COMPUTER%"=="%COMPUTERNAME%" goto do_remote

:do_remote

SM.EXE \\%COMPUTER% "%SERVICE%" /START

goto finished

:do_local

NET START "%SERVICE%"

goto finished

:failed

echo A required environment variable is not defined. >.\Error.log

echo The service cannot be re-started. >>.\Error.log

goto finished

:finished

:: End

Monitory Category

Displays the Monitoring Categories to which the Monitor item is assigned. Click to select or deselect Monitoring Categories. Click New to create or Properties to Edit Monitoring Categories.

Agents

Displays the Agents to which the Monitor item is assigned.  Click to select or deselect individual agents. Click New to deploy an agent or Properties to View/Edit an existing agent.

Schedule

Displays the Scheduled Interval and Scheduled Hours settings which control the frequency for the Monitor Item.

Scheduled Interval tab

Specify the interval at which the monitoring, polling or action is to occur. Depending on the Monitor Item type, Items can be scheduled in interval increments of Seconds, Minutes, Hours and Days. The Scheduled Interval is relative to the top of the hour or top of the minute. For example, if a Scheduled Interval is configured for 10 minutes, the Monitor Item will execute at hh:10:00, hh:20:00, hh:30:00, hh:40:00, hh:50:00, h1:00:00, etc. If a Scheduled Interval is configured for 15 seconds, the Monitor Item will execute at hh:00:15, hh:00:30, hh:00:45, hh:01:00, hh:01:15, etc.

Scheduled Hours tab

Select the days and/or hours this item is active. By default, the schedule is set to ON for all hours and all days. Mouse clicks toggle squares between ON and OFF. Clicking on an individual square will toggle the active schedule for that hour. Clicking on an hour at the top of the grid, or on a day of the week at the left of the grid will toggle the corresponding column or row. Keyboard equivalents are the arrow keys and the space bar.