4 Replies Latest reply on Aug 28, 2018 11:51 PM by kbj3030

    Alerts for all Tableau Server Components

    kbj3030

      Hi All,

       

      Do we have any setup or any external tools for receiving alerts if any of the Tableau Server component goes down. I see viz-alerts for Vizql server but my requirement is to receive an alert for all components.

       

      Request you to please suggest on the same. Thanks

        • 1. Re: Alerts for all Tableau Server Components
          Andrew Bickert

          Hi Trinadha,

           

          I use a powershell script to check the status of the server every 15 minutes and then send me an alert if it is degraded or something is down. It has worked well for us so far.

           

          Andrew

           

           

          ######################################################
          #                    This Script                    #
          #  Checks to see if the Services for Tableau Server #
          #      Are down and sends an email if they are      #
          ######################################################

          #Note: Need to change the path and directory if using different version of Tableau Server, this
          #    is set up for 2018.1, plans to code out automatic switching in future.

          #Variables for moving status off server and attachment
          $path = "C:\Program Files\Tableau\Tableau Server\2018.1\bin\status.txt";
              #Path_Test is a status file that had down Services to server as testing of SMTP functionality and text reading
              #$path_test = "C:\Program Files\Tableau\Tableau Server\2018.1\bin\status1.txt";
          $move_location = "\\backup location"

          #Directory for Tabadmin if not already mapped to Command Prompt
          $directory = "C:\Program Files\Tableau\Tableau Server\2018.1\bin"

          #SMTP Server Information
          $SMTP_Server = "MAILSERVER"
          $SMTP_Port = "25"

          #Account information if required
          $Username = ""
          $Password = ""

          #Runs the Tabadmin Status and writes to location
          cd $directory
          .\tabadmin.bat status -v >status.txt

          #Moves status file off of Server (Optional, for future development in Desktop)
          Copy-Item $path -Destination $move_location

          #Checks to see if any Services are 'STOPPED'
          If( (Get-Content -Path $path | Where-Object {$_ -match 'STOPPED'})-eq $null)
          {""}
          else
          {
          #Sends Email if a Service is 'STOPPED' with Status document attached
             
              $ServiceDown = (Get-Content -Path $path | Where-Object {$_ -match 'STOPPED'})
              $All_Services = (Get-Content -Path $path);
              $email = to@domain.com
              $message = new-object Net.Mail.MailMessage;
              $message.From = "Tableau_Server@domain.com";
              $message.To.Add($email);
              $message.Subject = "Tableau Server: Services Down: " + $ServiceDown;
              $message.Body = "Stopped Services: " + "`n" +$ServiceDown + "`n"+ "`n"  + "List of All Services (See attached): "+ "`n"+ "`n" + $All_Services;
              $attachment = New-Object Net.Mail.Attachment($path);
              $message.Attachments.Add($attachment);

              $smtp = new-object Net.Mail.SmtpClient($SMTP_Server,$SMTP_Port);

              #If SSL then enable below line
              #$smtp.EnableSSL = $true;

              #If using credentials from above then enable below line
              #$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);

              #If using Windows credentials then enable below line
              #$smtp.Credentials = New-Object System.Net.NetworkCredential(Get-Credential);

              $smtp.send($message);
              $attachment.Dispose();

          }

          1 of 1 people found this helpful
          • 2. Re: Alerts for all Tableau Server Components
            kbj3030

            Hi Andrew,

             

            Thanks for sharing the script. Will this script sends a mail even if one component is down?

            • 3. Re: Alerts for all Tableau Server Components
              Andrew Bickert

              Hi Trinadha,

               

              Yes, if any of the services show as 'stopped' it will send out the alert. Here is an example of an alert that we received before:

               

              -------------------

              Stopped Services:

              'Tableau Server Coordination Service 0' (12400) is
              stopped. 'Tableau Server Backgrounder 0' (14048) is stopped.

               

              List of All Services (See attached):

               

              Status: DEGRADED 'Tableau Server Data Engine' (14136) is
              running. 'Tableau Server Coordination Service 0' (12400) is stopped. 'Tableau
              Server Search and Browse 0' (10652) is running. 'Tableau Server Tabadmin
              Service 0' (13968) is running. 'Tableau Server Application Server 0' (648) is
              running. 'Tableau Server Backgrounder 0' (14048) is stopped. 'Tableau Server
              CacheServer 0' (14244) is running. 'Tableau Server Dataserver 0' (11160) is
              running. 'Tableau Server Vizqlserver 0' (10324) is running. 'Tableau Server
              Gateway' (8340) is running. 'Tableau Server Cluster Controller' (9808) is
              running. 'Tableau Server Repository' (1268) is running (Active Repository).
              'Tableau Server File Store' (10044) is running.

               

              ---------------------

               

              *Note, I am working on a similar one for TSM for 2018.2 but haven't finished as we are just now testing 2018.2 in our Non-Prod environment so this only script only works with 2018.1 and earlier

               

              Andrew

              • 4. Re: Alerts for all Tableau Server Components
                kbj3030

                Thanks alot Andrew. Really helpful. Please share your thoughts on 2018.2 once done with the testing. I would like to hear on that version as well.