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


A couple questions:

1. Does the action start or restart a service?  If it only starts, is there a way to trigger a restart or would that be executed differently (ie vbscript)


2. I know ${ComponentID} can be passed in to restart the service, but what is the actual value being used?  Is the service named being pulled from the registry name value? 


I wanted to use APM to check something (that wasn't the actual service) and have the APMServiceControl start a particular service.  Since the service was being passed through the alerting variables, I wanted to know what manual value could be put in.




0 Kudos
10 Replies
Level 13

1.  Yes, the utility can Start, Stop, and Restart a service.  If you run it on the command line with no parameters it will output some help information

2. The utility needs to know what service to act upon, the credentials to use, the server name, etc.  Rather than having to pass all this information on the command line, it simply takes the id of a Windows Service Component Monitor.  As you stated, if this alert is an "APM: Component" based alert then you can just use the ${ComponentID} variable to uses the current component's id.  You can also hard code the id to whatever makes sense for you. i.e.

APMServiceControl 37 -c=RESTART

To determine the component Id, just go to the Component Details View in the Web Console.  The url will look something like this:


The number after "AM:" is the Component Id (11 in this case).

Thank you for the help.  I spent days with Tech support and did not get this good of information.  sometimes it is the little details that make a HUGE difference.

0 Kudos

Great, that worked.  I do have a followup question - which may need it's own thread.

So I have a Web Get setup on our web server.  If the Web Get fails, I want Orion to restart the Web service on the remote server.  Here's what I have setup in the alert:

Trigger Alert when All of the following apply

       -Application Name is equal to WebGet .NET

       -Application Status is equal to Down

       Trigger Alert when all of the following apply

               -Node Name contains IIS

               -Component Name is equal to WS3SVC

I realize the bottom 'Condition Group' may be unneccesary with the way I have it setup.  I have the ${ComponentID} passed into the APMServiceControl, however it is not yielding the correct Component.  When I ran a test, it pulled a component from the correct server, but the wrong Component.

What I did next was delete the incorrect component being pulled and ran the test again.  Same thing happened, only it pulled another incorrect Component. 

Is this a bug or am I setting my alert variables incorrectly?

0 Kudos

The Test Alert functionality does not work correctly with APM Alert objects.   The Test Alert dialog doesn't give you a way to pick a specific Application or Component so it picks one at random from the node you selected.

0 Kudos

Ok, makes sense.  Now, I dunno if this is possible with Orion (maybe I will need to write a script instead), but just want to verify.  With the following Trigger conditions:

*Trigger Alert when all of the following aply:
      -Application Name is equal to WebGet .NET
      -Application Status is equal to Down

For Trigger Actions, I have "C:\Program Files\Solarwinds\Orion\APM\APMServiceControl.exe" ${ComponentID}

Is there a way to set the ComponentID in the Trigger Conditions without being an actual requirement in the alert?  I tried adding:

     -ComponentName is equal to W3SVC

but this did not trigger the alert.  With that line removed, the Trigger Actions will start, however, it is trying to restart the WebGet .NET application instead.  I had an email sent after the first Trigger Action passing in ${ComponentID}.

I know I can put in the ComponentID manually with the number, however, we have this setup for about 50 servers.  We also continuously add/remove servers into the farm.

0 Kudos

No, you can't set the the Component Id.  Without the ComponentName condition, every component will match your alert.  That is why you are getting the "wrong" component Id.  You need to narrow down the alert to just the Component for the service you want to restart. The ComponentName should have worked.

Are you sure the component name is "W3SVC"?  This field might not be the same as the service name.  If you go to the Component Details page for this component, the title will look something like this:

<component_name> for <application_name on <node_name>

Are you using this component name?

0 Kudos

Yes, I am using the that component name.

I have the WebGet alert (an HTTP monitor) because our application will throw errors, but the W3SVC appears to be in normal state.  So when the WebGet throws the error, I wanted Orion to restart the web service (which corrects the webget problem). 

Sounds like I'll need to write a script.

Thanks for your help.

0 Kudos

You mention 50 servers in a prior response. Are these other 50 servers setup the same way and experiencing the similar problem with WebGet? Or are they setup with completely different services that throw errors until W3SVC is restarted? Or do they have different services that produce errors and require the restart of a different service altogether in order function again?

0 Kudos

The servers are all setup the same way where the content is being served through IIS.  Our load-balancer does not detect webget failures and thus bad pages are being served.

The only service being used for this particular function is the W3SVC.

0 Kudos

Ok, if it's just the same service you're looking to restart, couldn't you write a batch file/script to restart the service based on the IP address to pass to it?

0 Kudos