> Copyright (c) 2003-2004 AirWave Wireless, Inc.
> Redistribution and use in source and binary forms, with or without > modification, are permitted provided that the following conditions > are met:
> 1. Redistributions of source code must retain the above
> copyright notice, this list of conditions and the following
> disclaimer.
> 2. Redistributions in binary form must reproduce the above
> copyright notice, this list of conditions and the following
> disclaimer in the documentation and/or other materials provided
> with the distribution.
> 3. The name of the author may not be used to endorse or
> promote products derived from this software without specific
> prior written permission.
> THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS > OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING > NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SNMP is a new pure-Perl SNMP management library that's dramatically faster, simpler to use, and less bug-prone than Net::SNMP, the widely-used pure-Perl SNMP library.
SNMP is also more flexible than Net::SNMP, in that you could use it to build an SNMP agent, SNMP packet dumper, POE component, etc., without rewriting major parts of the code. None of these features are built in yet, except for a skeletal undocumented 87-line SNMP agent implementation used for the regression tests.
However, Net::SNMP is much more mature and presently supports more features, including SNMPv3, traps, the new request types introduced in SNMPv2 (bulk gets and inform requests), nonblocking callback-based operation, OID sorting, robustness against some common bugs in SNMP agent implementations (specifically, sending negative values for unsigned numbers, and circular getNextRequest handling) and (in the easy-to-use SNMP::Simple interface) multiple OIDs per request.
I plan to add all of these features, but the existing featureset actually covers the majority of management-station uses of SNMP I've seen. SNMPv2 is more efficient than SNMPv1, but not as widely supported, and SNMPv2 support is often buggy. Management stations, by definition, don't send SNMP traps or inform-requests. SNMPv3 still isn't widely deployed, despite the absurd security problems SNMPv1 creates. Nonblocking operation is important for some high-performance applications, but harder to use. OID sorting is primarily useful when you're implementing an agent; both this package and Net::SNMP give you back OIDs from walks in sorted order.
That said, this package is about 20% of the size of Net::SNMP, counting non-duplicate lines of B::Deparse'd code in SNMP.pm, SNMP/Simple.pm, and SNMP/Mapper.pm.
On the other hand, the regression tests for Net::SNMP are just over
100 lines (using the same metric), while the regression tests for this
module are about 550.
Why would you want to use this module instead of its much-more-mature
sibling, Net::SNMP?
Well, usually, you wouldn't. I anticipate that this module will get better in time, but right now, you probably don't want to use it, unless Net::SNMP just doesn't work for you.
Some of the reasons Net::SNMP doesn't work for me follow:
sub debug
{
(@_ == 2) ? $DEBUG = ($_[1]) ? TRUE : FALSE : $DEBUG;
}
That routine exists, in exactly the same form, in Net::SNMP::Security::USM, Net::SNMP::Security::Community, Net::SNMP::MessageProcessing, Net::SNMP::Message, Net::SNMP::Dispatcher, Net::SNMP::Transport::UDP, Net::SNMP::PDU, and Net::SNMP::Security. It is by no means the only code duplicated verbatim between these modules.