🕶️Agent
Datasentinel requires the installation of the pg_stat_statements extension within your PostgreSQL instances.
Refer to the installation guide for pg_stat_statements and instructions on setting the recommended parameters. The extension mut be installed on the internal database named postgres
The examples are based on a standard PostgreSQL installation with a server running the CentOS 7 operating system
You need to install just one agent per server, which can effectively monitor multiple PostgreSQL clusters.
When required, the agent can also be installed on an intermediary server.
Download File
Date | Last available agent version | |
---|---|---|
2024-10-15 | 3.6.0 |
(Deprecated) RedHat/Centos 6
(Deprecated) Debian Stretch
(Deprecated) Debian Jessie
The file size is approximately 35 MB.
Start The Agent
Whenever possible, avoid using the root account.
Uncompress the downloaded file
There are two ways to start the agent:
Using an alias
By setting environment variables
Test The Status
Check this point if the agent is up and running, but the CLI is indicating a negative response:
What could be the reason if the agent is running but the CLI responds with "NO"?
The agent registers its server name with the platform, enabling communication between the platform and the agent, as well as ensuring proper functionality of the agent CLI
If the server name is unknown (for example, not present in DNS servers), you can set the following environment variable before starting the agent:
The server name will also be utilized to generate the distinctive pg_instance tag, uniquely identifying instances across the entire platform.
pg_instance is formed by concatenating the server name with @ and the connection name. Refer to Tags section for more details
Platform Upload
The platform is where metrics are sent. In SaaS mode, it’s the name of the Datasentinel SaaS server.
The default port for https is 443, unless you’ve customized it during local platform installation.
Token Settings
A token is required to communicate with the platform.
The token is the license provided by the Datasentinel team. You can also copy the token from Agents Submenu in the User Interface.
The agent uses a self-signed certificate found in the config
subdirectory.
cert_datasentinel.pem
key_datasentinel.pem
Check Platform and Token
It checks the communication between the agent and the platform server
PostgreSQL
Example of configuring and adding a connection. Refer to PostgreSQL clusters for more details
User
Version >= 10
It's important to highlight that the user doesn't write data in PostgreSQL Access is confined to read-only permissions solely for retrieving metrics.
The default setting for the PostgreSQL search_path
variable is "$user", public
.
If the search_path
has been modified at the instance level, it's essential to ensure that the user account, typically datasentinel, includes the public
schema in its search_path
.
If the public
schema is not included, you will need to update it accordingly.
File pg_hba.conf
Add authorization for the user datasentinel to connect to all databases with a password
The user needs to be able to connect to ALL databases.
Reload the configuration
Add Instance
Replace MyConnectionName with a meaningful connection name in your environment.
A script is present in the datasentinel subdirectory as an example named connection_example.sh
The tags are customizable, allowing you to define your own tags. They are extremely useful in the user interface for filtering, grouping data, and defining role-based access.
🏷️TagsUseful CLI commands
⌨️CLIDisplay the agent status
Display the connections
For a comprehensive list of options, simply type datasentinel without any arguments
API
All operations are available through Agent API.
By default, the agent listens on port 8282, but you have the flexibility to modify this configuration.
Most of the operations need a token to be passed in the headers calls.
Configuration Files
The agent stores its configuration on the hidden directory .datasentinel
located in the user’s home directory.
2 files are present:
agent.yml
connections.yml
Agent properties can be directly modified through these files, except for passwords which are encrypted for security reasons.
Log File
The agent’s actions are recorded in the datasentinel.log
file located in the log
subdirectory of its distribution.
The log file is automatically rotated to remove outdated entries and manage data retention.
By default, the log level is set to INFO. To increase the log level, one can set it to debug in the [agent]
section of the configuration file agent.yml
.
Last updated