New to Kestra?
Use blueprints to kickstart your first workflows.
Heartbeat an SNMP manager with an INFORM, classify channel reachability, and alert Slack when acknowledgements stop.
An SNMP trap pipeline that silently breaks, a firewall rule change, a community string rotation, a manager restart that drops its listener, looks identical to a quiet network until a real incident needs that channel and nothing arrives. This blueprint uses plugin-snmp's SendInform task as the probe because, unlike a TRAP, an INFORM is the only SNMP PDU type that requires and returns a delivery acknowledgement, so a synthetic heartbeat INFORM gives a direct, verifiable signal that the notification path end to end is actually open.
heartbeat_notification_channel (io.kestra.plugin.snmp.SendInform) sends an INFORM carrying the current execution ID as a varbind to snmp_manager_host:snmp_manager_port and waits up to inform_timeout_ms, retrying inform_retries times, for the manager's acknowledgement. allowFailure: true lets the flow continue instead of aborting on a malformed configuration or transport error.classify_channel_status (io.kestra.plugin.core.debug.Return) checks whether outputs.heartbeat_notification_channel.acknowledged is defined at all. If it is missing, the classification is PROBE_FAILED. If it is defined and false, the classification is CHANNEL_UNREACHABLE. If it is true, the classification is CHANNEL_REACHABLE.route_by_channel_status (io.kestra.plugin.core.flow.Switch) branches on that string. CHANNEL_UNREACHABLE runs evaluate_alert_toggle (io.kestra.plugin.core.flow.If), which pages Slack via dispatch_channel_down_alert only when send_slack_alert is true, logging a suppressed-alert line otherwise. CHANNEL_REACHABLE logs a clean heartbeat line. PROBE_FAILED pages Slack directly since reachability is now unknown. The defaults branch logs a fallback line that is unreachable under normal operation.log_audit_summary records a status line on every run regardless of branch, so execution history reads as a continuous channel-uptime trend.errors block pages Slack separately if the sentinel flow itself fails outright.snmp_channel_heartbeat_schedule trigger polls every 15 minutes with explicit input overrides, shipped disabled: true until pointed at a real SNMP manager.status output (CHANNEL_REACHABLE / CHANNEL_UNREACHABLE / PROBE_FAILED) other flows can gate on before relying on that channel for a real incident.A one-off snmptrap CLI test proves a channel is open for one instant and leaves no record. This flow keeps every heartbeat in Kestra's execution history, turns the result into a typed status output other flows (deployment gates, incident-response flows) can depend on before trusting that channel, and gives you an If/Switch branch to grow into real remediation (paging a secondary channel, opening a ticket) without rewriting the probe itself.
SLACK_WEBHOOK secret.snmp_manager_host and snmp_manager_port at a real SNMP manager or trap receiver, and set snmp_community or configure v3 security to match.status reads CHANNEL_REACHABLE.snmp_channel_heartbeat_schedule.snmp_version to v3 and add a v3 connection block (username, authProtocol, authPassword, privProtocol, privPassword) directly on heartbeat_notification_channel for authenticated and encrypted heartbeats; prefer SHA256 or higher and AES128 or higher, since MD5, SHA (SHA-1), and DES are marked deprecated and cryptographically weak in the plugin's own source.Loop task to monitor a whole monitoring fleet from one flow.status into a KV store to alert only on state transitions instead of every run.io.kestra.plugin.snmp.SendTrap from this flow's errors block to notify the same NMS through a second, independent path when the heartbeat flow itself fails.SLACK_WEBHOOK: Slack incoming webhook used for the breach, probe-failure, and flow-failure alerts.SECRET_SLACK_WEBHOOK as base64, for example echo -n "<your-webhook-url>" | base64.snmp_manager_host (STRING, default localhost): SNMP manager or trap receiver hostname/IP.snmp_manager_port (INT, default 162): manager's UDP listening port.snmp_version (SELECT, one of v2c, v3, default v2c): INFORM protocol version.snmp_community (STRING, default public): v2c community string.heartbeat_trap_oid (STRING, default 1.3.6.1.4.1.8072.2.3.0.1): OID identifying the heartbeat notification.inform_timeout_ms (INT, default 2000): milliseconds to wait for acknowledgement.inform_retries (INT, default 1): resend attempts before giving up.send_slack_alert (STRING, default "true"): when "true", page Slack on breach; when "false", only log it.{{ outputs.heartbeat_notification_channel.acknowledged }}: boolean, true when the manager returned an error-free INFORM response.{{ outputs.heartbeat_notification_channel.error }}: SNMP error status text when unacknowledged, otherwise null.{{ outputs.heartbeat_notification_channel.responseText }}: raw response payload from the manager, when available.{{ outputs.classify_channel_status.value }}: classification string, one of CHANNEL_REACHABLE, CHANNEL_UNREACHABLE, PROBE_FAILED.{{ outputs.status }}: flow-level alias of the same classification.SendInform's own inline example in the plugin's source uses version: as the property key, but the field actually declared on AbstractSnmpTask (and used correctly in SendTrap's own example in the same plugin) is snmpVersion. This blueprint uses snmpVersion, not version.snmp_version to anything other than v2c or v3 makes the underlying task throw before it can even attempt the heartbeat, which this flow reports as PROBE_FAILED.acknowledged: false and a missing/failed task both indicate the channel cannot be trusted right now, but they are different failures: the former means the manager answered with an error, the latter means the attempt could not even complete. This blueprint deliberately classifies them as CHANNEL_UNREACHABLE and PROBE_FAILED respectively so you do not conflate a configuration bug with a real network outage.inform_timeout_ms on a congested or high-latency network path can produce false CHANNEL_UNREACHABLE results. Validate the timeout against your real network path before trusting the alert.To start a local open-source SNMP trap/inform receiver for testing, execute:
docker run -d --name kestra-snmp-manager -p 162:162/udp elcolio/net-snmp
This image starts a generic Net-SNMP trap receiver that dumps received notifications to its log; consult the image's own documentation for INFORM-specific acknowledgement behavior before relying on it for production-equivalent testing.
If Kestra is running inside a Docker network, connect the receiver container to Kestra's network:
docker network connect YOUR_KESTRA_NETWORK kestra-snmp-manager
(Run docker network ls to verify your active Kestra network name.)
