Skip to content

Commit

Permalink
docs/snmp-subdrivers.txt: update with snmp_info_default() macro examp…
Browse files Browse the repository at this point in the history
…le [#2285]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Dec 1, 2024
1 parent d85921e commit 16f2b2d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/snmp-subdrivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ structure to be precise), and will not implement any useful functionality
(in particular, it will be unable to shut down the UPS). In the beginning,
it simply attempts to monitor some UPS variables. To make this driver useful,
you must examine the NUT variables of the form "unmapped.*" in the
hid_info_t data structure, and map them to actual NUT variables and
hid_info_t data structure (commonly wrapped into `snmp_info_default()`
macros for portability), and map them to actual NUT variables and
instant commands. There are currently no step-by-step instructions for
how to do this. Please look at the files to see how the currently implemented
subdrivers are written:
how to do this. Please look at the source files to see how the currently
implemented SNMP subdrivers are written:

- apc-mib.c/h
- baytech-mib.c/h
Expand All @@ -224,8 +225,8 @@ To help you, above each entry in <LDRIVER>-mib.c, there is a comment that
displays the textual OID name. For example, the following entry:

/* upsMIB.upsObjects.upsIdent.upsIdentModel = STRING: "Dell UPS Tower 1920W HV" */
{ "unmapped.upsidentmodel", ST_FLAG_STRING, SU_INFOSIZE,
".1.3.6.1.4.1.2254.2.4.1.1.0", NULL, SU_FLAG_OK, NULL },
snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE,
".1.3.6.1.4.1.2254.2.4.1.1.0", NULL, SU_FLAG_OK, NULL),

Many times, only the first field will need to be modified, to map to an actual
NUT variable name.
Expand Down

0 comments on commit 16f2b2d

Please sign in to comment.