1NUTSCAN_SCAN_SNMP(3) NUT Manual NUTSCAN_SCAN_SNMP(3)
2
3
4
6 nutscan_scan_snmp - Scan network for SNMP devices.
7
9 #include <nut-scan.h>
10
11 nutscan_device_t * nutscan_scan_snmp(const char * start_ip,const char * stop_ip,long timeout, nutscan_snmp_t * sec);
12
14 The nutscan_scan_snmp() function try to detect NUT compatible SNMP
15 devices. It tries SNMP queries on every IP ranging from start_ip to
16 stop_ip. Those IP may be either IPv4 or IPv6 addresses or host names.
17
18 This function waits up to timeout microseconds before considering an IP
19 address does not respond to SNMP queries.
20
21 A valid nutscan_snmp_t structure must be passed to this function.
22
23 The nutscan_snmp_t structure contains the following members which must
24 be filled as described below:
25
26 char * 'community';
27 char * 'secLevel';
28 char * 'secName';
29 char * 'authPassword';
30 char * 'privPassword';
31 char * 'authProtocol';
32 char * 'privProtocol';
33
34 If community is not NULL, SNMP v1 request are sent using this
35 community.
36
37 If community is NULL and secLevel is NULL, SNMP v1 is selected and
38 community is set to "public".
39
40 In the other cases, SNMP v3 is used. secLevel may be one of
41 SNMP_SEC_LEVEL_NOAUTH, SNMP_SEC_LEVEL_AUTHNOPRIV or
42 SNMP_SEC_LEVEL_AUTHPRIV. secName is the security name and must be non
43 NULL.
44
45 If secLevel is set to SNMP_SEC_LEVEL_AUTHNOPRIV, authPassword must be
46 non NULL.
47
48 If secLevel is set to SNMP_SEC_LEVEL_AUTHPRIV, authPassword and
49 privPassword must be non NULL.
50
51 If authProtocol is NULL, MD5 protocol is used. Else you can set
52 authProtocol to either "MD5" or "SHA".
53
54 If privProtocol is NULL, DES protocol is used. Else you can set
55 privProtocol to either "AES" or "DES".
56
57 peername and handle are used internally and do not need any
58 initialization.
59
61 The nutscan_scan_snmp() function returns a pointer to a
62 nutscan_device_t structure containing all found devices or NULL if an
63 error occurs or no device is found.
64
66 nutscan_scan_usb(3), nutscan_scan_xml_http(3), nutscan_scan_nut(3),
67 nutscan_scan_avahi(3), nutscan_scan_ipmi(3),
68 nutscan_display_ups_conf(3), nutscan_display_parsable(3),
69 nutscan_new_device(3), nutscan_free_device(3),
70 nutscan_add_option_to_device(3), nutscan_add_device_to_device(3),
71 nutscan_cidr_to_ip(3)
72
73
74
75Network UPS Tools 09/15/2011 NUTSCAN_SCAN_SNMP(3)