If you'd like to receive cPFence alerts on your desktop or mobile via Slack, follow the steps below. This guide uses the Slack desktop app.
Step 1: Install Slack
If you don’t already have it, download the Slack apps for both PC and mobile from:
https://slack.com/downloads
Step 2: Create a Slack Channel
- Open the Slack desktop app.
- Click “+ Add channels” from the left sidebar.
- Choose “Create a channel” and click Next.
- Name your channel (e.g.
#cpfence-alerts
) and click Create.
Step 3: Create a Slack App with Webhook Access
- Visit https://api.slack.com/apps and log in.
- Click “Create an App”.
- Choose “From a manifest”.
- Pick your workspace and click Next.
- Paste the following JSON (replace the name as needed):
{
"display_information": {
"name": "Your Hosting Co"
},
"settings": {
"org_deploy_enabled": false,
"socket_mode_enabled": false,
"is_hosted": false,
"token_rotation_enabled": false
}
}
- Click Next, then Create.
Step 4: Enable Incoming Webhooks
- In the app settings, go to Incoming Webhooks, and turn it on.
- Click “Add New Webhook”.
- Choose your channel and click Allow.
Step 5: Copy the Webhook URL
- Slack will show your new Webhook URL.
- Click Copy.
Step 6: Configure Webhook in cPFence
- In your cPFence WebUI, go to System Settings → Slack Notifications.
- Select All Servers or a specific server.
- Click Set Slack Webhook URL and paste the URL.
- Finally Enable Slack Notifications.
- You can also use the CLI commands :
cpfence --slack-notifications-on
cpfence --set-slack-webhook
You’re now set to receive real-time alerts on your desktop and mobile.
Bonus: Adjust Notification Settings (Optional)
To ensure you receive mobile push alerts:
- Open the Slack app.
- Click your profile → Preferences.
- Set your notification schedule and sound preferences.
Need Further Assistance?
If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.