Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We are going to leverage a Recovery Script recovery script in an Action Profile action profile to Start start the Windows Service. This will be a very simple script. We are going to service. You can leverage two key components built into Uptime Infrastructure MonitorUIM:

  • First, the ability to create a script on the

...

  • UIM monitoring station that directs a UIM Agent to perform an action. In fact, the

...

  • monitor agent exposes a method to the UIM

...

  • monitoring station to

...

  • start a Windows service and you simply need to supply the Windows

...

  • service name.
  • Second, the use of

...

  • recovery script variables (variables available when creating

...

  • recovery scripts). These are variables handed

...

  • in to our script by

...

  • UIM.

Here is what the Recovery Script recovery script looks like:

Code Block
languagesql
@ECHO OFF

...


agentcmd.exe -s -p 9998 %UPTIME_HOSTNAME% svc_start \"%UPTIME_SERVICENAME%\" Changeme2

Some items to note:

  • %UPTIME_HOSTNAME% is the name of the system raising the

...

  • alert, also the system where you want to restart the Windows

...

  • service.
  • %UPTIME_SERVICENAME% is the name of the

...

  • service monitor we created earlier. Note that this is why we needed the

...

  • service monitor name to match the Windows

...

  • service Display Name.
  • The \

...

  • may look strange, but this

...

  • character makes sure that the whole Windows

...

  • service name gets included regardless of spaces.
  • Changeme2 is the

...

  • UIM monitor agent password in this environment, so note that your environment

...

  • differs.

This script is saved to the Scripts directory on the Uptime Infrastructure Monitor Monitoring Station (defaultthe UIM monitoring station at the default location: C:\Program Files\uptime software\uptime\scripts).

For the sake of brevity we will skip the remaining details. However, however, if you want more information you can find it online, here . Here are two key articles: Creating an Action Profile Recovery Script (for the purposes of this article focus on the Monitoring Station Script).

Create an action profile

Lastly, we need to tie the Service Monitor and Recovery Script together in an Action Profile. Follow these steps:

...