Saturday, 29 August 2015

How to connect to Tableau Server

follow the steps below to connect to and query the database. The username you use will depend on which database views and tables you want to use.
  1. In Tableau Desktop select Data > Connect to Data, then select PostgreSQL as the database to connect to. You may need to install the PostgreSQL database drivers. You can download drivers from www.tableau.com/drivers.
  2. In the PostgreSQL connection dialog box, enter the name or URL for Tableau Server in the Server box. If you have a distributed server installation and a worker is hosting the repository, enter the name of the worker instead. If you are using an Apache load balancer, enter the actual name or ip address of the database server rather than the Tableau Server name.
    You should connect using the port you have set up for the pgsql.port, which is 8060 by default. For more information about ports, see Tableau Server Ports.
    Note: The dbpass command does not open any ports in the firewall. You may need to manually open the port in any firewall between your external client and the Tableau Server database.
  3. Enter workgroup as the Database to connect to.
  4. Connect using one of the following users and the password you specified:
    Username: tableau or readonly
    Password: The password you specified when you enabled access to the Tableau Server database for the specified user
  5. Click Connect.
  6. Select one or more tables to connect to.
    The "tableau" user has access to all of the tables that start with an underscore or with hist_. For example, you can connect to_background_tasks and _datasources. The tables that begin with historical_ point to hist_ tables. The hist_ tables include information about server users that isn't currently presented in the Actions by Specific User view. The "readonly" user has access to additional tables that can be used to query other information about server usage.
  7. Click Go to Worksheet.

Changing Tableau server Password and Providing access to external Users

You can use Tableau Desktop to connect to and query the Tableau Server repository using two special, built-in users. The "tableau" user has access to several database views you can use as part of building your own analyses of Tableau Server activity. The "readonly" user has access to additional database tables that you can use to create views for even more in-depth analysis.
To access the Tableau Server repository, you need to use the tabadmin command line utility to enable external access to the database.
  1. Open a command prompt as an administrator and type:
    cd "C:\Program Files\Tableau\Tableau Server\9.0\bin"
  2. Version 8.2.4 and earlier: Enter the following command to enable external access to the database for the tableau user:
    • tabadmin dbpass [password]
      For example, to enable access for the "tableau" user with a password of "p@ssword":
      tabadmin dbpass p@ssword
    Version 8.2.5 and later: Enter the following command to enable external access to the database for the tableau user or the readonly user:
    • tabadmin dbpass --username [tableau | readonly] [password]
      For example, to enable access for the "tableau" user with a password of "p@ssword":
      tabadmin dbpass --username tableau p@ssword
      or to enable access for the "readonly" user with a password of "p@ssword":
      tabadmin dbpass --username readonly p@ssword
      Note: If no user is specified, dbpass enables access for the "tableau" user.
  3. Restart Tableau Server:
    tabadmin restart
After you've enabled external access to the database, Tableau allows any IP address access to the database as long as the correct password is provided. Follow the steps in Connecting to the Tableau Server Database to connect.

Disable external access to the Tableau Server Database

If you want to disable access by "tableau" or "readonly" after enabling it, use the tabadmin dbpass again.
  • Run the command tabadmin dbpass --disable --username [user] then restart the server.
    For example:
    tabadmin dbpass --disable --username readonly
    tabadmin restart
Note: If no user is specified, the --disable option disables access for the "tableau" user.

Friday, 28 August 2015

Solution Selling means the Whole Solution – Distributor Evolution

Nearly 20 years ago a friend made this comment: “(Industrial) customers don’t want to buy electrical products, they want to buy solutions. If you only sell half of the solution, it’s not really a solution-- it’s a bag of parts.”

At the time, I was squarely in the center of the electrical automation business. And, like most salespeople, everything I didn’t sell was invisible. On a purely intellectual basis, I realized the PLCs, drives, sensors and motion control systems I sold were connected to something, but emotionally, I didn’t care. I had my bag of tricks and my team was better equipped to assist in project layout, troubleshooting and advanced support than any other electrical distributor and I was fat, dumb and happy. But my eyes were opened.

