GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SNMP::Util::OID(3) User Contributed Perl Documentation Net::SNMP::Util::OID(3)

Net::SNMP::Util::OID - OID mapper functions for Net::SNMP::Util

    # load system and interfaces MIB map
    use Net::SNMP::Util::OID qw(sys* if*);

    printf "OID of sysDescr is %s\n", oid("sysDescr");
    # "1.3.6.1.2.1.1.1"

    printf "1.3.6.1.2.1.2.2.1.3 specifys %s\n", oidt("1.3.6.1.2.1.2.2.1.3");
    # ifType

    printf "OID of MIB %s is %s\n", oidm("ifName");
    # "ifName", "1.3.6.1.2.1.31.1.1.1.1"

    oid_load("someMib1" => "1.3.6.1.4.1.99999.1.2.3",
             "someMib2" => "1.3.6.1.4.1.99999.4.5.6");
    printf "OID of MIB %s is %s\n", oidm("someMib1");

Module "Net::SNMP::Util::OID" gives some functions which treats mapping data between MIB name and OID.

This module is preparing some basic MIB and OID maps mainly definded RFC-1213. For example, if you want to treat some MIB and OID with among 'system' and 'snmp' entry group's, declare with "use" pragma and gives arguments with tailing '*' like;

    use Net::SNMP::Util::OID qw(system* snmp*);

So, note that no declaring with this tagging couldn't treat mapping data.

    use Net::SNMP::Util::OID;
    $oid = oid("ifType");       # Null string will return!

The prepared entrys are; "system*", "interfaces*", "at*", "ip*", "icmp*", "tcp*", "udp*", "egp*", "snmp*", "tcp*" and "ifXTable*". And there are few sugar syntaxs. Only one character '*' means all prepared mapping, 'sys*' means 'system*' and 'if*' means importing 'interfaces' and 'ifXTable' at same time.

This module, "Net::SNMP::Util::OID", exports "oid_load()", "oid()", "oidt()" and "oidm()".

    oid_load( $mib_name => $oid, ... );
    oid_load( \%somehash, ... );

Functions oid_load() takes hash pairs or a referances of hash as arguments, and store intarnally MIB name and OID (Object IDentifier) mapping data from them.

    oid( $mib_name, ... )

Function "oid()" takes MIB names and returns OIDs of them. If OID is not found, given MIB name uses as returing value.

This function treats sub OID of a part of given MIB name as well as sample below;

    print oid("ifName.100");  # shows 1.3.6.1.2.1.31.1.1.1.1.100

    oidt( $mib_oid, ... )

Function "oidt()" translates OID to MIB name. This returns null string '' if it can't find specified OID.

    ($mib_name, $oid) = oidp( $mib_name )

Function "oidp()" takes a MIB name and returns array contains itself and it's OID search by "oid()".

t.onodera, "<cpan :: garakuta.net>"

Net::SNMP::Util, Net::SNMP::Util::TC

Copyright(C) 2010 Takahiro Ondoera.

This program is free software; you may redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2011-02-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.