NAME
SNMP::OID::Translate
VERSION
version 0.0005
SYNOPSIS
use SNMP::OID::Translate;
my $oid = $SNMP::OID::Translate:::translateObj('ifDescr');
VARIABLES
- $use_long_names
-
Returns the complete name rather than the short version. Most of the time you don't need or want this.
- $best_guess
-
Setting this to 1 will enable regex lookups for names, so things like 'if.*Status' work. With this turned on you can't append the instance or use a period in the query because it treats it as regex.
Setting this to 2 turns on "random access". I'm not sure what that does. See the snmpcmd manpage for -Ib (regex) and -IR (random access)
Defaults to 0.
- $verbose
-
Enable verbose messages. Defaults to false.
- $auto_init_mib
-
enable automatic MIB loading at session creation time. Defaults to true.
SUBROUTINES
translateObj
my $oid = translateObj('ifDescr');
Translate object identifier(tag or numeric) into alternate representation (i.e., sysDescr => '.1.3.6.1.2.1.1.1' and '.1.3.6.1.2.1.1.1' => sysDescr) when $SNMP::OID::Translate::use_long_names or second arg is non-zero the translation will return longer textual identifiers (e.g., system.sysDescr). An optional third argument of non-zero will cause the module name to be prepended to the text name (e.g. 'SNMPv2-MIB::sysDescr'). If no Mib is loaded when called and $SNMP::OID::Translate::auto_init_mib is enabled then the Mib will be loaded. Will return 'undef' upon failure.
translate
my $result = translate([ 'ifDescr', 'ifInOctets' ]);
This will translate an arrayref or list of objects into their OIDs or translate OIDs into their names. Returns an arrayref.
AUTHOR
bugs, comments, questions to <rdrake at cpan.org>
Copyright
Most of the source code is directly copied from the SNMP modules. I am leaving their copyright notice intact but please direct complaints, feature requests or whatever to me (RDRAKE)
Copyright (c) 1995-2000 G. S. Marzot. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Copyright (c) 2001-2002 Networks Associates Technology, Inc. All
Rights Reserved. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl
itself.
AUTHOR
Robert Drake <rdrake@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Robert Drake.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.