3 Replies Latest reply on Oct 15, 2019 8:56 AM by serena

    Windows Services Monitoring

    alex81

      Hi All,

       

      Not sure if anyone of you has encountered such a request before.

       

      Basically, i got a bunch of workstations that needs to have a particular service but the issue is that the service name is not uniform.

       

      What I mean by not uniform is that the same name would have the machine name behind.

       

      E.g - abc-agent-computer01 , abc-agent-computer99

       

      Is there anyway that we can use a powershell script to monitor all the servers using just the first few words. In this case, it's abc-agent*

       

      Appreciate all the help.

       

      regards,
      Alex

        • Re: Windows Services Monitoring
          serena

          alex81  wrote:

           

          Hi All,

           

          Not sure if anyone of you has encountered such a request before.

           

          Basically, i got a bunch of workstations that needs to have a particular service but the issue is that the service name is not uniform.

           

          What I mean by not uniform is that the same name would have the machine name behind.

           

          E.g - abc-agent-computer01 , abc-agent-computer99

           

          Is there anyway that we can use a powershell script to monitor all the servers using just the first few words. In this case, it's abc-agent*

           

          Appreciate all the help.

           

          regards,
          Alex

          Certainly! SAM provides the ability for you to use the powershell script monitor for monitoring, and by using the Get-Service command you can quickly grab the status of the windows servers. Get-Service  You could apply the application monitor across servers, by using a dynamic group and that would allow you to apply this across multiple non uniform monitored servers.

            • Re: Windows Services Monitoring
              alex81

              Hi Serena,

               

              Could you please share the script?

               

              I believe using get-service servicename would work on local machine but not via powershell.

               

              My understanding is that solarwinds require a error code / Exit Code for this.

               

              Do correct me if I am wrong on this aspect.

               

              regards,

              Alex

                • Re: Windows Services Monitoring
                  serena

                  alex81  wrote:

                   

                  Hi Serena,

                   

                  Could you please share the script?

                   

                  I believe using get-service servicename would work on local machine but not via powershell.

                   

                  My understanding is that solarwinds require a error code / Exit Code for this.

                   

                  Do correct me if I am wrong on this aspect.

                   

                  regards,

                  Alex

                  Hi Alex,

                  I don't have a script handy, but there are example powershell scripts that are available on your orion installation. If you navigate to: C:\Program Files (x86)\SolarWinds\Orion\APM\SampleScriptMonitors\PowerShellScripts, you'll see 2 examples that you can modify for your own use.