feat(cli,snmp): fix APC runtime unit defaults and add interactive action editing
This commit is contained in:
@@ -1,18 +1,27 @@
|
||||
# ⚡ NUPST — Network UPS Shutdown Tool
|
||||
|
||||
**Keep your systems safe when the power goes out.** NUPST is a lightweight, battle-tested CLI tool that monitors UPS devices via SNMP or NUT (UPSD) and orchestrates graceful shutdowns during power emergencies — including Proxmox VMs, LXC containers, and the host itself.
|
||||
**Keep your systems safe when the power goes out.** NUPST is a lightweight, battle-tested CLI tool
|
||||
that monitors UPS devices via SNMP or NUT (UPSD) and orchestrates graceful shutdowns during power
|
||||
emergencies — including Proxmox VMs, LXC containers, and the host itself.
|
||||
|
||||
Distributed as **self-contained binaries** with zero runtime dependencies. No Node.js, no Python, no package managers. Just download and run.
|
||||
Distributed as **self-contained binaries** with zero runtime dependencies. No Node.js, no Python, no
|
||||
package managers. Just download and run.
|
||||
|
||||
## Issue Reporting and Security
|
||||
|
||||
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
||||
For reporting bugs, issues, or security vulnerabilities, please visit
|
||||
[community.foss.global/](https://community.foss.global/). This is the central community hub for all
|
||||
issue reporting. Developers who sign and comply with our contribution agreement and go through
|
||||
identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull
|
||||
Requests directly.
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- **🔌 Multi-UPS Support** — Monitor multiple UPS devices from a single daemon
|
||||
- **📡 Dual Protocol Support** — SNMP (v1/v2c/v3) for network UPS + UPSD/NIS for USB-connected UPS via NUT
|
||||
- **🖥️ Proxmox Integration** — Gracefully shut down QEMU VMs and LXC containers before host shutdown, with optional HA-aware stop requests for HA-managed guests
|
||||
- **📡 Dual Protocol Support** — SNMP (v1/v2c/v3) for network UPS + UPSD/NIS for USB-connected UPS
|
||||
via NUT
|
||||
- **🖥️ Proxmox Integration** — Gracefully shut down QEMU VMs and LXC containers before host
|
||||
shutdown, with optional HA-aware stop requests for HA-managed guests
|
||||
- **👥 Group Management** — Organize UPS devices into groups with flexible operating modes
|
||||
- **Redundant Mode** — Only trigger actions when ALL UPS devices in a group are critical
|
||||
- **Non-Redundant Mode** — Trigger actions when ANY UPS device is critical
|
||||
@@ -23,7 +32,8 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
|
||||
- Custom shell scripts
|
||||
- Proxmox VM/LXC shutdown
|
||||
- Configurable shutdown delays
|
||||
- **🏭 Multiple UPS Brands** — CyberPower, APC, Eaton, TrippLite, Liebert/Vertiv, and custom OID configurations
|
||||
- **🏭 Multiple UPS Brands** — CyberPower, APC, Eaton, TrippLite, Liebert/Vertiv, and custom OID
|
||||
configurations
|
||||
- **🌐 HTTP API** — Optional JSON status endpoint with token authentication
|
||||
- **⏸️ Pause/Resume** — Temporarily suppress actions during maintenance windows
|
||||
- **🛡️ Network Loss Detection** — Detects unreachable UPS devices and prevents false shutdowns
|
||||
@@ -91,7 +101,8 @@ curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh |
|
||||
|
||||
### Manual Installation
|
||||
|
||||
Download the binary for your platform from [releases](https://code.foss.global/serve.zone/nupst/releases):
|
||||
Download the binary for your platform from
|
||||
[releases](https://code.foss.global/serve.zone/nupst/releases):
|
||||
|
||||
| Platform | Binary |
|
||||
| ------------------- | ----------------------- |
|
||||
@@ -133,11 +144,11 @@ nupst <command> [subcommand] [options]
|
||||
|
||||
### Global Options
|
||||
|
||||
| Flag | Description |
|
||||
| ---------------- | -------------------------------------- |
|
||||
| `--version`, `-v` | Show version |
|
||||
| `--help`, `-h` | Show help |
|
||||
| `--debug`, `-d` | Enable debug mode (verbose SNMP/UPSD logging) |
|
||||
| Flag | Description |
|
||||
| ----------------- | --------------------------------------------- |
|
||||
| `--version`, `-v` | Show version |
|
||||
| `--help`, `-h` | Show help |
|
||||
| `--debug`, `-d` | Enable debug mode (verbose SNMP/UPSD logging) |
|
||||
|
||||
### Service Management
|
||||
|
||||
@@ -179,6 +190,7 @@ nupst group list # List all groups
|
||||
|
||||
```bash
|
||||
nupst action add <target-id> # Add action to a UPS or group
|
||||
nupst action edit <target-id> <idx> # Edit an action by index
|
||||
nupst action remove <target-id> <idx> # Remove an action by index
|
||||
nupst action list [target-id] # List actions (optionally for a target)
|
||||
```
|
||||
@@ -196,6 +208,7 @@ nupst resume # Resume immediately
|
||||
```
|
||||
|
||||
When paused:
|
||||
|
||||
- UPS polling continues (status is still visible)
|
||||
- All actions are suppressed (no shutdowns, webhooks, scripts)
|
||||
- The HTTP API response includes `"paused": true`
|
||||
@@ -217,7 +230,11 @@ nupst uninstall # Completely remove NUPST (requires root)
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
NUPST stores configuration at `/etc/nupst/config.json`. The easiest way to configure is through the interactive CLI commands, but you can also edit the JSON directly.
|
||||
NUPST stores configuration at `/etc/nupst/config.json`. The easiest way to configure is through the
|
||||
interactive CLI commands, but you can also edit the JSON directly.
|
||||
|
||||
When the daemon is running, changes to `/etc/nupst/config.json` are hot-reloaded automatically. A
|
||||
service restart is not normally required after editing the file.
|
||||
|
||||
`defaultShutdownDelay` sets the inherited delay in minutes for shutdown actions that do not define
|
||||
their own `shutdownDelay`.
|
||||
@@ -226,7 +243,7 @@ their own `shutdownDelay`.
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "4.3",
|
||||
"version": "4.4",
|
||||
"checkInterval": 30000,
|
||||
"defaultShutdownDelay": 5,
|
||||
"httpServer": {
|
||||
@@ -314,82 +331,89 @@ their own `shutdownDelay`.
|
||||
|
||||
Each UPS device has a `protocol` field:
|
||||
|
||||
| Protocol | Use Case | Default Port |
|
||||
| -------- | -------- | ------------ |
|
||||
| `snmp` | Network-attached UPS with SNMP agent | 161 |
|
||||
| `upsd` | USB-connected UPS via local NUT server | 3493 |
|
||||
| Protocol | Use Case | Default Port |
|
||||
| -------- | -------------------------------------- | ------------ |
|
||||
| `snmp` | Network-attached UPS with SNMP agent | 161 |
|
||||
| `upsd` | USB-connected UPS via local NUT server | 3493 |
|
||||
|
||||
#### SNMP Settings (`snmp` object)
|
||||
|
||||
| Field | Description | Values / Default |
|
||||
| ----------- | -------------------------- | -------------------------------------------------------------- |
|
||||
| `host` | IP address or hostname | e.g., `"192.168.1.100"` |
|
||||
| `port` | SNMP port | Default: `161` |
|
||||
| `version` | SNMP version | `1`, `2`, or `3` |
|
||||
| `timeout` | Timeout in milliseconds | Default: `5000` |
|
||||
| `upsModel` | UPS brand/model | `cyberpower`, `apc`, `eaton`, `tripplite`, `liebert`, `custom` |
|
||||
| `runtimeUnit` | Battery runtime unit | `minutes`, `seconds`, or `ticks` (1/100s). Overrides auto-detection |
|
||||
| `community` | Community string (v1/v2c) | Default: `"public"` |
|
||||
| Field | Description | Values / Default |
|
||||
| ------------- | ------------------------- | ------------------------------------------------------------------- |
|
||||
| `host` | IP address or hostname | e.g., `"192.168.1.100"` |
|
||||
| `port` | SNMP port | Default: `161` |
|
||||
| `version` | SNMP version | `1`, `2`, or `3` |
|
||||
| `timeout` | Timeout in milliseconds | Default: `5000` |
|
||||
| `upsModel` | UPS brand/model | `cyberpower`, `apc`, `eaton`, `tripplite`, `liebert`, `custom` |
|
||||
| `runtimeUnit` | Battery runtime unit | `minutes`, `seconds`, or `ticks` (1/100s). Overrides auto-detection |
|
||||
| `community` | Community string (v1/v2c) | Default: `"public"` |
|
||||
|
||||
**SNMPv3 fields** (when `version: 3`):
|
||||
|
||||
| Field | Description | Values |
|
||||
| --------------- | ------------------------ | ----------------------------------- |
|
||||
| `securityLevel` | Security level | `noAuthNoPriv`, `authNoPriv`, `authPriv` |
|
||||
| `username` | Authentication username | — |
|
||||
| `authProtocol` | Auth protocol | `MD5` or `SHA` |
|
||||
| `authKey` | Auth password | — |
|
||||
| `privProtocol` | Encryption protocol | `DES` or `AES` |
|
||||
| `privKey` | Encryption password | — |
|
||||
| Field | Description | Values |
|
||||
| --------------- | ----------------------- | ---------------------------------------- |
|
||||
| `securityLevel` | Security level | `noAuthNoPriv`, `authNoPriv`, `authPriv` |
|
||||
| `username` | Authentication username | — |
|
||||
| `authProtocol` | Auth protocol | `MD5` or `SHA` |
|
||||
| `authKey` | Auth password | — |
|
||||
| `privProtocol` | Encryption protocol | `DES` or `AES` |
|
||||
| `privKey` | Encryption password | — |
|
||||
|
||||
#### UPSD/NIS Settings (`upsd` object)
|
||||
|
||||
For USB-connected UPS via [NUT (Network UPS Tools)](https://networkupstools.org/):
|
||||
|
||||
| Field | Description | Default |
|
||||
| ---------- | --------------------------- | ------------- |
|
||||
| `host` | NUT server address | `127.0.0.1` |
|
||||
| `port` | NUT UPSD port | `3493` |
|
||||
| `upsName` | NUT device name | `ups` |
|
||||
| `timeout` | Connection timeout (ms) | `5000` |
|
||||
| `username` | Optional auth username | — |
|
||||
| `password` | Optional auth password | — |
|
||||
| Field | Description | Default |
|
||||
| ---------- | ----------------------- | ----------- |
|
||||
| `host` | NUT server address | `127.0.0.1` |
|
||||
| `port` | NUT UPSD port | `3493` |
|
||||
| `upsName` | NUT device name | `ups` |
|
||||
| `timeout` | Connection timeout (ms) | `5000` |
|
||||
| `username` | Optional auth username | — |
|
||||
| `password` | Optional auth password | — |
|
||||
|
||||
**NUT variables mapped:** `ups.status`, `battery.charge`, `battery.runtime`, `ups.load`, `ups.realpower`, `output.voltage`, `output.current`
|
||||
**NUT variables mapped:** `ups.status`, `battery.charge`, `battery.runtime`, `ups.load`,
|
||||
`ups.realpower`, `output.voltage`, `output.current`
|
||||
|
||||
### Action Configuration
|
||||
|
||||
Actions define automated responses to UPS conditions. They run **sequentially in array order**, so place Proxmox actions before shutdown actions.
|
||||
Actions define automated responses to UPS conditions. They run **sequentially in array order**, so
|
||||
place Proxmox actions before shutdown actions.
|
||||
|
||||
Threshold-based actions are **edge-triggered**: they fire when the monitored UPS or group **enters** a threshold violation, not on every polling cycle while the threshold remains violated. If the condition clears and later re-enters, the action can fire again.
|
||||
Threshold-based actions are **edge-triggered**: they fire when the monitored UPS or group **enters**
|
||||
a threshold violation, not on every polling cycle while the threshold remains violated. If the
|
||||
condition clears and later re-enters, the action can fire again.
|
||||
|
||||
Shutdown and Proxmox actions also suppress duplicate runs where possible, so overlapping UPS and group actions do not repeatedly schedule the same host or guest shutdown workflow.
|
||||
Shutdown and Proxmox actions also suppress duplicate runs where possible, so overlapping UPS and
|
||||
group actions do not repeatedly schedule the same host or guest shutdown workflow.
|
||||
|
||||
You can update an existing action in place with `nupst action edit <target-id> <index>`.
|
||||
|
||||
#### Action Types
|
||||
|
||||
| Type | Description |
|
||||
| ---------- | ------------------------------------------------------------ |
|
||||
| `shutdown` | Graceful system shutdown with configurable delay |
|
||||
| `webhook` | HTTP POST/GET notification to external services |
|
||||
| `script` | Execute custom shell scripts from `/etc/nupst/` |
|
||||
| `proxmox` | Shut down Proxmox QEMU VMs and LXC containers (CLI or API) |
|
||||
| Type | Description |
|
||||
| ---------- | ---------------------------------------------------------- |
|
||||
| `shutdown` | Graceful system shutdown with configurable delay |
|
||||
| `webhook` | HTTP POST/GET notification to external services |
|
||||
| `script` | Execute custom shell scripts from `/etc/nupst/` |
|
||||
| `proxmox` | Shut down Proxmox QEMU VMs and LXC containers (CLI or API) |
|
||||
|
||||
#### Common Fields
|
||||
|
||||
| Field | Description | Values / Default |
|
||||
| ------------- | -------------------------------- | ---------------------------------------- |
|
||||
| `type` | Action type | `shutdown`, `webhook`, `script`, `proxmox` |
|
||||
| `thresholds` | Battery and runtime limits | `{ "battery": 0-100, "runtime": minutes }` |
|
||||
| `triggerMode` | When to trigger | See Trigger Modes below |
|
||||
| Field | Description | Values / Default |
|
||||
| ------------- | -------------------------- | ------------------------------------------ |
|
||||
| `type` | Action type | `shutdown`, `webhook`, `script`, `proxmox` |
|
||||
| `thresholds` | Battery and runtime limits | `{ "battery": 0-100, "runtime": minutes }` |
|
||||
| `triggerMode` | When to trigger | See Trigger Modes below |
|
||||
|
||||
#### Trigger Modes
|
||||
|
||||
| Mode | Description |
|
||||
| ----------------------------- | -------------------------------------------------------- |
|
||||
| `onlyPowerChanges` | Only when power status changes (online ↔ onBattery) |
|
||||
| `onlyThresholds` | Only when battery or runtime thresholds are newly violated |
|
||||
| `powerChangesAndThresholds` | On power changes OR when thresholds are newly violated (default) |
|
||||
| `anyChange` | On every polling cycle |
|
||||
| Mode | Description |
|
||||
| --------------------------- | ---------------------------------------------------------------- |
|
||||
| `onlyPowerChanges` | Only when power status changes (online ↔ onBattery) |
|
||||
| `onlyThresholds` | Only when battery or runtime thresholds are newly violated |
|
||||
| `powerChangesAndThresholds` | On power changes OR when thresholds are newly violated (default) |
|
||||
| `anyChange` | On every polling cycle |
|
||||
|
||||
#### Shutdown Action
|
||||
|
||||
@@ -402,9 +426,9 @@ Shutdown and Proxmox actions also suppress duplicate runs where possible, so ove
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Default |
|
||||
| --------------- | ---------------------------------- | ------- |
|
||||
| `shutdownDelay` | Minutes to wait before shutdown | Inherits `defaultShutdownDelay` (`5`) |
|
||||
| Field | Description | Default |
|
||||
| --------------- | ------------------------------- | ------------------------------------- |
|
||||
| `shutdownDelay` | Minutes to wait before shutdown | Inherits `defaultShutdownDelay` (`5`) |
|
||||
|
||||
#### Webhook Action
|
||||
|
||||
@@ -419,11 +443,11 @@ Shutdown and Proxmox actions also suppress duplicate runs where possible, so ove
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Default |
|
||||
| ---------------- | -------------------- | -------- |
|
||||
| `webhookUrl` | URL to call | Required |
|
||||
| `webhookMethod` | HTTP method | `POST` |
|
||||
| `webhookTimeout` | Timeout in ms | `10000` |
|
||||
| Field | Description | Default |
|
||||
| ---------------- | ------------- | -------- |
|
||||
| `webhookUrl` | URL to call | Required |
|
||||
| `webhookMethod` | HTTP method | `POST` |
|
||||
| `webhookTimeout` | Timeout in ms | `10000` |
|
||||
|
||||
#### Script Action
|
||||
|
||||
@@ -437,26 +461,28 @@ Shutdown and Proxmox actions also suppress duplicate runs where possible, so ove
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Default |
|
||||
| --------------- | -------------------------------------- | ------- |
|
||||
| `scriptPath` | Script filename in `/etc/nupst/` | Required |
|
||||
| `scriptTimeout` | Execution timeout in ms | `60000` |
|
||||
| Field | Description | Default |
|
||||
| --------------- | -------------------------------- | -------- |
|
||||
| `scriptPath` | Script filename in `/etc/nupst/` | Required |
|
||||
| `scriptTimeout` | Execution timeout in ms | `60000` |
|
||||
|
||||
#### 🖥️ Proxmox Action
|
||||
|
||||
Gracefully shuts down QEMU VMs and LXC containers on a Proxmox node before the host is shut down.
|
||||
|
||||
If you use Proxmox HA, NUPST can optionally request `state=stopped` for HA-managed guests instead of only issuing direct `qm` / `pct` shutdown commands.
|
||||
If you use Proxmox HA, NUPST can optionally request `state=stopped` for HA-managed guests instead of
|
||||
only issuing direct `qm` / `pct` shutdown commands.
|
||||
|
||||
NUPST supports **two operation modes** for Proxmox:
|
||||
|
||||
| Mode | Description | Requirements |
|
||||
| ------ | -------------------------------------------------------------- | ------------------------- |
|
||||
| Mode | Description | Requirements |
|
||||
| ------ | -------------------------------------------------------------- | ------------------------------- |
|
||||
| `cli` | Uses `qm`/`pct` commands directly — **no API token needed** 🎉 | Running as root on Proxmox host |
|
||||
| `api` | Uses Proxmox REST API via HTTPS | API token required |
|
||||
| `auto` | Prefers CLI if available, falls back to API (default) | — |
|
||||
| `api` | Uses Proxmox REST API via HTTPS | API token required |
|
||||
| `auto` | Prefers CLI if available, falls back to API (default) | — |
|
||||
|
||||
> 💡 **On a Proxmox host running as root** (the typical setup), NUPST auto-detects `qm` and `pct` CLI tools and uses them directly. No API token setup required!
|
||||
> 💡 **On a Proxmox host running as root** (the typical setup), NUPST auto-detects `qm` and `pct`
|
||||
> CLI tools and uses them directly. No API token setup required!
|
||||
|
||||
**CLI mode example** (simplest — auto-detected on Proxmox hosts):
|
||||
|
||||
@@ -493,19 +519,19 @@ NUPST supports **two operation modes** for Proxmox:
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Default |
|
||||
| --------------------- | ----------------------------------------------- | ------------- |
|
||||
| `proxmoxMode` | Operation mode | `auto` |
|
||||
| `proxmoxHaPolicy` | HA handling for HA-managed guests | `none`, `haStop` (`none` default) |
|
||||
| `proxmoxHost` | Proxmox API host (API mode only) | `localhost` |
|
||||
| `proxmoxPort` | Proxmox API port (API mode only) | `8006` |
|
||||
| `proxmoxNode` | Proxmox node name | Auto-detect via hostname |
|
||||
| `proxmoxTokenId` | API token ID (API mode only) | — |
|
||||
| `proxmoxTokenSecret` | API token secret (API mode only) | — |
|
||||
| `proxmoxExcludeIds` | VM/CT IDs to skip | `[]` |
|
||||
| `proxmoxStopTimeout` | Seconds to wait for graceful shutdown | `120` |
|
||||
| `proxmoxForceStop` | Force-stop VMs/CTs that don't shut down | `true` |
|
||||
| `proxmoxInsecure` | Skip TLS verification (API mode only) | `true` |
|
||||
| Field | Description | Default |
|
||||
| -------------------- | --------------------------------------- | --------------------------------- |
|
||||
| `proxmoxMode` | Operation mode | `auto` |
|
||||
| `proxmoxHaPolicy` | HA handling for HA-managed guests | `none`, `haStop` (`none` default) |
|
||||
| `proxmoxHost` | Proxmox API host (API mode only) | `localhost` |
|
||||
| `proxmoxPort` | Proxmox API port (API mode only) | `8006` |
|
||||
| `proxmoxNode` | Proxmox node name | Auto-detect via hostname |
|
||||
| `proxmoxTokenId` | API token ID (API mode only) | — |
|
||||
| `proxmoxTokenSecret` | API token secret (API mode only) | — |
|
||||
| `proxmoxExcludeIds` | VM/CT IDs to skip | `[]` |
|
||||
| `proxmoxStopTimeout` | Seconds to wait for graceful shutdown | `120` |
|
||||
| `proxmoxForceStop` | Force-stop VMs/CTs that don't shut down | `true` |
|
||||
| `proxmoxInsecure` | Skip TLS verification (API mode only) | `true` |
|
||||
|
||||
**Setting up the API token** (only needed for API mode):
|
||||
|
||||
@@ -516,10 +542,13 @@ pveum user token add root@pam nupst --privsep=0
|
||||
|
||||
**HA Policy values:**
|
||||
|
||||
- **`none`** — Treat HA-managed and non-HA guests the same. NUPST sends normal guest shutdown commands.
|
||||
- **`haStop`** — For HA-managed guests, NUPST requests HA resource state `stopped`. Non-HA guests still use normal shutdown commands.
|
||||
- **`none`** — Treat HA-managed and non-HA guests the same. NUPST sends normal guest shutdown
|
||||
commands.
|
||||
- **`haStop`** — For HA-managed guests, NUPST requests HA resource state `stopped`. Non-HA guests
|
||||
still use normal shutdown commands.
|
||||
|
||||
> ⚠️ **Important:** Place the Proxmox action **before** the shutdown action in the actions array so VMs are stopped before the host shuts down.
|
||||
> ⚠️ **Important:** Place the Proxmox action **before** the shutdown action in the actions array so
|
||||
> VMs are stopped before the host shuts down.
|
||||
|
||||
### Group Configuration
|
||||
|
||||
@@ -527,22 +556,36 @@ Groups coordinate actions across multiple UPS devices.
|
||||
|
||||
Group actions are evaluated **after all UPS devices have been refreshed for a polling cycle**.
|
||||
|
||||
There is **no aggregate battery math** across the group. Instead, each group action evaluates each member UPS against that action's own thresholds.
|
||||
There is **no aggregate battery math** across the group. Instead, each group action evaluates each
|
||||
member UPS against that action's own thresholds.
|
||||
|
||||
| Field | Description | Values |
|
||||
| ------------- | ---------------------------------- | -------------------- |
|
||||
| `id` | Unique group identifier | — |
|
||||
| `name` | Human-readable name | — |
|
||||
| `mode` | Group operating mode | `redundant`, `nonRedundant` |
|
||||
| `description` | Optional description | — |
|
||||
| `actions` | Array of action configurations | — |
|
||||
| Field | Description | Values |
|
||||
| ------------- | ------------------------------ | --------------------------- |
|
||||
| `id` | Unique group identifier | — |
|
||||
| `name` | Human-readable name | — |
|
||||
| `mode` | Group operating mode | `redundant`, `nonRedundant` |
|
||||
| `description` | Optional description | — |
|
||||
| `actions` | Array of action configurations | — |
|
||||
|
||||
**Group Modes:**
|
||||
|
||||
- **`redundant`** — A threshold-based action triggers only when **all** UPS devices in the group are on battery and below that action's thresholds. Use for setups with backup power units.
|
||||
- **`nonRedundant`** — A threshold-based action triggers when **any** UPS device in the group is on battery and below that action's thresholds. Use when all UPS units must be operational.
|
||||
- **`redundant`** — A threshold-based action triggers only when **all** UPS devices in the group are
|
||||
on battery and below that action's thresholds. Use for setups with backup power units.
|
||||
- **`nonRedundant`** — A threshold-based action triggers when **any** UPS device in the group is on
|
||||
battery and below that action's thresholds. Use when all UPS units must be operational.
|
||||
|
||||
For threshold-based **destructive** group actions (`shutdown` and `proxmox`), NUPST suppresses execution while any group member is `unreachable`. This prevents acting on partial data during network failures.
|
||||
For threshold-based **destructive** group actions (`shutdown` and `proxmox`), NUPST suppresses
|
||||
execution while any group member is `unreachable`. This prevents acting on partial data during
|
||||
network failures.
|
||||
|
||||
### Multi-node Note
|
||||
|
||||
You can copy the same NUPST config to multiple nodes. UPS IDs and group IDs are local to each daemon
|
||||
instance, so duplicate IDs across nodes do not conflict.
|
||||
|
||||
NUPST does not coordinate actions across nodes. If multiple nodes monitor the same UPS or target the
|
||||
same Proxmox environment with the same action config, each node can trigger its own shutdown or
|
||||
Proxmox workflow. For shared UPS or Proxmox targets, prefer one controlling node per target.
|
||||
|
||||
### HTTP Server Configuration
|
||||
|
||||
@@ -616,9 +659,11 @@ When monitoring is paused:
|
||||
NUPST tracks communication failures per UPS device:
|
||||
|
||||
- After **3 consecutive failures**, the UPS status transitions to `unreachable`
|
||||
- **Shutdown actions will NOT fire** on `unreachable` — this prevents false shutdowns from network glitches
|
||||
- **Shutdown actions will NOT fire** on `unreachable` — this prevents false shutdowns from network
|
||||
glitches
|
||||
- Webhook and script actions still fire, allowing you to send alerts
|
||||
- Threshold-based destructive **group** actions are also suppressed while any required group member is `unreachable`
|
||||
- Threshold-based destructive **group** actions are also suppressed while any required group member
|
||||
is `unreachable`
|
||||
- When connectivity is restored, NUPST logs a recovery event with downtime duration
|
||||
- The failure counter is capped at 100 to prevent overflow
|
||||
|
||||
@@ -676,15 +721,16 @@ nupst service logs
|
||||
|
||||
Full SNMPv3 support with authentication and encryption:
|
||||
|
||||
| Security Level | Description |
|
||||
| -------------- | ------------------------------------------ |
|
||||
| `noAuthNoPriv` | No authentication, no encryption |
|
||||
| `authNoPriv` | MD5/SHA authentication without encryption |
|
||||
| `authPriv` | Authentication + DES/AES encryption ✅ |
|
||||
| Security Level | Description |
|
||||
| -------------- | ----------------------------------------- |
|
||||
| `noAuthNoPriv` | No authentication, no encryption |
|
||||
| `authNoPriv` | MD5/SHA authentication without encryption |
|
||||
| `authPriv` | Authentication + DES/AES encryption ✅ |
|
||||
|
||||
### Network Security
|
||||
|
||||
- Connects only to UPS devices and optionally Proxmox on local network (CLI mode uses local tools — no network needed for VM shutdown)
|
||||
- Connects only to UPS devices and optionally Proxmox on local network (CLI mode uses local tools —
|
||||
no network needed for VM shutdown)
|
||||
- HTTP API disabled by default; token-required when enabled
|
||||
- No external internet connections
|
||||
|
||||
@@ -700,14 +746,14 @@ sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
|
||||
### SNMP-based
|
||||
|
||||
| Brand | Config Value | Notes |
|
||||
| -------------- | ------------- | ------------------------------- |
|
||||
| CyberPower | `cyberpower` | Full support including power metrics |
|
||||
| APC | `apc` | Smart-UPS, Back-UPS series |
|
||||
| Eaton | `eaton` | Eaton/Powerware UPS |
|
||||
| TrippLite | `tripplite` | SmartPro and similar |
|
||||
| Liebert/Vertiv | `liebert` | GXT, PSI series |
|
||||
| Custom | `custom` | Provide your own OID mappings |
|
||||
| Brand | Config Value | Notes |
|
||||
| -------------- | ------------ | ------------------------------------ |
|
||||
| CyberPower | `cyberpower` | Full support including power metrics |
|
||||
| APC | `apc` | Smart-UPS, Back-UPS series |
|
||||
| Eaton | `eaton` | Eaton/Powerware UPS |
|
||||
| TrippLite | `tripplite` | SmartPro and similar |
|
||||
| Liebert/Vertiv | `liebert` | GXT, PSI series |
|
||||
| Custom | `custom` | Provide your own OID mappings |
|
||||
|
||||
**Custom OIDs example:**
|
||||
|
||||
@@ -723,11 +769,15 @@ sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
}
|
||||
```
|
||||
|
||||
> 💡 **Tip:** If your UPS (e.g., HPE, Huawei) reports runtime in seconds instead of minutes, set `"runtimeUnit": "seconds"`. For CyberPower-style TimeTicks (1/100 second), use `"ticks"`. When omitted, NUPST auto-detects based on `upsModel`.
|
||||
> 💡 **Tip:** If your UPS (e.g., HPE, Huawei) reports runtime in seconds instead of minutes, set
|
||||
> `"runtimeUnit": "seconds"`. For CyberPower or APC PowerNet TimeTicks (1/100 second), use
|
||||
> `"ticks"`. When omitted, NUPST auto-detects based on `upsModel`.
|
||||
|
||||
### UPSD/NIS-based
|
||||
|
||||
Any UPS supported by [NUT (Network UPS Tools)](https://networkupstools.org/) — this covers **hundreds of models** from virtually every manufacturer, including USB-connected devices. Check the [NUT hardware compatibility list](https://networkupstools.org/stable-hcl.html).
|
||||
Any UPS supported by [NUT (Network UPS Tools)](https://networkupstools.org/) — this covers
|
||||
**hundreds of models** from virtually every manufacturer, including USB-connected devices. Check the
|
||||
[NUT hardware compatibility list](https://networkupstools.org/stable-hcl.html).
|
||||
|
||||
## 🔄 Updating
|
||||
|
||||
@@ -824,13 +874,13 @@ nupst service status
|
||||
|
||||
### File System
|
||||
|
||||
| Path | Description |
|
||||
| ----------------------------------- | -------------------- |
|
||||
| `/opt/nupst/nupst` | Pre-compiled binary |
|
||||
| `/usr/local/bin/nupst` | Symlink to binary |
|
||||
| `/etc/nupst/config.json` | Configuration file |
|
||||
| Path | Description |
|
||||
| ----------------------------------- | ------------------------------ |
|
||||
| `/opt/nupst/nupst` | Pre-compiled binary |
|
||||
| `/usr/local/bin/nupst` | Symlink to binary |
|
||||
| `/etc/nupst/config.json` | Configuration file |
|
||||
| `/etc/nupst/pause` | Pause state file (when paused) |
|
||||
| `/etc/systemd/system/nupst.service` | Systemd service unit |
|
||||
| `/etc/systemd/system/nupst.service` | Systemd service unit |
|
||||
|
||||
### Services
|
||||
|
||||
@@ -851,15 +901,16 @@ nupst service status
|
||||
curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
The installer auto-detects v3.x installations, migrates the configuration, and swaps the binary. Your settings are preserved.
|
||||
The installer auto-detects v3.x installations, migrates the configuration, and swaps the binary.
|
||||
Your settings are preserved.
|
||||
|
||||
| Aspect | v3.x | v4.x+ |
|
||||
| ------------------------ | -------------------------- | ----------------------------- |
|
||||
| **Runtime** | Node.js + npm | Deno (self-contained) |
|
||||
| **Distribution** | Git repo + npm install | Pre-compiled binaries |
|
||||
| **Runtime Dependencies** | node_modules | Zero |
|
||||
| **Size** | ~150MB | ~80MB |
|
||||
| **Commands** | Flat (`nupst add`) | Subcommands (`nupst ups add`) |
|
||||
| Aspect | v3.x | v4.x+ |
|
||||
| ------------------------ | ---------------------- | ----------------------------- |
|
||||
| **Runtime** | Node.js + npm | Deno (self-contained) |
|
||||
| **Distribution** | Git repo + npm install | Pre-compiled binaries |
|
||||
| **Runtime Dependencies** | node_modules | Zero |
|
||||
| **Size** | ~150MB | ~80MB |
|
||||
| **Commands** | Flat (`nupst add`) | Subcommands (`nupst ups add`) |
|
||||
|
||||
## 💻 Development
|
||||
|
||||
@@ -915,21 +966,31 @@ nupst/
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
|
||||
This repository contains open-source code licensed under the MIT License. A copy of the license can
|
||||
be found in the [license](./license) file.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the project, except as required for reasonable and customary use
|
||||
in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated
|
||||
with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture
|
||||
Capital GmbH or third parties, and are not included within the scope of the MIT license granted
|
||||
herein.
|
||||
|
||||
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
||||
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the
|
||||
guidelines of the respective third-party owners, and any usage must be approved in writing.
|
||||
Third-party trademarks used herein are the property of their respective owners and used only in a
|
||||
descriptive manner, e.g. for an implementation of an API or similar.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
Task Venture Capital GmbH Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its
|
||||
terms, and understand that the licensing of the code does not imply endorsement by Task Venture
|
||||
Capital GmbH of any derivative works.
|
||||
|
||||
Reference in New Issue
Block a user