cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

APM - Group Alert - Restart a service

Jump to solution

I have an alert set up that needed all components to be set before the alert is triggered..

This was accomplished by createing a group that had all the components in it. The group was set only when all individual components were triggered..

My delema is this..

I have a group level alert that say yes we are active.. it triggers the email I need, writes the log i want , but I also need  it to restart a service. the service that is down or hung is the cause for the individual issues (components) being in a warning state.

Normally the process would be to have a trigger condition to execute a program  the executable would be as below..

C:\Program Files\Solarwinds\Orion\APM\APMServiceControl.exe ${ComponentId}

Becuase a group level alert does not allow components to be referecend.. how can I trigger the restart.. ?

0 Kudos
1 Solution

is this the proper syntax.. ?

C:\Program Files (x86)\Solarwinds\Orion\APM\APMServiceControl.exe 156849

with the"156849" comming from

http://orion/Orion/APM/MonitorDetails.aspx?NetObject=AM:156849

View solution in original post

0 Kudos
9 Replies
Product Manager
Product Manager

There are two possible solutions. You could use the APMServiceControl.exe and pass the numerical value of the component ID of the service you wish to restart instead of the variable. The component ID can be found in the URL when you're on the component details page. It's the number after "AM:" highlighted below 

Another option would be to use something like PsService from Microsoft to start the service on the remote computer. You can even list multiple services in a batch file if you're not sure which service needs to be started. There's no harm in sending a service start command to an already started service. It will be safely ignored and only the service or services that are stopped will be restarted.

I am now trying to get APM to restart the SNMP service at a set time interval (regardless of the current status) using the Advanced Alert Manager. I have built an advanced alert with the following Trigger:

The ANY group may be unnecessary, but I am trying to make sure the alert action takes place regardless of the current status of the targeted component.

The Trigger Action is:

The details of the Execute Program action are:

447 is the ComponentID of the SNMP monitor on a remote server.

The problem is that I get the alert email indicating that the SNMP service has been restarted, but when I check the event logs on the target server, I find no evidence that the SNMP service was restarted.

Any ideas where I am going wrong? Any help would be greatly appreciated, as this is a priority task for me.

0 Kudos

Sorry, I botched the images attachments. Here they are:

0 Kudos

another one:

0 Kudos

and finally:

0 Kudos

lets open another thack.. we can get this done cleaner there..

basically your trigger condition and the trigger action can be cleaned up just a bit to allow for this..

0 Kudos

is this the proper syntax.. ?

C:\Program Files (x86)\Solarwinds\Orion\APM\APMServiceControl.exe 156849

with the"156849" comming from

http://orion/Orion/APM/MonitorDetails.aspx?NetObject=AM:156849

View solution in original post

0 Kudos

Hello,

this is help for service control:

 

Usage:

   APMServiceControl ComponentId [-h] [-c=COMMAND-NAME] [-t=TIMEOUT]

 

Options:

   ComponentId        The id of the Windows Service Component Monitor to 

                      control.  In the Advanced Alert Engine, you can use 

                      the alert variable ${{ComponentId}} to determine this 

                      value.    

   -c=COMMAND-NAME    The command to send to the service.  This must be 

                      START, STOP, or RESTART.  The default is {0}.

   -t=TIMEOUT         Timeout for command in seconds.  Default is 

                      {1} seconds.

   -h                 This help text.

 

Example:

 

   APMServiceControl 37 -c=RESTART

 

or from an APM Component Alert Trigger:

 

   APMServiceControl ${{ComponentId}} -c=RESTART

 

so in your case proper syntax would be:

APMServiceControl.exe 156849 -c=RESTART

0 Kudos