1 Reply Latest reply on Aug 14, 2019 6:19 AM by vrkvvj@solarwinds.com

    Running a program on a specific server on an alert

    imassey

      Hi - apologies if this has been asked before, but I haven't been able to find an answer.

       

      We have an alert set up to monitor whether a certain port is listening on a subset of about fifty of our servers. When alerted, we log onto the server in question and re-register the service to listen on that port.

       

      I would like to be able to set up a trigger action to run a small script that does this for us, but can't work out how to get it to do so on the server that is alerting.

       

      If I place the script in (e.g.) c:\scripts of the poller, I would need to pass the name of the server that is alerting to it or, if I place a copy of the script onto each of the servers, I need to be able to say which server to run it on.

       

      I assume the former is the preferred method, but can't see a way of passing the server name as a variable to the script.

       

      Is it possible?

       

      Thanks

      Ian

        • Re: Running a program on a specific server on an alert
          vrkvvj@solarwinds.com

          Hello imassey-

           

          As per my understanding, you need to execute a script whenever threshold is met adn alert is fired right?

          We have a trigger action named "Execute a Script" and i tried using power shell script which functions perfectly fine for me.

          But i do call API and try to forward the respective alert/event to third party tool.

           

          If you want to execute the script on the same server for which alert has triggered, i may suggest you to check the script for "Top 10 processes for CPU" out-of-box alert where you find the script to check the processes on corresponding server.

           

          Note: I suppose you may know it still i am mentioning that you need to have proper access/permissions to execute the script on server.

           

          Hope this helps