8 Replies Latest reply on Feb 12, 2019 12:25 AM by jyi

    Starting and stopping of service through AF

    sachin_kumar_s

      Is it possible to start/stop any of the pi related services through the AF?

      or any other PI related application?

        • Re: Starting and stopping of service through AF
          Lal_Babu_Shaik

          Hi Sachin

           

          You can use PI SMT(System Management Tools) to start and stop PI services. Please make sure you have permission to do the same.

           

          SMT--> Operation--> PI services

           

            • Re: Starting and stopping of service through AF
              sachin_kumar_s

              Hi Lal babu,

               

              We are trying automatically Start/stop the services. So that we do not have to log in to the system and start/stop the service every time.

               

              Thanks,

              Sachin.

                • Re: Starting and stopping of service through AF
                  Lal_Babu_Shaik

                  Hi Sachin

                   

                  Service failure /stop can occur due to many reasons. It is always recommended to know the root cause of the issue before restart the service else it mail fail again.  If you are planning to automate service restart then use Powershell to start and stop the service and you may to schedule the script to check the service and start accordingly.

                   

                  Start-Service

                   

                  If you want to start/stop a service based on certain value in PI/AF then you can use PI Powershell to check the value and excute Start-Service accordingly. Please make sure you hare having permission to start and stop service using powershell.

                  1 of 1 people found this helpful
              • Re: Starting and stopping of service through AF
                sraposo

                Hi Sachin,

                 

                You could do it in AF programmatically by using a custom data reference. What's the use case though? What are you trying to do?

                 

                Thanks,

                Seb

                1 of 1 people found this helpful
                  • Re: Starting and stopping of service through AF
                    sachin_kumar_s

                    Hi seb,

                     

                    What we are trying to do is that, whenever a service gets stopped we need to get it started automatically. So that we do not have to log in to the system and start the service.

                     

                    We are trying to do it through any PI related application(Reason being we may not have access to all the windows application whereas we have access to all PI application).

                     

                    And could you elaborate on what you meant by AF programmatically by using a custom data reference.

                     

                    Thanks,

                    Sachin.

                      • Re: Starting and stopping of service through AF
                        Eugene Lee

                        You have to be careful with permissions if you use CDR since it takes the access rights of the end user. i.e. your end user might not have the appropriate permissions to start/stop services.

                         

                         

                        Reason being we may not have access to all the windows application

                         

                        if you do not have admin access, chances are you might run into problems when you try to start/stop services. You have to ensure that each end user has the right permissions.

                        2 of 2 people found this helpful
                        • Re: Starting and stopping of service through AF
                          sraposo

                          Hi Sachin,

                           

                          There is a recovery configuration for every windows service. I think the best short term solution here would be to restart the service if a failure occurs. You can see this in services.msc. For example:

                           

                           

                          As Lal suggested, if a service stops, the best approach is to identify why the service stopped. This can be done by looking into the logs of the application or if the service is crashing capture a crash dump using a postmortem debugger such as ProcDump. This way you could prevent the service from stopping/crashing in the future.

                           

                          If a service is critical for production and can never be stopped, the recommended approach is to configure either fail over or high availability depending on the product.

                           

                          I wouldn't configure this type of service recovery using PI software as it isn't designed to do this.

                           

                          Thanks,

                          Seb

                          2 of 2 people found this helpful
                          • Re: Starting and stopping of service through AF
                            jyi

                            Please contact our techsupport line if you are having continuous service stoppage. Manually/forcefully restarting the services are never a good answer. There will be a bigger reasons why it breaks down in the first place.

                            Most PI Services are designed to run all the time. There are a few services that run on-demand and/or by a trigger. So if one of below services include the one you are manually restarting, then please contact our support people!

                            PI Server-Verify that the corresponding PI services are running

                            1 of 1 people found this helpful