Monitoring dockerized PostgreSQL clusters
1.5K

Agent used to collect metrics from one or several PostgreSQL clusters
You need a valid license to be able to use the agent. You can request a 30-days Free Trial. You will have at your disposal a Datasentinel SaaS platform. You can also install the platform on-premises or as a containerized app inside Docker
Because the agent registers the server name and listening port to the platform, you need to expose them externally and pass the values when running a new agent. This allows the platform to communicate with the agent.
export DATASENTINEL_AGENT_HOST=172.16.250.199
export DATASENTINEL_AGENT_PORT=8383
docker run -d -p $DATASENTINEL_AGENT_PORT:$DATASENTINEL_AGENT_PORT -e DATASENTINEL_AGENT_HOST=$DATASENTINEL_AGENT_HOST -e DATASENTINEL_AGENT_PORT=$DATASENTINEL_AGENT_PORT datasentinel/datasentinel-agent
curl -k https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/agent/status
export TOKEN="Valid license key"
cat <<EOF >body.json
{
"value" : "$TOKEN"
}
EOF
curl -k --header 'Content-Type: application/json' --request PUT "https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/server/token" -d @body.json
cat <<EOF >upload_server.json
{
"host": "datasentinel_server",
"port": 443
}
EOF
curl -k --header "api-token: $TOKEN" --header 'Content-Type: application/json' -X PUT https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/server -d @upload_server.json
# Check upload server
curl -k -X GET https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/server
curl -k --header "api-token: $TOKEN" --request POST https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/server/test-upload
cat > body.json <<EOF
{
"host": "172.16.250.199",
"port": 5432,
"user": "datasentinel",
"password": "myPassword",
"tags": "application=application_name,environment=docker,datacenter=datacenter"
}
EOF
curl -k --header "api-token: $TOKEN" --header 'Content-Type: application/json' --request POST "https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/connections/pg_docker_example" -d @body.json
curl -k --header "api-token: $TOKEN" -X GET https://${DATASENTINEL_AGENT_HOST}:${DATASENTINEL_AGENT_PORT}/api/connections



Content type
Image
Digest
sha256:2ec54b126…
Size
102.6 MB
Last updated
over 3 years ago
docker pull datasentinel/datasentinel-agent