This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Add the name of the service to an alert

Hello,

I'm setting up an alert in Advanced alerts and I'm having problems locating a variable for Net Service Name.  I'm alerting on Components and I thought I could use the ComponentAlert.ProcessName variable but I have occurrences where it's blank.

pastedImage_1.png

  • Hi Sean,

    That value is derived from the Value column in the APM_ComponentTemplateSetting table. I don't think that every value is populated, it will only show if you've configured your component in a specific way.

    - David

  • Thanks ctlswadmin!  I really appreciate it. 

  • Could someone elaborate on this a little?  I am trying to pass the "Net Service Name" in an alert to an "External Program" (Power Shell script) and am having a hard time getting anything usable.  I could add the service name as a custom property but I would like to have more flexibility with what I am doing.  When I look into the table mentioned above I only find topics on how to build an application alert, and tags. 

    In short my goal is to restart a service/services on a remote server.  Here is my current "External Program" path with a non-working example for -service:

    APM/Powershell.exe -file "c:\svc_scripts\Restart_Any.ps1" -computer ${N=SwisEntity;M=Node.SysName} -service  ${N=SwisEntity;M=ApplicationAlert.ComponentsName}

    I have a log being generated in my script that shows what is being passed.

    Thank you for any help.

  • Hey Mikemc, have you been able to figure this out ?

  • I appreciate this is an old thread but in case anyone else finds it helpful, I ended up using ${N=SwisEntity;M=ComponentAlert.UserDescription} in the Alert message to get the service name. 

    For restarting the service, https://support.solarwinds.com/SuccessCenter/s/article/Monitor-alert-and-restart-a-Windows-service-from-SAM details how.

  • hey GCow, Not incorrect on the service restart, but it only works when the service is actually stopped. If its hung or trying to restart it wont work. I'm working with PowerShell to do what the original post is attempting and the .UserDescription is blank a lot. A more robust way of doing it would be to get the process name ${N=SwisEntity;M=ComponentAlert.ProcessName}, then pass that to PowerShell and start it that way. Solarwinds grabs that pretty easily. thoughts? Dave B