I lost an order.  After the fact, my customer was kind enough to explain the reason why. It seems he felt the mechanical portion of the order was more complex than my fancy sensors. The competitor sold both and during the discussion of the mechanics, he convinced the customer that sensor placement required knowledge of the limitations of the mechanics. He knew about both and would solve the whole problem. It was a déjà-vu moment. It ruined my day, and as I made the trip back to the office, my buddy’s comments banged around in my brain.






I was convinced. I immediately started scanning the horizon for products just outside my selling sphere of influence. I began to realize the need for an understanding of my product’s place in the solution. And, most importantly, I started to explore plans for expanding my percentage of the customer’s total solution.

Since founding River Heights Consulting, I have explored and written about the need for distributors to broaden their product scopes into the whole solution. A few progressive distributors have followed this path. From my point of view, Fluid Power distributors have made the greatest progress; perhaps they were scared into making the move.

Recalling back to the 1990s, fluid power distributors faced-off against massive technological gains in the electronic world. Many of the traditional applications for their motion-centric hydraulic products were being challenged by less costly and feature rich electronic offerings. Many pundits heralded the end of their industry. Scare tactics from experts and feedback from customers drove many of them to develop expertise in motion control outside of their normal portfolio of products. Distributors evolved.


Conjuring up the words of Theodore Levitt, “What business are you really in? The railroads let others take customers away from them because they assumed themselves to be in the railroad business instead of the transportation business.” As distributors we must ask ourselves what business are we in.

Most distributors claim to be in the business of providing customers with solutions. Yet, most limit their solutions to advice and services wrapped around a bundle of products. Progressive distributors view the solution as whatever it takes to really fix the problem.

What should you do? Here are six thoughts to explore:
1. What are the limits of your solutions?
2. What products are invisible to you and your sales team? Just because you don’t sell it doesn’t mean your customers don’t need it.
3. Are there technologies not found on your “linecard” which are commonly used to create the total solution?
4. Do you see competitors with broader based solution capabilities than your organization? Are you willing to eventually hand over your portion of that solution?
5. What technologies (and product sets) will be important to your customers in the future? Will these technologies absorb some of the applications you currently support?
6. Have you asked your customers where they need additional solution support?

Finally, here are a couple of pieces of news:
Cincinnati-based CBT was recently recognized as joining the Top 50 list of Industrial Distributors. CBT used to be called Cincinnati Belt and Transmission. The company now carries a complete line of electrical, automation, pneumatic and power transmission products as well as their old standby belts and conveyor offering.

A recent article in Fluid Power World highlighted the Flodraulic Group. A quote from Bill Tulloch summarizes my
whole point:
“A good industrial distributor now has to integrate multiple technologies. He may be bringing to that customer pneumatics and hydraulics of course, but you’re bringing mechanical, you’re bringing electrical and controls. You have to understand PLCs and how that will control his equipment.”

Read the article here: 

Space and time limitations keep us from exploring dozens of other examples. The point is, morphing to match customer needs makes sound business sense.

Tuesday, 25 August 2015

tabcmd to generate a PDF of a Tableau view and send email messages

To test generating a PDF, type the following command:
tabcmd get "<url-of-view>.pdf" -f "<filename>.pdf"
Notes:
  • Replace <url-of-view> with the view's URL path after it has been published.
  • In versions of Tableau Server earlier than 9.0, ensure that you append <url-of-view> with ".pdf", as in the example above. In Tableau Server 9.0 and later, you do not have to include the filename extension with the <url-of-view> value for PDF files; the command infers that you want a PDF file from the name you provide in the -f parameter.
  • Replace <filename> with the name you want to give to the generated PDF file.
