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 athost, 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 athost, including their description provided by the remoteupsd(8)from itsups.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 onups, one name per line π.upsβ display the status of that UPS. the format for this option isupsname[@hostname[:port]]. the default hostname is"localhost". βvariableβ display the value of this variable only. by default,upscretrieves 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 intogrep. π§
π 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 optionalNUT_DEBUG_LEVELenvironment variable.-Vβ show NUT version banner π. more details may be available if you also exportNUT_DEBUG_LEVEL=1or 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 optionalNUT_DEFAULT_CONNECT_TIMEOUTenvironment 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