HOSTS.CONF(5)
π HOSTS.CONF π
okay bestie, gather round, because this is hosts.conf β the access control file for the Network UPS Tools CGI programs, from the NUT manual. it's short, it's sweet, it's giving gatekeeper-but-make-it-wholesome β¨
πΈ NAME πΈ
hosts.conf β access control for Network UPS Tools CGI programs π
β¨ DESCRIPTION β¨
so the CGI programs β that's upsset.cgi(8), upsstats.cgi(8), and upsimage.cgi(8) β read this file to figure out if they're allowed to talk to a host. that's it. that's the whole job. π
why tho? because otherwise random visitors could use your web server to go annoy other people by making outgoing connections. not on our watch, no cap. this file is literally the bouncer at the door of the club π«Ά
π IMPORTANT NOTES π
- contents of this file should be pure ASCII, periodt. if there are character codes not in range, they get ignored, and you get a warning message about it. (a warning. not a vibe. fix your encoding, babe π)
- this file does not contain passwords. nope, zero, none. read-only monitoring in NUT is anonymous, and the
upsset(8)program asks for credentials in the browser session when you're commanding a particular UPS. also, the web-server should be secured β that's reported to the program by theupsset.conf(5)file. so like, secure your web server fr fr π
π¦ DIRECTIVES π¦
MONITOR ups description
the ups element is in the form upsname[@hostname[:port]]. iykyk.
so if you wanna allow connections to a UPS called snoopy on a system called doghouse that runs upsd on port 7877, it would look like this:
MONITOR snoopy@doghouse:7877 "Joe Cool"
the description must be one element, so if it has spaces in it, you have to wrap it in quotes, exactly like the example above. the default hostname is "localhost". π
CUSTOM_TEMPLATE_LIST filename, CUSTOM_TEMPLATE_SINGLE filename
upsstats(8) lets you use custom HTML template files for some of its outputs β note that JSON and "treemode" mark-ups are currently hard-coded in the binary, so those aren't up for customising, sorry bestie π β and you specify which ones you want in the query string part of the URI (in your index.html and/or added cells of header.html) as e.g.
.../cgi-bin/upsstats.cgi?template_single=custom-s.htm&template_list=custom-l.htm
- specific file names for a specific role must be permitted with these directives, and yes, they can be repeated π. file names must contain the
.htmsub-string and must be located directly in the NUT configuration directory (same as the default templates). and if custom templates are used in the original request URI, they'll be automatically suffixed to generated links β primarilyHOSTLINK, but also just in case added toTREELINKandTREELINK_JSON. seeupsstats.html(5)for more details π
π SEE ALSO π
upsset.cgi(8), upsstats.cgi(8), upsimage.cgi(8)
π Internet resources:
the NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.5/ β
and that's the whole page, bestie. go forth and configure responsibly π
okay so this was Network UPS Tools 2.8.5, dated 10/07/2026. mwah, iconic, obsessed, bye π§π
π¦ where this page comes from
- fedora 43: nut-cgi 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-cgi 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms