Configuring Slack Notification Extension
This guide describes how to configure dbWatch Control Center (dbWatch CC) to post
status messages directly to Slack channels using the Slack Web API.
Slack Notifications (Bash & PowerShell)
This integration posts a concise, rolling status message from dbWatch Control Center to a Slack channel. It deletes the previous message and posts a fresh one each run (Bash and PowerShell versions included).

Minimal Slack scopes: chat:write; channels:read is optional (only if you resolve channel names to IDs at runtime). Invite the bot to the channel before posting. See the included guide for step-by-step app setup and the minimal scope explanation.
What’s included
- Scripts
CustomerOp.sh(Ubuntu) — posts a combined status and deletes the previous oneCustomerOp.ps1(Windows) — same behavior for PowerShellSetupStatus.sh/SetupStatus.ps1— assist with CCC access/privileges
- Configs & resources
customers.ini— one line per domain (ACCESSPOINT, TARGET, DOMAINNAME, TOKEN)fdl4ini.txt— CCC script used by the Customer* scriptsslack.xml— optional dbWatch resource upload for Slack metadata
- Docs & assets
guides/Slack_App_Setup_and_Install_Guide.docx— minimal scopes + installassets/Slack_Screenshot_01.jpg— reference result in Slack
The scripts is available from Github :
Github link
Prerequisites
- dbWatch Control Center with CCC Tool available on the host running the script
- Outbound HTTPS access to Slack
- Slack Bot token (xoxb-…) and the bot invited to the target channel
Prepare dbWatch access (first time only)
If you use slack.xml, upload it via Server → Upload resource in dbWatch CC. On first run the CCC call may need approval; rerun after approval. The helper SetupStatus.sh / SetupStatus.ps1 can set up minimal read permissions on “All Instances” and “All Servers”.
Configure monitored domains
Create or edit customers.ini (same directory as the script):
<ACCESSPOINT>,<TARGET>,<DOMAINNAME>,<TOKEN>
- ACCESSPOINT: e.g.
192.168.7.30:7100 - TARGET: Node ID found under Server → Domain Configuration → Nodes
- DOMAINNAME: As in Domain Configuration/license
- TOKEN: Cloud Router token
Multiple lines supported to monitor several domains.
Set Slack credentials
Prefer a channel ID (e.g., C1234567890) over #channel to avoid name→ID lookups (lets you omit channels:read).
Ubuntu (bash)
```
export SLACK_TOKEN=“xoxb-xxxxxxxx”
export SLACK_CHANNEL=”C1234567890“ # or “#alerts” if you kept channels:read
```
Windows (PowerShell)
```
$env:SLACK_TOKEN = “xoxb-xxxxxxxx”
$env:SLACK_CHANNEL = “C1234567890“ # or “#alerts” if you kept channels:read
```
Run the integration
Both CustomerOp scripts follow the same flow: delete previous message (chat.delete), then post new (chat.postMessage), storing the ts for the next cycle.
Ubuntu (bash)
```
chmod +x CustomerOp.sh SetupStatus.sh
./SetupStatus.sh # first-time CCC approval only
./CustomerOp.sh
```
Windows (PowerShell)
```
Set-ExecutionPolicy Bypass -Scope Process -Force
.\SetupStatus.ps1 # first-time CCC approval only
.\CustomerOp.ps1
```
Scheduling
Ubuntu: cron or systemd timer
Windows: Task Scheduler
Data flow
dbWatch CC → CCC (fdl) → CustomerOp.* → Slack API (chat.delete → chat.postMessage) → one rolling message per channel.
Troubleshooting
- Bot can’t post: invite the bot to the channel (or add
chat:write.publicfor posting to public channels without an invite). - Deletes fail: you can delete only your app’s messages under
chat:write; ensure you persist/reuse the previousts. - Name vs ID: resolve once and switch to the ID to drop
channels:read.