# @serve.zone/nupst NUPST is a Network UPS Shutdown Tool for servers that need predictable behavior when power gets ugly. It monitors UPS devices through SNMP or NUT/UPSD, evaluates per-device and grouped power conditions, and runs ordered actions such as Proxmox guest shutdown, webhooks, scripts, and host shutdown. ## 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. ## Why It Exists Power-failure automation must be boring, explicit, and local-first. NUPST is built as a single compiled Deno binary that can sit on a Proxmox host or another Linux server, poll one or more UPS devices, and execute a controlled shutdown sequence before batteries are exhausted. It is useful when you need: - SNMP monitoring for network UPS units. - NUT/UPSD monitoring for USB UPS units exposed by Network UPS Tools. - Multiple UPS devices on one daemon. - Redundant or non-redundant UPS groups. - Proxmox VM/LXC shutdown before host shutdown. - Webhook or script notifications. - A small authenticated HTTP JSON status endpoint. - Pause/resume for maintenance windows. - Configuration migration from older NUPST formats. ## Installation Install the released binary: ```bash curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash ``` Install through the npm package wrapper with pnpm: ```bash pnpm add --global @serve.zone/nupst ``` The installer places the binary under `/opt/nupst/nupst`, creates a symlink in `/usr/local/bin` or `/usr/bin`, and preserves existing `/etc/nupst/config.json` when upgrading. ## Quick Start Create the first UPS config interactively: ```bash sudo nupst ups add ``` Test connectivity: ```bash nupst ups test --debug ``` Install and start the systemd service: ```bash sudo nupst service enable sudo nupst service start ``` Inspect status and logs: ```bash nupst service status nupst service logs ``` ## CLI Reference ```bash nupst [subcommand] [options] ``` Global options: | Option | Purpose | | --- | --- | | `--version`, `-v` | Show version. | | `--help`, `-h` | Show help. | | `--debug`, `-d` | Enable detailed SNMP/UPSD logging. | Service commands: | Command | Purpose | | --- | --- | | `service enable` | Install and enable the systemd service. Requires root. | | `service disable` | Stop, disable, and remove the service. Requires root. | | `service start` | Start `nupst.service`. | | `service stop` | Stop `nupst.service`. | | `service restart` | Restart the service. | | `service status` | Show service and UPS state. | | `service logs` | Follow live service logs. | | `service start-daemon` | Run the daemon process directly. Used by systemd/testing. | Configuration commands: | Command | Purpose | | --- | --- | | `ups add` | Add a UPS device interactively. | | `ups edit [id]` | Edit a UPS device. | | `ups remove ` | Remove a UPS device. Alias: `rm`. | | `ups list` | List UPS devices. Alias: `ls`. | | `ups test` | Test configured UPS connections. | | `group add` | Create a UPS group. | | `group edit ` | Edit a group. | | `group remove ` | Remove a group. Alias: `rm`. | | `group list` | List groups. Alias: `ls`. | | `action add ` | Add an action to a UPS or group. | | `action edit ` | Edit an action by array index. | | `action remove ` | Remove an action. Alias: `rm`. | | `action list [target-id]` | List actions globally or for one target. Alias: `ls`. | | `feature httpServer` | Configure the optional JSON status endpoint. Aliases: `http-server`, `http`. | | `config show` | Display the active configuration. | | `pause [--duration