HA: change for NethSecurtiy 8.8.#1706
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the HA (keepalived-based) stack for NethSecurity 8.8 by reintroducing an optional hotplug locking mechanism for state transitions and migrating HA alerting from direct portal calls to the standard Telegraf → Victoria Metrics/vmalert → ns-plug-alert-proxy pipeline.
Changes:
- Added keepalived hotplug serialization lock scripts (
00-lock/999-unlock) controlled bykeepalived.globals.ns_lock_timeout. - Implemented HA alert metrics collection via Telegraf (
telegraf-ha-alert+ha.conf) and new vmalert rules (ha.yaml). - Updated
ns-plug-alert-proxy,ns-hadocs, andns-apiHA status output to reflect the new alerting/locking model.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/victoria-metrics/files/vmalert-rules/ha.yaml | Adds vmalert rules for HA failover/sync alerts based on Telegraf-exported metrics. |
| packages/telegraf/Makefile | Installs the new HA Telegraf config and collector script. |
| packages/telegraf/files/telegraf.conf.d/ha.conf | Configures Telegraf to execute the HA collector and parse JSON metrics. |
| packages/telegraf/files/telegraf-ha-alert | Emits HA event/state metrics (primary failed/recovered, sync failed/recovered). |
| packages/ns-plug/README.md | Documents new HA alerts and the vmalert→proxy forwarding path. |
| packages/ns-plug/files/ns-plug-alert-proxy | Adds HA alert ID mappings (but currently has incorrect status semantics for HA event alerts). |
| packages/ns-ha/README.md | Documents hotplug lock option and the new alerting approach/semantics. |
| packages/ns-ha/Makefile | Installs new keepalived hotplug scripts for locking and alert-state recording. |
| packages/ns-ha/files/ns.sh | Removes direct legacy portal alert-sending functions. |
| packages/ns-ha/files/ns-rsync.sh | Records sync failure/recovery timestamps into UCI state for metric export. |
| packages/ns-ha/files/ns-ha-config | Displays lock status/timeout in CLI status output. |
| packages/ns-ha/files/00-lock | Implements optional keepalived hotplug serialization lock (needs fixes for exit/validation/flag ownership). |
| packages/ns-ha/files/999-unlock | Releases the hotplug lock (needs to align flag ownership with 00-lock). |
| packages/ns-ha/files/900-ns-plug | Removes direct cluster alert calls; now only manages cron + hotplug flow. |
| packages/ns-ha/files/05-alert-state | Records primary failover/recovery event timestamps into UCI state. |
| packages/ns-api/README.md | Documents new lock_status / lock_timeout fields in HA status output. |
| packages/ns-api/files/ns.ha | Adds lock_status / lock_timeout to HA status output (needs to treat 0/invalid as disabled). |
| AGENTS.md | Notes the standard monitoring pipeline for alerts including HA. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
685a407 to
f924716
Compare
To avoid regressions, the locking system is disabled by default. Enable it by settings keepalived.globals.ns_lock_timeout option.
Keep the HA event source in ns-ha, but install the Telegraf collector and vmalert rules. Assisted-by: Copilot:gpt-5.4-mini
f924716 to
adc46b8
Compare
Tbaile
reviewed
Jun 4, 2026
Collaborator
Tbaile
left a comment
There was a problem hiding this comment.
The existence of the uci_revert_state and uci_set_state is terrifying.
We could down the like allow telegraf to scrape the service using snmp, until then, fine by me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main changes:
Fixes: #1547 #1656