8 Replies Latest reply on Feb 15, 2017 3:34 AM by Donna Coles

    Determine who has enabled server schedules

    Donna Coles

      We have 2 servers in our production environment.  A primary server which is the main server and a secondary 'standby' server which is ready to go in the event of failure to the primary.  Each night the content from the primary server is backed up and restored to the secondary sever.  As part of this process a small script is run on the secondary server to disable all the server schedules that are by default enabled on the primary server.  This is because we don't want all the various extracts being duplicated on the secondary server by running at the same time and causing contention.

       

      This a process that we've been doing successfully for several years now and all has continued to run as expected since our server upgrade to v10.1.1 in January.

       

      Until last night...

       

      This morning I came into work to find duplicated emails in my inbox which made me suspicious that the schedules on the secondary server were enabled and running.  And so they were.  I have since disabled them again.  I'm trying to get to the bottom of how they got re-enabled. I am convinced someone inadvertently re-enabled them manually though the UI but no one is saying as such.  So I'm wondering if there's any activity log anywhere that may show me what happened.  I don't think there's anything in postgres from an audit point of view.  I've taken a snapshot of the server logs, but don't really know where to start looking.

       

      Steps I have already checked are

      1) verify the back & restore task with the 'disabling script' all completed as expected

      2) checked that following a server reboot, the schedules didn't enable themselves (our secondary server was patched last night with some windows update and then rebooted; this happened after the backup and restore and is an 'exception' to the usual nightly processing, and consequently making me suspicious...).

       

      Any thoughts welcome

      Thanks

      Donna

        • 1. Re: Determine who has enabled server schedules
          Jeff Strauss

          This is intriguing.  How do you script the disable the schedules?  I've always wanted to do this!

           

           

          In terms of looking for who, you may be able to tap into historical_events with a type 52, 53, 54.  And it should show record of who did what...

           

          2 of 2 people found this helpful
          • 2. Re: Determine who has enabled server schedules
            Donna Coles

            Thanks Jeff - will have a look there.

             

            To disable the schedules, we run this script on the postgres database

            UPDATE schedules SET active=FALSE WHERE hidden=FALSE;

            (we had to ensure the user had write access to db though of course.. shhhh)

             

            The above is stored in a .sql file on the Tableau server, and then we reference it at the end of a powershell script we run each night which calls the tabadmin backup /restore commands.  Script attached. Its slightly out of date as we're using v10 now, so the filepaths aren't correct.  We also have a process for capturing the password encrypted in another file, that the script has to read in and decrypt. HOpefully its enough to give you the idea though.

            • 3. Re: Determine who has enabled server schedules
              Donna Coles

              So I've had a look in historical_events and the mystery deepens from my point of view.  I can see the events relating to me disabling the schedules this morning, but nothing suggesting they were manually enabled, so can only assume my suspicions were wrong and they didn't get enabled by someone... ho hum.. will just have to wait to see what happens tonight....

              • 4. Re: Determine who has enabled server schedules
                Jeff Strauss

                lol.  As long as it works;  I thought I may have missed a tabcmd or REST API command to do it the more "sanctioned" way.  The user that you are using, does it have rights after the restore?  The restore process overlays all overridden grants on the PG.  The only way I can see this is if you are using the admin account.

                • 5. Re: Determine who has enabled server schedules
                  Donna Coles

                  ahh sorry - yeah we started having to make these minor tweaks to the backend db due to lack of sanctioned processes (I'll hunt out an idea fo this and create one if not).

                   

                  The account we're using is the same one that runs the application on the server, so I'm assuming that is what you would refer to as the admin account (sorry I'm a bit of an 'inbetweener'... I'm server admin but without full server/network access.. have another team who look after all that :-)).

                   

                  I believe the process has been running fine since the upgrade as I'm sure I would have noticed a bit more contention on our back end data warehouse when the big extracts run.  The main reason I noticed it this morning was because of the duplicate emails being sent due to the subscription tasks being duplicated.  I'm wondering though whether something about the patching done last night and the reboot may have 'fixed' an unknown issue we didn't know we had with emailing... clutching at straws....  am going to see what tomorrow brings before I go any further.

                  1 of 1 people found this helpful
                  • 6. Re: Determine who has enabled server schedules
                    Donna Coles

                    Idea already exists and I'd already voted... https://community.tableau.com/ideas/1792  ..4 years old.... *sigh*

                    • 7. Re: Determine who has enabled server schedules
                      Gerardo Varela

                      Here is the idea for it and similar workarounds in the comments.

                       

                      https://community.tableau.com/ideas/1792

                       

                      Sadly, this idea only has 25 votes. 

                       

                      Regards,

                      Gerardo

                      • 8. Re: Determine who has enabled server schedules
                        Donna Coles

                        Just to close the loop on this.. the process last night worked as expected, with the script disabling the schedules on our passive server after the backup & restore.  So mystery remains and am convinced it was manual intervention though I have no evidence to support as such.  Now filed away in my 'low prioirty list that is unlikely to be looked at again' :-)