NetBird Mesh Peer Connectivity and Security Sentinel
Continuous peer connectivity auditing, login session expiration monitoring, and Slack alerting for NetBird zero-trust networks.
Monitor Rocket.Chat livechat queue backlog and alert Slack when waiting chats cross a warning or critical threshold.
An agent going offline or a department getting overwhelmed does not show up anywhere until a customer complains that nobody answered. This blueprint polls Rocket.Chat's own Omnichannel queue endpoint on a schedule, sums the waiting chats across every agent/department pairing, and pages Slack the moment that backlog crosses a warning or critical threshold, or the workspace cannot be reached at all.
login_to_rocketchat (io.kestra.plugin.core.http.Request) authenticates against POST /api/v1/login with an admin username and password, returning data.authToken and data.userId. allowFailure: true lets the flow continue into classification instead of aborting on a bad login.list_livechat_queue (io.kestra.plugin.core.http.Request) calls GET /api/v1/livechat/queue?includeOfflineAgents=true with the X-Auth-Token and X-User-Id headers pulled from the login response via jq, returning a queue array where each entry carries a chats count for one agent/department pairing.classify_queue_backlog (io.kestra.plugin.core.debug.Return) checks whether outputs.list_livechat_queue.body is defined; if not, UNREACHABLE. Otherwise it sums .queue[].chats with jq and compares that total against critical_threshold then warning_threshold, returning CRITICAL, AT_RISK, or HEALTHY.route_by_backlog (io.kestra.plugin.core.flow.Switch) branches on that string: HEALTHY logs a quiet confirmation, AT_RISK and CRITICAL each page Slack with the threshold crossed, UNREACHABLE pages Slack separately, and defaults logs the raw outcome.log_audit_status records a status line on every run regardless of branch, so the execution history is a continuous backlog trend.errors block pages Slack separately if the flow itself fails outright.queue_backlog_schedule trigger polls every 5 minutes with explicit input overrides, shipped disabled: true until you point it at a real Rocket.Chat workspace.status output (HEALTHY / AT_RISK / CRITICAL / UNREACHABLE) you can chart or gate other flows on.A cron job hitting the same endpoint tells you nothing once the script exits. This flow keeps every login, every queue snapshot, and every threshold comparison in the execution history, turns the backlog check into a typed output other flows can depend on, and gives you a Switch branch to grow into real remediation (paging a specific department's lead, opening a ticket, auto-adding an on-call agent) without rewriting the check itself.
rocketchat_url, with Omnichannel/Livechat enabled, at least one department, and at least one agent configured. The free, self-hosted Community Edition (rocket.chat/docs/installation/docker-containers/) supports this out of the box, so the flow can be fully tested against a local Docker container.view-livechat-queue permission) username and password for authentication.ROCKETCHAT_ADMIN_USER: Rocket.Chat username (or email) used to authenticate against /api/v1/login.ROCKETCHAT_ADMIN_PASSWORD: password for that user.SLACK_WEBHOOK_URL: Slack incoming webhook used for the warning alert, the critical alert, the unreachable alert, and the flow-failure alert.SECRET_ROCKETCHAT_ADMIN_USER, SECRET_ROCKETCHAT_ADMIN_PASSWORD, and SECRET_SLACK_WEBHOOK_URL as base64, for example echo -n "<your-value>" | base64.ROCKETCHAT_ADMIN_USER, ROCKETCHAT_ADMIN_PASSWORD, and SLACK_WEBHOOK_URL secrets.rocketchat_url to your workspace and tune warning_threshold/critical_threshold to the size of your support team.status reads a sensible value.queue_backlog_schedule.queue with a Loop task and alerting on the specific department that breached its threshold.POST /api/v1/livechat/room.forward to automatically reassign the oldest waiting chat when CRITICAL is reached.