NUTSCAN_SCAN_NUT(3)
β¨ NUTSCAN_SCAN_NUT(3) β¨
okay so bestie, welcome to the NUT Manual π this one is all about nutscan_scan_nut β the little function that goes sniffing around the network like "hello?? any NUT services out there?? π₯Ί" and comes back with a whole list of devices.
πΈ NAME πΈ
nutscan_scan_nut β scan the network for available NUT services, bestie. that's the whole job. π
π SYNOPSIS π
#include <nut-scan.h>
#include <unistd.h> /* useconds_t */
nutscan_device_t * nutscan_scan_nut(
const char * startIP,
const char * stopIP,
const char * port,
useconds_t usec_timeout);
nutscan_device_t * nutscan_scan_ip_range_nut(
nutscan_ip_range_list_t * irl,
const char * port,
useconds_t usec_timeout);
like, two functions, four-ish arguments each, we move. π
π¦ DESCRIPTION π¦
so nutscan_scan_nut() and nutscan_scan_ip_range_nut() are both out here trying to detect available NUT services and their associated devices. iconic behavior honestly. π
the difference between the two? here's the tea β:
nutscan_scan_nut()fires off a NUT request on every IP ranging fromstartIPtostopIP.startIPis mandatory (you have to give it), andstopIPis optional β ifstopIPisNULL, then it just scans that one singlestartIPaddress. one and done, no cap. β¨nutscan_scan_ip_range_nut()instead walks through several IP address ranges at once, all represented by anutscan_ip_range_list_tstructure. it's giving "i have many ranges and i'm not afraid to use them." π
those IP arguments? they can be either IPv4 or IPv6 addresses, or even host names. flexible fr fr. πΈ
β οΈ okay super important: you MUST call nutscan_init(3) before using this function. like, do not skip this step bestie, it will not go well for you. π
a specific port number can be passed in via port, or you can pass NULL and it'll use the default NUT port. easy. π«Ά
and usec_timeout? that's how long it waits β up to that many microseconds β before it decides an IP address just isn't responding to NUT queries. it's patient but not that patient. π
β RETURN VALUE β
nutscan_scan_nut() hands you back a pointer to a nutscan_device_t structure stuffed with all the found devices π β¦ or NULL if something went wrong, or if literally no device was found. no devices, no pointer, that's the vibe. π
π SEE ALSO π
go read these too, they're all part of the same friend group:
nutscan_init(3)nutscan_scan_usb(3)nutscan_scan_xml_http_range(3)nutscan_scan_snmp(3)nutscan_scan_avahi(3)nutscan_scan_ipmi(3)nutscan_display_sanity_check(3)nutscan_display_sanity_check_serial(3)nutscan_display_ups_conf_with_sanity_check(3)nutscan_display_ups_conf(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)nutscan_scan_eaton_serial(3)nutscan_init_ip_ranges(3)nutscan_free_ip_ranges(3)nutscan_add_ip_range(3)nutscan_cidr_to_ip(3)
and that's the whole page babes π₯° this was brought to you by Network UPS Tools 2.8.5, dated 10/07/2026. go call nutscan_init(3) first, i'm begging you. mwah πβ¨
π¦ 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