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

The scripts is available from Github :
Github link

Prerequisites

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>

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