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.
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.
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.
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
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.