NUTSCAN_INIT(3)
β¨ NUTSCAN_INIT β the lil' startup ritual for the nutscan library β¨
okay bestie, so this is a page from the NUT Manual β section 3, NUTSCAN_INIT(3) β and honestly? it's short but it's load-bearing, so lock in for like two minutes π
πΈ NAME πΈ
nutscan_init β Initialize the nutscan library.
yes. that's it. that's the whole job. but bestie, if you skip it, everything else breaks, so let's go π«Ά
π SYNOPSIS π
#include <nut-scan.h>
void nutscan_init(void);
that's the whole vibe. no args, no return value, just vibes and initialization β¨
π DESCRIPTION π
okay so here's the tea, and it's non-negotiable tea: you must call nutscan_init() at least once before you use any other function in the nutscan library. not once per function, not "eh I'll get to it" β at least once, before anything else. periodt. π
what it does is it updates a bunch of global variables, and those globals are basically the library telling you "hey, here's what I can actually do on this machine right now." so as a nutscan user you can check them at run-time and know which scan methods are available. no guessing, no praying, just facts π
and the availability depends on which further libraries are installed on your system:
nutscan_avail_avahi = 1: AVAHI NUT scan is available π¦nutscan_avail_ipmi = 1: IPMI scan is availablenutscan_avail_nut = 1: the "Old" NUT method is availablenutscan_avail_nut_simulation = 1: the NUT simulation devices method is availablenutscan_avail_snmp = 1: SNMP method is availablenutscan_avail_usb = 1: USB method is availablenutscan_avail_xml_http = 1: XML HTTP method is available π
β οΈ important, bestie, do not skip this: if one of those variables says a method is unavailable, then calling the matchingnutscan_scan_*function will always returnNULL. every single time. no exceptions. it's giving "the door is locked and there is no key" π
π§ NOTES π§
technically β and I do mean technically β the function is currently defined in the nutscan-init.h file. iykyk π
π SEE ALSO π
go read these too, they're all part of the same friend group:
nutscan_init(3)nutscan_scan_usb(3)nutscan_scan_snmp(3)nutscan_scan_xml_http_range(3)nutscan_scan_nut(3)nutscan_scan_nut_simulation(3)nutscan_scan_avahi(3)nutscan_scan_ipmi(3)nutscan_display_ups_conf(3)nutscan_display_sanity_check(3)nutscan_display_sanity_check_serial(3)nutscan_display_ups_conf_with_sanity_check(3)nutscan_display_parsable(3)nutscan_new_device(3)nutscan_free_device(3)nutscan_add_option_to_device(3)nutscan_add_device_to_device(3)
and that's the whole page, bestie π this lil' slice of the Network UPS Tools 2.8.5 manual is dated 10/07/2026, so go forth, call nutscan_init() first, and slay πβ¨πΈ
π¦ where this page comes from
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 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