SNMP::Effective::Dispatch - Base class for SNMP::Effective
SNMP::Effective inherit from this class. The methods here are separated out just for convenience.
This hash contains a mapping between
$effective->add($key => [...]); SNMP::Effective::Dispatch::_$key(); SNMP::$value();
This means that you can add your custom SNMP method if you like.
The SNMP::Effective::Dispatch::_walk() method, is a working example on this, since it's actually a series of getnext, seen from SNMP's perspective.
SNMP::Effective::Dispatch::_walk()
Example:
$SNMP::Effective::Dispatch::METHOD{'foo'} = 'get'; *SNMP::Effective::Dispatch::_foo = sub { my($self, $host) = @_; # do stuff... return $self->_end($host); }; my $effective = SNMP::Effective->new( foo => [$oid], # ... ); # execute() will then call $effective->_foo($host) when # $host answer with data $effective->execute;
This method does the actual fetching, and is called by "execute" in SNMP::Effective.
See SNMP::Effective
To install SNMP::Effective, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SNMP::Effective
CPAN shell
perl -MCPAN -e shell install SNMP::Effective
For more information on module installation, please visit the detailed CPAN module installation guide.