8.21 ServiceDown

Use this Knowledge Script to detect whether a discovered service is running. You can run this script for most services, including SQL Server services, Exchange Server services, and IIS services. Use the NT_ServiceDown Knowledge Script to check other services, such as WinLogon or NetIQms, which are not included in the Navigation pane or the TreeView.

This script raises an event if any monitored service is not running and can automatically restart the down service.

8.21.1 Resource Objects

Windows computer or Windows application service

8.21.2 Default Schedule

The default interval for this script is Every 5 minutes.

8.21.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Event Notification

Raise event if service is stopped?

Select Yes to raise an event if the status of a monitored service is “stopped.” The default is Yes.

Event severity when service is stopped

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the status of a monitored service is “stopped.” The default is 18 (yellow event indicator).

Event severity when service cannot be started

Set the event severity level, from 1 to 40, to indicate the importance of an event in which this script is unable to start a stopped service. The default is 5 (red event indicator).

Raise event if service is started?

Select Yes to raise an event if this script successfully starts a stopped service. The default is unselected.

Event severity when service is started

Set the event severity level, from 1 to 40, to indicate the importance of an event in which this script successfully starts a stopped service. The default is 25 (blue event indicator).

Raise event if service is missing?

Select Yes to raise an event if a service that was found during a previous discover cannot be found. The default is unselected.

Event severity when service is missing

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a discovered service is missing. The default is 8 (red event indicator).

Raise event if service is disabled?

Select Yes to raise an event if a service is stopped and is disabled. The default is unselected.

Event severity if service is disabled

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a service is stopped and is disabled. The default is 12 (yellow event indicator).

Raise event if service is shut down normally?

Select Yes to raise an event if a service was stopped as a result of a stop request, such as a stop request issued by a user or as a result of another service being stopped. The default is Yes.

This parameter takes effect only when the Only restart service if shut down normally? parameter is disabled.

Event severity when service shut down normally

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a service was stopped as a result of a stop request. The default is 30 (blue event indicator).

Event severity when job fails

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the ServiceDown job fails. The default is 5 (red event indicator).

An event is raised for circumstances under which the script fails to run properly.

Data Collection

Collect data for service status?

Select Yes to collect data for charts and reports. When enabled, data collection returns one datastream for each service you are monitoring, and, for each monitored service, one datastream covering all dependent services.

For monitored services, the data detail message includes the service name, the start type, and the status. If a monitored service is up, a value of 100 is returned. If the service is down, a value of 0 is returned. If the service is down and the Knowledge Script successfully restarts the service, a value of 50 is returned.

For services depending on the monitored service, the data detail message includes service names, and the start type and status of each service. If all dependent services are up, a value of 100 is returned; if any dependent service is down, a value of 0 is returned.

The default is unselected.

Monitoring

Start stopped services?

Select Yes to start a service that is not running. The default is Yes.

Number of seconds to wait for service start

Specify the number of seconds this script should attempt to start a service before timing out. The default is 30 seconds.

NOTE:If the service fails to start within the timeout period, an event is raised if the Raise event if service is down? parameter is set to Yes. The severity of the event is determined by the Event severity when service cannot be started parameter.

Start dependent services?

Select Yes to start any service that depends on other services started by this script. For example, if this script starts the MSSQLSERVER service, it will also start the dependent SQLSERVERAGENT service. The default is Yes.

Restart service if shut down normally?

Select Yes to restart a service that was stopped as a result of a stop request, such as a stop request issued by a user or as a result of another service being stopped. The default is Yes.