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 the upsset.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 .htm sub-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 β€” primarily HOSTLINK, but also just in case added to TREELINK and TREELINK_JSON. see upsstats.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