NetSNMP::OID(3pm)

NetSNMP::OID3pm

Perl extension for manipulating oids

Usage

  use NetSNMP::OID;
  my $oid = new NetSNMP::OID('sysContact.0');
  if ($oid < new NetSNMP::OID('ifTable')) {
      do_something();
  }
  my @numarray = $oid->to_array();
  # appending oids
  $oid = new NetSNMP::OID('.1.3');
  $oid += ".6.1";
  # -> .1.3.6.1
  # appending index strings
  $oid2 = $oid + "\"wes\"";
  # -> .1.3.6.1.3.119.101.115
  $oid3 = $oid + "\'wes\'";
  # -> .1.3.6.1.119.101.115
  $len = $oid3->length();
  # -> 7
  # retrieving indexes from an oid:
  $arrayref = $tableoid->get_indexes()

Overview

The NetSNMP::OID module is a simple wrapper around a C-based net-snmp oid (which is an array of unsigned integers). The OID is internally stored as a C array of integers for speed purposes when doing comparisons, etc.

The standard logical expression operators (<, >, ==, ...) are overloaded such that lexographical comparisons may be done with them.

The + operator is overloaded to allow you to append stuff on to the end of a OID, like index segments of a table, for example.

Export

int snmp_oid_compare(oid1, oid2) int compare(oid1, oid2)

Releases

10 releases since Debian 3.1 (Sarge); the text changed 9 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 10
  7. 11
  8. 12
  9. 13
  10. Arch

Author

Wes Hardaker, <[email protected]>

From net-snmp 5.9.5.2-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.