8 Replies Latest reply on Feb 15, 2018 10:57 PM by alanR

    AF Analysis Service Stop

    alanR

      What happens to the Notification System should the analysis service stop ? And what would be the appropriate workaround, would it be to create an AF analysis watchdog that can send out notifications when an analysis has not operated as planned. What you have other people done to workaround/solve this?

       

      Thanks,

        • Re: AF Analysis Service Stop
          daneoverfield

          Hi Alan,

           

          TopView Alarm and Notification software has a version for Windows performance counters and ping times - TopView PerfMon. This should allow you to monitor any AF performance counters as well as existing counters within the OS (process information, etc.). TopView PerfMon has a free version that allows monitoring up to 5 points.

          4 of 4 people found this helpful
          • Re: AF Analysis Service Stop
            sraposo

            Hi Alan,


            I'm assuming that you are running Notifications 2016 R2  or later  (referred to as Notifications from this point on) that are triggered off AF Event Frames.

             

            To be clear, Notifications are sent based off AF Server Event Frames. The PI Analysis Service can be used to generate Event Frames. If the PI Analysis Service were to stop, it would stop generating Event Frames and therefore Notifications would not get triggered on the "missing" event frames that aren't being generated.

             

            To monitor and notify users of  this situation using Analysis Service and Notifications alone isn't possible because we would need the analysis service to be functional.

             

            Dane Overfield offered a really good method of doing this.

             

            An alternative could be to use PowerShell. You could configure a scheduled task to run a .ps1 script that retrieves the Peformance Counter values at an interval of time apart for "\PI Analysis Service\AFValues Written", checks if it is has changed, if it hasn't sends an email to a user.

             

            As a very simplified example:

             

            $Values = Get-Counter -Counter "\PI Analysis Service\AFValues Written" -SampleInterval 120 -MaxSamples 2

             

            $V1 = $Values.CounterSamples.CookedValue[0]

            $V2 = $Values.CounterSamples.CookedValue[1]

             

            If ($V1 -eq $V2){

            $smtpClient = new-object System.Net.Mail.SmtpClient “mail.mailserver.com”, 25

            $smtpClient.TimeOut = 30000

            $smtpClient.useDefaultCredentials = $true

            $smtpClient.Send(“FromEmail@mail.com”, “ToEmail@mail.com”, “Analysis stopped outputting values”, “Investigate”)

            }

             

             

             

            The above is just a simplified example. To have this deployed in production, at a minimum, you would need to:

             

            • Add some error handling (try/catch and output to a log file)
            • Determine the correct SampleInterval for you
            • Determine the frequency at which the scheduled task runs
            • Thoroughly test and validate

             

            Hope this helps,

            Seb

            2 of 2 people found this helpful
              • Re: AF Analysis Service Stop
                alanR

                Hi Sebastian,

                 

                Thank you for all that information. What happens to those notifications that have not been sent , due the AF Analysis Service stopping? Are they cache so that will sent later. is there another way of sending them ?

                 

                Thanks,
                Alan

                  • Re: AF Analysis Service Stop
                    sraposo

                    Hi Alan,

                     

                    The PI Analysis Service never skips over creating Event Frames. It's possible that Event Frame analyses are lagging which would cause Notifications to be sent out late.

                     

                    In case of service downtime, as Roger Palmen's pointed out, Auto Backfilling, if enabled (default is Enabled,  default max period is last 72 hours), will create the "missing" event frames and Notifications will pick them up and notify users of these events.

                     

                    Thanks,
                    Seb

                    2 of 2 people found this helpful
                • Re: AF Analysis Service Stop
                  Roger Palmen

                  To some degree the Auto Backfilling https://livelibrary.osisoft.com/LiveLibrary/content/en/server-v10/GUID-2B4D156F-8895-4DA0-BD60-78153BE2AE16 should recover any notifications you missed:

                   

                  AutoBackfillingEnabled:This property enables or disables automatic backfilling of gaps in data that result from periods when PI Analysis Service is not active. Automatic backfilling is enabled by default.

                   

                  But that requires that you restart the service in the first place and then you need to know it stopped. So some monitoring is still required.

                  4 of 4 people found this helpful
                  • Re: AF Analysis Service Stop
                    alanR

                    How can i confirm that specific analyses are running/not running?

                      • Re: AF Analysis Service Stop
                        sraposo

                        Hi Alan,

                         

                        Easiest way is in PI System Explorer > Management Tab. You can use the filters to find your specific analyses. The filters have gotten much better over the years. Depending on what version you have, you will have different filters.

                        You can also navigate to the element itself, then navigate to the analysis tab and see if it's running from there.

                         

                        Hope this helps,

                        Seb