Quickstart: add an availability group
In this quickstart you add a two-replica availability group of Ciguapa Inc. to Excubius and see it on the Overview. It takes about 15 minutes once the monitoring login exists.
Before you begin
- The monitoring login exists on every replica with the same SID. See Prerequisites.
- You are Entity admin on the entity that will hold the group, for example Ciguapa Inc. › Production.
- The Excubius server reaches the listener and both replicas on the SQL port.
In the examples, the replicas are sql-ventas-01.ciguapa.example and sql-ventas-02.ciguapa.example, and the group is ag-ventas.
1. Store the login once
A credential stored on Ciguapa Inc. is usable by every resource below it.
- Console
- API
- Open Settings › Credentials and choose Ciguapa Inc. in the entity picker.
- Select Add credential, kind SQL login.
- Enter the name
sql-monitoring, the userusr_monitoringand the password. - Select Save. The password is encrypted and never shown again.
CRED=$(curl -s "${H[@]}" -X POST "$BASE/credentials" -d "{
\"entity_id\": \"$CIGUAPA\", \"name\": \"sql-monitoring\", \"kind\": \"sql_login\",
\"username\": \"usr_monitoring\", \"secret\": \"<password>\"
}" | jq -r .id)
$BASE is https://<your server>/api/v1 and H holds your bearer token; see the API reference.
2. Add each replica as an instance
- Console
- API
- Open Resources › Add resource.
- Type: SQL Server instance.
- Place and name: Ciguapa Inc. › Production, name
sql-ventas-01. - Connection: host
sql-ventas-01.ciguapa.example, port1433. - Tags:
env:prod,role:sql,client:ciguapa; criticality4. - Credential:
sql-monitoring. - Review, then Create resource.
Repeat for sql-ventas-02.
for n in 01 02; do
curl -s "${H[@]}" -X POST "$BASE/resources" -d "{
\"entity_id\": \"$PROD\", \"type\": \"sqlserver_instance\", \"name\": \"sql-ventas-$n\",
\"attributes\": {\"host\": \"sql-ventas-$n.ciguapa.example\", \"port\": 1433},
\"tags\": {\"env\": \"prod\", \"role\": \"sql\", \"client\": \"ciguapa\"}, \"criticality\": 4,
\"credential_id\": \"$CRED\"
}" | jq '{id, name, checks_provisioned}'
done
The default checks of a SQL Server instance are set up at once; the first values arrive within a minute or two.
3. Test the connection
On the first replica, select Test connection. A successful test shows the server name, version, edition and latency, and lists any missing permission.
| Result | Means | Fix |
|---|---|---|
auth | Login failed, or SQL logins are disabled | Check the password and that the instance accepts SQL logins (mixed mode) |
unreachable | Name, firewall or port | Check DNS and the firewall from the Excubius server |
timeout | No answer in time | Check the network path and the SQL port |
Warning: login is sysadmin | Works, but is not least privilege | Recreate the login from Prerequisites |
4. Discover the availability group
On one replica only, select Discover. Discovery reads the server, its availability groups with their replicas, roles and listener, its databases and linked servers, and adds them as child resources with their own checks. Run it again whenever the topology changes; children that disappear are marked missing, never deleted.
5. See it on the Overview
Open the Overview for Ciguapa Inc.. The ag-ventas card shows the listener, the primary, both replicas with their synchronization health and the databases. Both replicas should read Healthy.
Clean up
To remove what you added, delete the two instances from Resources; their discovered children, checks, metrics and alerts go with them. Delete the credential last, once nothing uses it.