In order to resolve a issue, most of the times we ask our customers to gather some diagnostics from their system and send it to us, using our Lasso tool.
The Lasso documentation contains important information on how to run Lasso for diagnosis of PostgreSQL, Barman and PGD systems, as well as related tools.
This article presents some highlights from the Lasso documentation. Alternatively, you can read a quick start version in the Install page from the docs.
For a quick view of the optional parameters, check the Usage page from the docs, or execute Lasso with the --help
argument once installed.
The Detailed breakdown of gathered data page from the docs describes all the operations and reports we perform on your system. It details information on what Lasso gathers from your system, grouped by context, and highlighting depth level and security impact.
You can install Lasso through DEB and RPM packages that are available in the EDB repositories.
IMPORTANT: you will be required to have a configuration file that contains at least the customer ID. NOTE: you can find more information about the Lasso configuration file in the end of this article and in the Configuration page from the docs
If you try to run Lasso without a configuration file, you will see this error:
ERROR: no configuration file for Lasso could be found. Please create a configuration file and try again.
A configuration file for Lasso is mandatory and must contain at least the customer ID. The minimum configuration file looks like this:
[customer]
id=XXXXX
Replace the id
value with the information found in your Company Page in the Support Portal (in the left menu bar, select Company info > Company). Enter the Company code
value from this page in the id
field in the configuration file.
Lasso will look for configuration files in the following paths, in this order:
-
./edb-lasso.cfg
(in the same directory where Lasso is running); -
./edb-lasso.conf
(in the same directory where Lasso is running); -
$HOME/edb-lasso.conf
; -
/etc/edb-lasso.conf
.
The first match will be used.
For more details about the Lasso configuration file, please check the Configuration page from the docs.
After installing Lasso and creating the configuration file with at least the company ID, you can execute the tool. Depending on the type of report to be generated, you need to execute Lasso with different command line arguments.
Lasso has a few different types of reports and you can find a brief description of the most common ones in the following sections. For a full list and more details on each report type, please refer to the Report types page from the docs.
This type of report is useful when the server has a PostgreSQL cluster which is up, running and accessible. Besides all information that is gathered in the system only report, it will also gather configurations and metrics from the PostgreSQL instance.
In order to gather a local PostgreSQL report you should run Lasso as follow:
lasso
Ideally this should be executed with postgres
user. The above command will attempt a peer PostgreSQL connection. If you need you can change some connection strings parameters, like the port (through --port
argument of Lasso).
Usually a local PostgreSQL report of a EnterpriseDB PostgreSQL Advanced server is obtained by running the following command as enterprisedb
user:
lasso -H /tmp -p 5444 edb
Note: If the socket is not present in /tmp
, you may connect using any socket reported by SHOW unix_socket_directories
, as well as localhost
for the host argument, -H
.
You can find more details on the accepted parameters by running:
lasso --help
If you need to gather data from a remote PostgreSQL instance, you can run a remote PostgreSQL report. As explained in the previous section, you can change the connection string parameters of Lasso. For example, to gather a PostgreSQL report from a remote server located in the IP 192.168.0.10, running on port 5433, you could invoke Lasso from another server as below:
lasso -H 192.168.0.10 -p 5433
This type of report will bring only PostgreSQL related info from the PostgreSQL database that Lasso was connected to. It means it will not be able to gather files like postgresql.conf
and pg_hba.conf
, nor will it be able to gather configurations and metrics from the underlying operational system or information from PostgreSQL related tools, like EFM configuration files. Having that in mind, it's always preferable running a local PostgreSQL report, if possible.
This type of report is useful when you are running Lasso in a server that has no PostgreSQL instance, or when the PostgreSQL instance is down, hence not accessible. It will gather the configurations and metrics from the operational system, as well as the configurations and metrics from PostgreSQL related tools, like PEM, EFM, xDB, HARP, PGD Proxy, PgBouncer, Repmgr and Patroni.
In order to gather a system only report you should run Lasso as follow:
lasso --system-only
NOTE: When executing Lasso on a node where only HARP Proxy or PGD Proxy are running, you'll need to use the
--system-only
option as there isn't a database instance running on such node. Same applies for servers wherePgBouncer
is running, but the database server it opens connections against is on a separate node.
This type of report is useful when you need to gather diagnostics from a Barman server. In order to run a barman report you should either run the following command:
lasso
As barman
user, or invoke Lasso with the --barman
argument:
lasso --barman
Besides what is gathered in a system only report, it will gather barman related diagnostics.
Lasso will look for configuration files of EDB tools in their default installation paths. If you use custom paths for those configuration files, Lasso exposes a few command line options to deal with that:
-
--repmgr-configuration
: path to therepmgr.conf
file -
--efm-configuration
: path to theefm.properties
file -
--barman-configuration
: path to thebarman.conf
file -
--xdb-pubserver-configuration
: path to thexdb_pubserver.conf
file -
--xdb-subserver-configuration
: path to thexdb_subserver.conf
file -
--pgbouncer-configuration
: path to thepgbouncer.ini
file -
--harp-configuration
: path to theconfig.yml
file -
--pgd-proxy-configuration
: path to thepgd-proxy-config.yml
-
--patroni-configuration
: path to thepatroni.yml
file
You can find more details about each one of these options in the Report types page from the docs.
Alternatively, as you can see in the Configuration page from the docs, you can use the Lasso configuration file to specify the same options above.
When Lasso is executed it will generate a .tar.bz2
file that contains all of the information collected by Lasso. This is what is referred to as a "Lasso report". For a description of the gathered information, run Lasso with the --describe
option or check the Detailed breakdown of gathered data page from the docs.
The documentation has an appendix containing a list of trusted IP servers for 443
access that can be allowed from your infrastructure. If your servers can access these IP servers, you can execute Lasso with the --upload
option to send the report directly to EDB's servers.
You can also upload the Lasso report directly via the Insights page. There is a link to upload a report under the box "+ Add instances" on the right side of the page.
When working on issues with EDB Technical Support you may be asked to run and share a Lasso report to assist with diagnosing the issue at hand. In that case you may attach the Lasso report directly to a reply on the support ticket and it will be automatically uploaded to your account's Insights page and associated with that ticket.
NOTE: the
.tar.bz2
filename has a meaningful format that must be kept intact when uploading it. Please, do not rename it nor alter the.tar.bz2
's contents in any way.
Once the report is uploaded, the data is automatically loaded to EDB Insights and, if you have a valid support subscription, you can access it within minutes from the Portal.