Next
Network UPS Tools Developer Guide
Russell Kroll, Arnaud Quette, Charles Lepple, Peter Selinger, Jim Klimov and NUT project community contributors
Table of Contents
1. Introduction
2. NUT design document
2.1. The layering
2.2. How information gets around
2.3. Instant commands
2.4. Setting variables
2.5. Example data path
2.6. History
3. NUT versioning
3.1. Historic note
3.2. Current NUT SEMVER definition
3.3. Using gitlog2version.sh
3.4. Variables propagated by configure.ac
3.5. Variables propagated by nut_version.h
3.6. Use in C code
4. Information for developers
4.1. General stuff — common subdirectory
4.2. Device drivers — main.c
4.3. Portability
4.4. Continuous Integration and Automated Builds
4.5. Integrated Development Environments (IDEs) and debugging NUT
4.6. Coding style
4.7. Miscellaneous coding style tools
4.8. Submitting patches
4.9. Patch cohesion
4.10. The finishing touches: manual pages and device entry in HCL
4.11. Source code management
4.12. Ignoring generated files
4.13. Commit message formatting
4.14. Commit sign-off
4.15. Repository etiquette and quality assurance
4.16. Building the Code
5. Creating a new driver to support another device
5.1. Smart vs. Contact-closure
5.2. Serial vs. USB vs. SNMP and more
5.3. Overall concept
5.4. Skeleton driver
5.5. Essential structure
5.6. Essential functions
5.7. Data types
5.8. Manipulating the data
5.9. UPS alarms
5.10. Staleness control
5.11. Serial port handling
5.12. USB port handling
5.13. Variable names
5.14. Message passing support
5.15. Enumerated types
5.16. Range values
5.17. Writable strings
5.18. Instant commands
5.19. Delays and ser_* functions
5.20. Canonical input mode processing
5.21. Adding the driver into the tree
5.22. Contact closure hardware information
5.23. How to make a new subdriver to support another USB/HID UPS
5.24. How to make a new subdriver to support another SNMP device
5.25. How to make a new subdriver to support another Q* UPS
6. Driver/server socket protocol
6.1. Formatting
6.2. Commands used by the drivers
6.3. Commands sent by the server
6.4. Design notes
7. NUT configuration management with Augeas
7.1. Introduction
7.2. Requirements
7.3. Create a test sandbox
7.4. Start testing and using
7.5. Complete configuration wizard example
8. NUT device discovery
8.1. Introduction
8.2. Python
8.3. Perl
8.4. Java
9. Creating new client
9.1. C / C++
9.2. Python
9.3. Perl
9.4. Java
10. Network protocol information
10.1. Old command removal notice
10.2. Command reference
10.3. Revision history
10.4. GET
10.5. LIST
10.6. SET
10.7. INSTCMD
10.8. LOGOUT
10.9. LOGIN
10.10. PRIMARY (since NUT 2.8.0) or MASTER (deprecated)
10.11. FSD
10.12. PASSWORD
10.13. USERNAME
10.14. STARTTLS
10.15. Other commands
10.16. Error responses
10.17. Future ideas
11. NUT developers tools
11.1. Device simulation
11.2. Simulated devices discovery
11.3. Device recording
12. NUT core development and maintenance
12.1. NUT-specific autoconf macros
12.2. NUT roadmap and ideas for future expansion
A. NUT command and variable naming scheme
A.1. Structured naming
A.2. Numeric format
A.3. Time and Date format
A.4. Variables
device: General unit information
ups: General unit information
input: Incoming line/power information
output: Outgoing power/inverter information
Three-phase additions
EXAMPLES
battery: Any battery details
ambient: Conditions from external probe equipment
outlet: Smart outlet management
driver: Internal driver information
server: Internal server information
A.5. Instant commands
Experimental instant commands
B. NUT daisychain support notes
B.1. Introduction
B.2. Implementation notes
General specification
Information for developers
C. NUT libraries complementary information
C.1. Introduction
C.2. libupsclient-config
C.3. pkgconfig support
C.4. Example configure script
C.5. Future consideration
C.6. Libtool information