For example, the tabcmd command can look like this:
tabcmd get "/views/Wow/SummaryReports.pdf" -f "progressReport.pdf"
If the PDF generates successfully, tabcmd places the PDF file "progressReport.pdf" in the current working directory.
Note: For Tableau Server 8.1 through 8.3, ensure that you do not include the hash tag (#) and number at the end of the URL. For Tableau Server 9.0 and later, do not include ":iid=<n>."


While the tabcmd by itself cannot send email messages, if you are using Tableau Server 8.0 and later, you can configure email alerts if there is a system failure or subscriptions that allow users to subscribe to their favorite views.  Alternatively, you can easily add this functionality through scripting. Many applications and scripting languages are available, and you can combine the printing automation of tabcmd with practically any other logic. Two examples illustrate this capability.
This example uses email shareware called febootimail.exe (search the Web for "febootimail" for more information). This program allows full control over aspects of the e-mail generation.
Here is an example that sends as an e-mail attachment the PDF progress report you generated in the last example.
tabcmd login -s http://tableauserver:80 -u admin -p admin
tabcmd get "/views/Wow/SummaryReports.pdf" -f "progressReport.pdf"
febootimail.exe -SMTP yourSMTPhost.yourcompany.com -TO "recipient1@yourcompany.com; recipient2@yourcompany.com;recipient3@yourcompany.com" -FROM sender@yourcompany.com -SUBJECT "Generated Tableau View - Tableau Server Automated Alert System (TSAAS)" -ATTACH " C:\Program Files\Tableau\Tableau Command Line\progressReport.pdf" -BODY"this is the text of the body"
Note: For Tableau Server 8.1 through 8.3, ensure that you do not include the hash tag (#) and number at the end of the URL. For Tableau Server 9.0 and later, do not include ":iid=<n>."
If you install febootimail and review its help files, you can note the following:
  • Instead of typing the e-mail addresses of recipients using the TO tag, you can refer to a file.
  • Instead of typing the e-mail body using the BODY tag, you can specify an HTMLFILE tag.
  • You can attach multiple files.
These features provide control over the Tableau generation and e-mail process. Many other applications and scripting languages also have this type of support.

Send formatted email with an embedded image

Tabcmd can generate PNG files, and febootimail.exe can send HTML e-mail. The febootimail help says that the HTML file must be in the same directory as febootimail.
Here is an example script:
tabcmd login -s http://tableauserver:80 -u admin -p admin
tabcmd get "/views/Wow/SummaryReports.png" -f "progressReport.png"
febootimail.exe -SMTP yourSMTPhost.yourcompany.com -TO "recipient1@yourcompany.com; recipient2@yourcompany.com;recipient3@yourcompany.com" -FROM sender@yourcompany.com -SUBJECT "Generated Tableau View - Tableau Server Automated Alert System (TSAAS)" - -HTMLFILE "emailbody.html"
Note: For Tableau Server 8.1 through 8.3, ensure that you do not include the hash tag (#) and number at the end of the URL. For Tableau Server 9.0 and later, do not include ":iid=<n>."
Notice that the BODY tag has been replaced by an HTMLFILE tag. Because tabcmd can auto-generate a PNG image, you can reference that image in the body of an HTML email template. Here is a simple version of this HTML file:
<html>
<head><title>Email Alert</title></head>
<body><img src="progressReport.png"></body>
</html>

Sign in to Tableau Server through Tabcmd (Tableau Server Command Line Tool)

Step 1 

Click the Start button, and select All Programs > Accessories. Right-click the Command Prompt and select Run as administrator.

Step 2 

Type one of the commands below, depending on where the tabcmd utility is running from. If you are running the tabcmd utility from the same machine as Server
  • cd C:\Program Files\Tableau\Tableau Server\<version>\bin
  • cd C:\Program Files (x86)\Tableau\Tableau Server\<version>\bin
If you are running the tabcmd utility on a separate machine from Server:
  • cd C:\Program Files\Tableau\Tableau Server\<version>\extras\Command Line Utility
  • cd C:\Program Files (x86)\Tableau\Tableau Server\<version>\extras\Command Line Utility
Note: Replace <version> with the version of Tableau Server you are running.

Step 3 

Type the following command:
tabcmd login -s http://<host>:<port> -u <username> -p <password>
Notes:
  • Replace <host> and <port> with your specific hostname and port.
  • Replace the <username> and <password> with a valid Tableau Server username and password for someone who has publishing rights.
If the command is executed successfully, you will see something similar to the following example:
C:\tli>tabcmd login -s http://tableauserver:80 -u admin -p password
===== Creating new session
===== Server: http://myserver
=====   Username: admin
===== Connecting to the server...
=====   Signing in...
=====   Auto-sign in to site: Default
===== Creating new session
=====   Server: http://myserver
=====   Username: admin
===== Connecting to the server...
===== Signing in...
===== Succeeded
===== Succeeded

Installing Tableau Server Command Line Tool (Tabcmd)

Tabcmd does not have to be installed on the same machine as Tableau Server. This flexibility makes it highly useful from an administrative and scheduling perspective.

Following steps explains you the installing procedure

Step 1

Go to the tabcmd installer file located in the "extras" folder in the Tableau directory. By default, the folder is located here:
  • C:\Program Files \Tableau\Tableau Server\<version>\extras\TabcmdInstaller.exe
Notes: 
  • Replace <version> with the version number of Tableau Server that you are running. 
  • if you installed 32-bit Tableau Server on a 64-bit operating system, the default path is C:\Program Files (x86)\Tableau\Tableau Server\<version>\extras\TabcmdInstaller.exed

Step 2

Double-click TabcmdInstaller.exe to start the installation process.

Step 3

Follow the steps in the Tableau Server Command Line Utility wizard to install tabcmd.

Notes:
  • Because tabcmd is a command line tool, and due to some limitations with the Windows operating system, Tableau suggests that you install tabcmd to its own folder on the root of the C:\ drive called tabcmd. For example, C:\tabcmd.
  • When you install tabcmdinstaller.exe, Tableau does not automatically add its location to the Windows PATH variable. You will need to either explicitly call tabcmd using its full path, or, add its directory to the PATH variable

Tableau Server Log File Location (Helps to find out actual problem that troubling Tableau Server)

By default, Tableau Server log file archives are gathered in a zip file called logs.zip (you can specify a different name if you create the archive using tabadmin). You can copy the archive from the server to a local computer and open it there, or send it to Tableau Support. When you unzip the archive, a series of folders are created with related log files. This table explains the possible contents of each folder, along with the original location the files came from on the Tableau Server, the process that created the log files, and details about the files.
The Tableau Server log directory is C:\ProgramData\Tableau\Tableau Server\data\tabsvc\logs if you installed Tableau Server on drive C, unless otherwise noted in the table below.

Following list of log file location help you to find out respective log files and its description.

Log Archive File Locations

Files/folders in logs.zip Details Files Generated by Location on Tableau Server
buildversion.txtThe build version of Tableau Server.   
tabsvc.yml   \config
wgserver.checksum    
assetkeyencryptionLogs related to repository encryption.assetkeyencryption.log tabadmin assetkeys \logs\assetkeyencryption
backgrounderLogs related to subscriptions and scheduled activities like extract refreshes, "Run Now" tasks, and tabcmd tasks. backgrounder-#.log
spawn.####.log
tomcat-#.####-##-##.log
backgrounder.exe \logs\backgrounder
cacheserverLogs related to the Cache Server process.redis-server.exe\cacheserver
clustercontrollerLogs related to the Cluster Controller process.clustercontroller.log
clustercontroller.log-####-##-##
clustercontroller.exe\clustercontroller
configConfiguration files.
This is a good place to start gathering information when troubleshooting. Confirm that the configuration settings are what you expect.
connections.yml
workgroup.yml
Tableau Server Configuration\config
datacollector   \logs\datacollector
dataengineThere will be a tdeserver log file for each day with information about data extracts and queries, and responses to VizQL server requests.tdeserver_####_##_##_##_##_##.log tdeserver.exe
tdeserver64.exe
\logs\dataengine
dataserverInformation about connections to Tableau Server data sources.dataserver-#.log dataserver.exe \logs\dataserver
httpdApache logs. Look here for authentication entries. Each request in the Apache log will have a request ID associated with it. This request ID is used throughout the server logs and you can use it to associate log entries with a request.access.####-##-##.##-##-##log
error.log
startup.log
Apache daemon\logs\httpd
licensing   \logs\licensing
logsThis is the location of the logs of most interest and usefulness. Look here after reviewing the configuration files.
tabadmin.log is never overwritten or truncated so it contains all the details.
notify-tabadmin.log contains errors from tabadmin.log (the errors are also included in tabadmin.log).
tablicsrv.log and tabsrvlic.log are related to licensing.
tabadmin.log
tabconfig.log
tablicsrv.log
tabsrvlic.log
wgserver.war.deploy.log
 \logs
pgsqlPostgreSQL database logs, including files related to launching server processes.Tableau data extracts are stored in the PostgreSQL database. tabspawn\logs\pgsql
repository  postgres.exe \logs\repository
service notify-tabsvc.log
tabsvc.log
 \logs\service
solrRelated to search indexing.  \logs\solr
svcmonitor   \logs\svcmonitor
tabadminserviceRelated to log archives created using the Generate a Snapshot of Server Log Files option.   \logs\tabadminservice
tabadmwrkServer Worker Manager process that is used for auto-discovery of worker servers in a distributed environment. tabadmwrk.exe\logs\tabadmwrk
vizportal   \logs\vizportal
vizqlserverRelated to showing and interacting with views.
When running multiple instances of VizQL Server, the instances are distinguished by port number.
notify-production logs contain exceptional events.
vizql-0.log.####-##-##
spawn.####.log
vizqlserver.exe \logs\vizqlserver
vizqlserver\logsMost files are in JSON format.
tabprotosrv.txt is created when you open data or connect to data.
backgrounder_####_####_##_##_##_##_##.txt
dataserver_####_####_##_##_##_##_##.txt
tabadmin_####_##_##_##_##_##.txt
tabprotosrv.txt
vizqlserver_####_####_##_##_##_##_##.txt
wgserver_####_####_##_##_##_##_##.txt
tdserver_vizqlserver_####_####_##_##_##_##_##.txt
  \vizqlserver\logs
wgserverInformation related to administrative tasks, workbook and permissions management, authentication, sign-ins, initial view requests, and publishing requests.
Browsing, searching.
Instances of wgserver are distinguished by port number, immediately following "production" or "notify-production".
notify-production logs contain exceptional events.
There will be a separate production.n_### file for each backgrounder process for each day.
notify-production.n_### correlates to production.n_### but contains only errors.
db-migrate_####_##_##_##_##_##.log
migrate.log
notify-production.####_####_##_##_##_##_##.log
production.####.log
production.####_####_##_##_##_##_##.log
spawn.####.log
tomcat-#.####_##_##.log
wgserver-#.log
wgserver.exe \logs\wgserver
zookeeperInformation related to the Tableau Server Coordination Service.spawn.####.log
zookeeper-#.log
zookeeper-#.log.####_##_##
zookeeper.exe \logs\zookeeper

Tableau Server log files can be found in the following folders on the server:

Tableau Service Logs

The following log files track activities related to the web application, database, and index:
C:\ProgramData\Tableau\Tableau Server\data\tabsvc

VizQL Logs

These log files track activities related to displaying views, such as querying the database and generating images:
C:\ProgramData\Tableau\Tableau Server\data\tabsvc\vizqlserver\Logs

Temporary Files

Any file that starts with exe_ in the folder below is a Tableau Server file and can be deleted.
C:\ProgramData\Tableau\Tableau Server\temp