Skip to main content
Sending timely, context-rich notifications to your team is essential for effective incident response. When alerts fire, your team needs immediate visibility with enough context to understand the situation without diving into multiple monitoring tools. This example shows how to create an Unpage agent that automatically enriches alerts from your monitoring system and posts detailed notifications to Slack. The agent will analyze incoming alerts, gather additional context, and format clear, actionable messages for your team.

Use Case

Post messages to a Slack channel as part of your Unpage agents!

Prerequisites

Before creating this agent, you’ll need:
  1. Unpage installed on your system
  2. A Slack webhook URL for your target channel
  3. Optionally: Other plugins configured (Datadog, AWS, etc.) for enrichment

Creating a Slack Notification Agent

After installing Unpage, create a new agent:
A YAML file will open in your $EDITOR. Here’s an example agent configuration:

Configure the Slack Plugin

Make sure your Slack plugin is configured with the webhook URL (slack webhook documentation). Run:
Select the Slack plugin and enter your webhook URL when prompted. Or edit ~/.unpage/profiles/default/config.yaml:

Testing Your Agent

Test with a Sample Alert

Create a test alert payload in JSON format:
Save it to a file (e.g., test_alert.json) and run:
The agent will process the alert and post a message to your Slack channel.

Test with Live Alerts

For testing with actual monitoring alerts, you can:
  1. Use an existing PagerDuty incident:
  2. Set up a webhook endpoint:
    Then configure your monitoring tool to send webhooks to the provided URL.

Example Output

When an alert comes in, your agent will post a message to Slack like:

Advanced: Multiple Channels

You can configure multiple Slack channels for different alert types:
Then create different agents or use conditional logic in your agent prompts to route to different channels based on severity:

Integrating with Other Monitoring Tools

This pattern works with any monitoring tool that can send webhooks or has a plugin:
  • Datadog: Configure Datadog plugin and webhook
  • Grafana: Send Grafana webhook to Unpage
  • CloudWatch: Use AWS plugin + CloudWatch alarms
  • Custom scripts: Any JSON payload sent to the webhook endpoint
See our Custom Alerts plugin documentation for more details on accepting webhooks from any source.

Production Deployment

For production use, deploy Unpage as a service that continuously listens for webhooks. See our Deployment Guide for details on:
  • Running Unpage in Docker
  • Setting up with Kubernetes
  • Configuring CI/CD with GitHub Actions
  • Monitoring and logging best practices