UPSC(8)

πŸ’… UPSC(8) β€” the NUT Manual, bestie edition

okay so you're looking at upsc, the lightweight read-only NUT client ✨ like it lives in the NUT Manual and honestly? it's giving "tiny tool, huge main character energy."


🌸 NAME 🌸

upsc β€” Lightweight read-only NUT client. that's it, that's the whole vibe. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

upsc [-j] -l | -L [host]

upsc [-j] ups [variable]

upsc [-j] -c ups

πŸŽ€ DESCRIPTION πŸŽ€

so upsc is literally just here as a quick way to poll the status of a UPS server. no cap. 🫢

like, it's the tool you reach for inside shell scripts and other programs that need UPS data but don't wanna drag in the full interface, because who has the time, right? lowkey iconic.


✨ OPTIONS ✨

  • -j β€” output the results in JSON format πŸ”₯. this will bypass the standard text output and print a JSON object to stdout. the structure of the JSON depends on the mode, and here's the whole rundown bestie:
    • upsc -j -l: Returns a JSON array of UPS names.
    • upsc -j -L: Returns a JSON object mapping UPS names to their descriptions.
    • upsc -j <ups>: Returns a JSON object of all variables and their values.
    • upsc -j <ups> <variable>: Returns a single JSON string (the value).
    • upsc -j -c <ups>: Returns a JSON array of client addresses.
  • -l host β€” list all UPS names configured at host, one name per line πŸ“‹. the hostname defaults to "localhost". you may optionally add a colon and a port number.
  • -L host β€” as above, list all UPS names configured at host, including their description provided by the remote upsd(8) from its ups.conf(5) πŸ‘‘. the hostname defaults to "localhost". you may optionally add a colon and a port number to override the default port.
  • -c ups β€” lists each client connected on ups, one name per line πŸ™ˆ.
  • ups β€” display the status of that UPS. the format for this option is upsname[@hostname[:port]]. the default hostname is "localhost". ⭐
  • variable β€” display the value of this variable only. by default, upsc retrieves the list of variables from the server and then displays the value for each. this option may be useful in shell scripts to save an additional pipe into grep. 🧚

πŸ’œ COMMON OPTIONS πŸ’œ

  • -h β€” show the command-line help message. friendly little guy fr fr.
  • -D β€” raise the debugging level πŸ›. use this option multiple times for more details. overrides the optional NUT_DEBUG_LEVEL environment variable.
  • -V β€” show NUT version banner 🌈. more details may be available if you also export NUT_DEBUG_LEVEL=1 or greater verbosity level.
  • -W secs β€” set the timeout for initial network connections (by default they are indefinitely non-blocking, or until the system interrupts the attempt). overrides the optional NUT_DEFAULT_CONNECT_TIMEOUT environment variable. ⏳
ok but seriously, note that default: connections are indefinitely non-blocking by default unless the system interrupts the attempt. so if you're impatient, that's literally what -W secs is for. πŸ’€

πŸ“ EXAMPLES πŸ“

to list all variables on an UPS named "myups" on a host called "mybox", with upsd(8) running on port 1234:

:; upsc myups@mybox:1234
battery.charge: 100.0
battery.voltage: 13.9
battery.voltage.nominal: 13.6
. . .

to retrieve all variables for "myups" as a JSON object:

:; upsc -j myups@mybox:1234
{
  "battery.charge": "100.0",
  "battery.voltage": "13.9",
  "battery.voltage.nominal": "13.6",
  ...
}

to list the UPSes configured on this system, along with their descriptions:

:; upsc -L
apc: Back-UPS 500
ppro2: Patriot Pro II

to retrieve the status for all UPSes connected to mybox, using Bourne-shell syntax:

:; for UPS in `upsc -l mybox:1234`; do
    upsc $UPS ups.status
done

to list clients connected on "myups":

:; upsc -c myups
127.0.0.1
::1
192.168.1.2

🧚 SCRIPTED MODE 🧚

if you run this program inside a shell script or similar to get the list of devices and variables, you should only consider using output from stdout, not stderr. 🫢 like hello, keep it clean.


πŸ’… DIAGNOSTICS πŸ’…

upsc will either print a list of UPS names, a list of all supported variables and their values on the UPS, or an error message. 😭

if you do receive an error, make sure you have specified a valid UPS on the command line, that upsd(8) is really running on the other host, and that no firewalls are blocking you. ngl firewall problems are such a mood killer.


πŸ‘‘ HISTORY πŸ‘‘

earlier versions of this program used the upsfetch library and UDP sockets to talk to upsd. this version of upsc uses the new upsclient library, which only talks TCP. πŸ”₯

this is why upsct no longer exists. rip to a real one, periodt. πŸ’€


🌈 SEE ALSO 🌈

upslog(8), ups.conf(5), upsd(8)

🌟 Internet resources:

the NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.5/


okay that's the whole page bestie, go poll some UPSes πŸ’–βœ¨πŸŽ€

β€” xoxo, this was Network UPS Tools 2.8.5, dated 06/21/2026, and you just read UPSC(8). slay. πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: nut 2.8.5-2 Β· GPL-2.0-or-later AND GPL-3.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms