LuaSNMP
LuaSNMP is a library for programming Simple Network Management Protocol (SNMP) client applications based on the Net-SNMP library. It provides access to MIB definitions and supports all primitives of SNMP version 1, 2c and 3.
The project is the continuation of LuaMan, developed by Michele E. Lima and Ana Lucia de Moura, which itself is based on the CMU library from the Carnegie Mellon University and uses Lua version 2.5. I decided not to integrate the LuaMan ICMP and DNS submodules into LuaSNMP, because DNS access is now availabe through the excellent LuaSocket library, which is probably also a better home for the ICMP stuff.
License
LuaSNMP is released under the MIT/X-Consortium License.
Features
LuaSNMP is divided into two major parts:
- Access to MIB definition files
- Access to the SNMP protocol primitives
Supported Platforms
- POSIX systems including Linux and Windows using Cygwin.
General Features
- LuaSNMP can be loaded dynamically from user Lua scripts.
- Addtional standalone application luasnmp with built-in Net-SNMP library and Lua support.
- Support of SNMP version 1, 2c and 3
- Access and evaluation of Net-SNMP's configuration files
- Support of addional configuration tokens
MIB Access Features
- Loading of MIBs into a global MIB tree for later usage.
- Translation of object names to OIDs and vice versa.
- Access to the following SNMP object properties: name, fullname, OID, description, enums, type, access, parent and successor objects and default values.
SNMP Access Features
- Support of SNMP version 1, 2c and 3 authentication.
- Concurrent session based communication with multiple devices.
- Synchronous and asynchronous requests using callback functions.
- Support of PDU encryption
- Simple object-oriented access to SNMP objects, tables and subtrees using Lua metatables
- Arithmetic operations and comparison on variable bindings using Lua metatables.
Download
LuaSNMP can be downloaded from LuaForge.
Installation
You need the following components to compile and install LuaSNMP:
- Lua version 5.0 or 5.1
- Lua 5.1 compatibilty package Compat-5.1 release 5 or later (only with Lua 5.0)
- The Net-SNMP library version 5.2.1 or later; recommended: Net-SNMP 5.4.1
- LuaSocket version 2.0.2 (only required for trap capturing via the snmptrapd)
- LuaLogging version 1.1.4 (only required for the test script and trap capturing via the snmptrapd)
- stdlib release 8 (only required for the test script)
I recommend to install LuaSocket, LuaLogging and stdlib using LuaRocks.
For detailed install instructions see the INSTALL file that comes with the distribution.
What's New ?
- 2006-04-09: LuaSNMP version 1.0-beta has been released.
- Initial release.
- 2006-04-18: LuaSNMP version 1.0.1 released (still beta).
- Minor release providing some bug fixes, improved build environment and deeper testing on Windows/Cygwin platform
- 2006-05-06: LuaSNMP version 1.0.2 released (still beta)
- Various bugfixes.
- Better support of ASN.1 special OPAQUE types (UNSIGNED64, INTEGER64, FLOAT, DOUBLE).
- snmp.walk() now returns all objects that could be retrieved before an error occured.
- Support of SNMPv3 user security management (add, clone and delete users, change password on remote machines)
- 2006-05-14: LuaSNMP version 1.0.3 released (still beta)
- Bugfixes
- Additional MIB informational functions mib.indexes, mib.augments and mib.units.
- Support of view based access VACM (create/delete Sec2Group Mapping, Views and Access).
- 2006-06-17: LuaSNMP version 1.0.4 released (still beta)
- Bugfixes
- Improved failure handling - Now all functions should return a
non-nil value in case of success or nil plus an error message in case
of failures. No asserts are used anymore within LuaSNMP.
ATTENTION: The function snmp.close(SESSION) had to be changed. You may have to change your code. Sorry ! - Closely related to the above, LuaSNMP now offers Finalized Exceptions as designed by Diego Nehab for the luasocket library. See here for details.
- 2009-07-05: LuaSNMP version 1.0.5 released
- Adopted to Net-SNMP version 5.4.1
- Adopted to Lua 5.1.4
- Minor fixes
Credits
- Thanks to Michele E. Lima and Ana Lucia de Moura for LuaMan with it's excellent architecture, from which LuaSNMP and parts of it's documentation have been derived. It was fun to extend this piece of software with the features of Lua 5.x.
- Thanks to Diego Nehab for his concept of Finalized Exceptions.
