When it comes to IoT infrastructure, systems, applications and real-time monitoring, the difference between catching an issue immediately versus discovering it hours later can mean the difference between a quick fix and costly downtime. While traditional email notifications have their place, they often get lost in crowded inboxes. SMS, WhatsApp and Slack alerts cut through the noise with the immediacy your operations demand.This guide will walk you through creating a comprehensive alerting system using InfluxDB 3 time series database’s embedded new Python processing engine. We’ll set up alerts across three critical channels: SMS, WhatsApp and Slack using popular third-party services like Twilio and Slack’s API. The result? A robust notification system that ensures your team never misses a critical alert.Our Use Case: Multichannel Temperature MonitoringSMS alertWe’ll build a temperature monitoring system that demonstrates a common industrial IoT scenario. When temperatures exceed safe thresholds, indicating potential cooling system failures or equipment overheating, our system will simultaneously alert via:SMS: For immediate mobile notifications that cut through the noise.WhatsApp: For rich messaging with international reach and multimedia support.Slack: For team collaboration, incident response and searchable alert history.InfluxDB 3: For embedded processing that eliminates external orchestration tools. It runs seamlessly from cloud deployments to edge devices like Raspberry Pi 5, with a built-in processing engine that processes data at the source.This multichannel approach ensures redundancy and reaches team members through their preferred communication methods, while InfluxDB 3’s embedded processing eliminates complex data pipelines. The same pattern applies to countless scenarios:IoT Applications:WhatsApp alertEquipment malfunction warnings (pressure, vibration)Environmental monitoring (humidity, air quality)Cold chain monitoring for pharmaceuticalsDevOps and Security:Server performance degradationApplication error rate spikesSecurity breach notificationsSuspicious activity detectionSystem ArchitectureOur alerting system uses InfluxDB 3’s processing engine, an embedded Python virtual machine that runs code directly inside the database. It’s part of both InfluxDB 3 Core and Enterprise. You can download the database for free and follow along.This architecture provides several advantages:Reduced latency: Processing happens at the data layer.Simplified infrastructure: No external task runners needed.Built-in scalability: Leverages InfluxDB’s performance characteristics.Data FlowData ingestion: Temperature sensors write data via InfluxDB client APIs.Processing engine: Embedded Python VM processes streaming data using triggers and plug-ins.Alert distribution: Custom Python code sends notifications via multiple channels.Understanding TriggersInfluxDB 3 provides three types of triggers for different use cases:WAL flush trigger: Processes batched writes (default: every second), which is perfect for our temperature alerts.Schedule trigger: Executes on a cron-like schedule — ideal for periodic health checks.On-request trigger: Creates custom HTTP endpoints for webhook-style integrations.#WAL-Flush triggerdef process_writes(influxdb3_local, table_batches, args): success, config = get_config(args) if not success: # ... handle errors ... return process_wal_flush(influxdb3_local, table_batches, config)Implementation GuideThe complete sample code for the SMS/WhatsApp configuration is available on GitHub.Step 1: Configure Your ServicesCreate a configuration file with credentials for all three services:#.env fileTWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTWILIO_AUTH_TOKEN=your_auth_tokenTWILIO_FROM_NUMBER=xxxxxxxxxxTWILIO_TO_NUMBER=xxxxxxxxxx# WhatsApp configurationTWILIO_FROM_WHATSAPP_NUMBER=xxxxxxxxxxTWILIO_TO_WHATSAPP_NUMBER=xxxxxxxxxx# Slack configurationSLACK_BOT_TOKEN=xoxb-your-bot-tokenSLACK_CHANNEL=#alertsStep 2: Launch InfluxDB 3 With Processing EngineEnable the processing engine by pointing to your plug-in directory:influxdb3 serve \ --node-id host01 \ --object-store file \ --data-dir ~/.influxdb3 --plugin-dir ~/.pluginsStep 3: Install Required DependenciesInstall the packages needed for our multichannel alerting:influxdb3 install package twilio python-dotenv slack-sdkStep 4: Set Up Database and Tableinfluxdb3 create database room-tempinfluxdb3 create table tempStep 5: Create and Enable the Alert Triggerinfluxdb3 create trigger \ --trigger-spec "all_tables:" \ --plugin-filename "multi-channel-alert.py" \ --database room-temp \ multi_channel_alert \ --trigger-arguments "field_name=temperature,threshold=22.5,enable_sms=true,enable_whatsapp=true,enable_slack=true"influxdb3 enable trigger --database room-temp multi_channel_alertStep 6: Test Your Multichannel Alertsinfluxdb3 test wal_plugin \ --lp "temp,location=factory temperature=90i 1678886400000000000" \ --input-arguments "field_name=temperature,threshold=80,enable_sms=true,enable_whatsapp=true,enable_slack=true" \ --database room-temp \ multi-channel-alert.pyAdding Slack IntegrationWhile SMS and WhatsApp provide immediate personal notifications, Slack integration adds powerful team collaboration features. Here’s how to extend your alerting system with Slack:Setting Up Slack IntegrationFirst, create a Slack app and bot user:Visit the Slack API dashboard.Create a new app for your workspace.Add the chat:write bot token scope.Install the app to your workspace.Copy the Bot User OAuth Token.Enhanced Plug-In CodeYour plug-in can now send coordinated alerts across all channels:def send_slack_alert(config, message, channel): """Send alert to Slack channel""" try: from slack_sdk import WebClient client = WebClient(token=config['slack_bot_token']) response = client.chat_postMessage( channel=channel, text=message, attachments=[{ "color": "danger", "fields": [{ "title": "Alert Type", "value": "Temperature Threshold Exceeded", "short": True }] }] ) return response['ok'] except Exception as e: print(f"Slack alert failed: {e}") return FalseBenefits of Multichannel AlertingRedundancy: If one service is down, others continue working.Audience targeting: SMS for on-call engineers, Slack for team visibility.Rich context: Slack allows for threaded discussions and incident management.Audit trail: Slack provides a searchable alert history.Advanced Configuration OptionsYou can customize alert behavior through trigger arguments:--trigger-arguments "field_name=temperature,threshold=80,cooldown_minutes=5,enable_sms=true,enable_whatsapp=false,enable_slack=true,slack_channel=#critical-alerts"Key parameters:cooldown_minutes: Prevents alert spam during sustained threshold breaches.severity_levels: Different thresholds for warning vs. critical alerts.business_hours_only: Restrict certain alert types to work hours.escalation_rules: Progressive alerting based on duration or severity.Production ConsiderationsWhen deploying this system in production environments, several key considerations ensure reliable operation. Security should be a top priority so store credentials in secure secret management systems rather than plain text files. Implement rate limiting with cooldown periods to prevent alert flooding during sustained incidents. Monitor alert delivery success rates and response times to ensure your notification system remains reliable. Consider backup notification methods for critical systems to maintain redundancy even if primary channels fail. Finally, ensure your alert data handling meets any regulatory requirements specific to your industry or region.Ready to build bulletproof alerting for your critical systems? The tools are at your fingertips and now it’s time to put them to work.The post Building Real-Time SMS, WhatsApp and Slack Alerts appeared first on The New Stack.