Page History
Table of Contents | ||||
---|---|---|---|---|
|
You can trigger alerts and actions in Uptime Infrastructure Monitor when an Element changes state. This is discussed in the UIM Administrator's Guide here: under Alerts and Actions. Several The following actions are available out - of - the - box:
- Log to File
...
- Recovery Script
...
- Windows Service
...
- SNMP trap
...
The Windows Service service action can Startstart, stop, Stop or Restart restart a Windows Service service identified by name. This is useful when you've created a Service Monitor service monitor using the Windows Service Check monitor to watch for a state change with a specific Windows Serviceservice. A typical scenario would be is to set a Critical Status status if a specified Windows Service service is Stoppedstopped. In this case, you can use the Windows Service service action in Uptime Infrastructure Monitor could be used UIM to automatically try to start the Windows Service service in an attempt to minimize service disruption.
The limitation to leveraging the Windows Service service action on an Action Profile action profile is that the Windows Service to be started service that you want to start must be identified by name. If you have a large number of Windows Services services that could drive an action, you will need to should create a new Action Profile action profile for each Windows Service and ensure service, and then make sure that you tie it to the correct Service Monitorservice monitor. In environments where the number of Windows Services services that fit this scenario is small, this works well. However, in larger environments where the number of Windows Services services that fit this scenario is large, it might be desirable to create a single Action Profile action profile that can restart any Windows Serviceservice.
This article explores how to restart any Windows Service service with an Action Profile action profile as an alternative to creating a specific Action Profile action profile for each Windows Serviceservice.
Create a service monitor
Start by creating a Service Monitor as follows:
...
Your Service Monitor should look something like the image that follows.
Create
...
a recovery script
We are going to leverage a Recovery Script in an Action Profile to Start the Windows Service. This will be a very simple script. We are going to leverage two key components built into Uptime Infrastructure Monitor:
...
Alert Profile and Action Profile Variables (for the purposes of this article focus on the Recovery Script Variables):
Create an action profile
Lastly, we need to tie the Service Monitor and Recovery Script together in an Action Profile. Follow these steps:
...
If you are familiar with Action Profiles you may know that Uptime Infrastructure Monitor has a built in Test Action Profile capability. However, that won't work in our case because the variables we are leveraging only get populated when a Service Monitor is triggered.
...
Important notes
The Windows Service will be started in the security context of the Uptime Infrastructure Monitor agent running on the system where the Windows Service is being started (by default Local System).
...