Class PropertyMOInput

java.lang.Object
org.snmp4j.agent.io.prop.PropertyMOInput
All Implemented Interfaces:
MOInput

public class PropertyMOInput extends Object implements MOInput
The PropertyMOInput can be used to load MIB data from a properties file.

The format of the properties file is as follows:

   snmp4j.agent.cfg.contexts={s|x}<context1>[,{s|x}<context2>...]
   snmp4j.agent.cfg.oid[.ctx.<context>].<oid>=[<numRows>:<numCols>]
   snmp4j.agent.cfg.oid[.ctx.<context>].<oid>=[{<format>}<value>]
   snmp4j.agent.cfg.index[.ctx.<context>].oid.<rowIndex>={o}<index>
   snmp4j.agent.cfg.value[.ctx.<context>].oid.<rowIndex>.<colIndex>=[{<format>}<value>]
 
where text enclosed in [] is optional and
  • context1 - is a SNMPv3 context name as UTF-8 string (format {s}) or a hexadecimal string (format {x}).
  • context - is a SNMPv3 context name as UTF-8 string if that string does not contain any ISO control characters, otherwise a hexdecimal representation separated by a colon (:).
  • format - one of
    • u - an Unsigned32 value.
    • i - an Integer32 value.
    • s - an OctetString value.
    • x - an OctetString value in hexadecimal format (separated by :).
    • d - an OctetString value in decimal format (separated by .).
    • b - an OctetString value in decimal format (separated by ' ' per byte).
    • n - a Null value.
    • o - an OID value as dotted string where string parts may be specified directly enclosed in single quotes (') and the to an OID converted value of a variable/oid instance may be specified in the format [#]{&lt;name/oid&gt;}. The value of the variable will be included into the OID with prependend length if the # is used in the format string otherwise no length will be included.
    • t - a TimeTicks value as an unsigned long value.
    • a - a IpAddress value.
    • $ - gets the value from the variable or object instance specified by the name/oid following the $.
  • value - a variable value in the format specified by format.
  • numRows - the number of rows in the table.
  • numCols - the number of columns in the table.
  • rowIndex - the row index as a zero based unsigned integer.
  • colIndex - the column index as a zero based unsigned integer.
  • index - the OID value of the row's index.

An example properties file is:

 snmp4j.agent.cfg.contexts=
 snmp4j.agent.cfg.oid.1.3.6.1.2.1.1.2.0={o}1.3.6.1.4.1.4976
 snmp4j.agent.cfg.oid.1.3.6.1.2.1.1.4.0={s}System Administrator
 snmp4j.agent.cfg.oid.1.3.6.1.2.1.1.6.0={s}<edit location>
 snmp4j.agent.cfg.oid.1.3.6.1.2.1.1.7.0={i}10
 snmp4j.agent.cfg.oid.1.3.6.1.2.1.1.9.1=1:2
 snmp4j.agent.cfg.index.1.3.6.1.2.1.1.9.1.0={o}1
 snmp4j.agent.cfg.value.1.3.6.1.2.1.1.9.1.0.0={o}1.3.6.1.4.1.4976.10.1.1.100.4.1
 snmp4j.agent.cfg.value.1.3.6.1.2.1.1.9.1.0.1=
 ## VACM MIB
 # security2Group
 snmp4j.agent.cfg.oid.1.3.6.1.6.3.16.1.2.1=2:3
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.2.1.0={o}2.6.'public'
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.0.0={s}v1v2cgroup
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.0.1={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.0.2={i}1
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.2.1.1={o}3.6.'SHADES'
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.1.0={s}v3group
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.1.1={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.2.1.1.2={i}1
 # access
 snmp4j.agent.cfg.oid.1.3.6.1.6.3.16.1.4.1=2:6
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.4.1.0={o}10.'v1v2cgroup'.0.2.1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.0={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.1={s}unrestrictedReadView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.2={s}unrestrictedWriteView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.3={s}unrestrictedNotifyView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.4={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.0.5={i}1
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.4.1.1={o}7.'v3group'.0.3.3
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.0={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.1={s}unrestrictedReadView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.2={s}unrestrictedWriteView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.3={s}unrestrictedNotifyView
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.4={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.4.1.1.5={i}1
 # view trees
 snmp4j.agent.cfg.oid.1.3.6.1.6.3.16.1.5.2.1=3:4
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.5.2.1.0={o}20.'unrestrictedReadView'.3.1.3.6
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.0.0={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.0.1={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.0.2={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.0.3={i}1
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.5.2.1.1={o}21.'unrestrictedWriteView'.3.1.3.6
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.1.0={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.1.1={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.1.2={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.1.3={i}1
 snmp4j.agent.cfg.index.1.3.6.1.6.3.16.1.5.2.1.2={o}22.'unrestrictedNotifyView'.3.1.3.6
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.2.0={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.2.1={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.2.2={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.16.1.5.2.1.2.3={i}1
 ## SNMP community MIB
 snmp4j.agent.cfg.oid.1.3.6.1.6.3.18.1.1.1=1:7
 snmp4j.agent.cfg.index.1.3.6.1.6.3.18.1.1.1.0={o}'public'
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.0={s}public
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.1={s}public
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.2={$1.3.6.1.6.3.10.2.1.1.0}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.3={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.4={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.5={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.18.1.1.1.0.6={i}1
 ## USM MIB
 snmp4j.agent.cfg.oid.1.3.6.1.6.3.15.1.2.2.1=1:14
 snmp4j.agent.cfg.index.1.3.6.1.6.3.15.1.2.2.1.0={o}$#{1.3.6.1.6.3.10.2.1.1.0}.6.'SHADES'
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.0={s}SHADES
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.1={o}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.2={o}1.3.6.1.6.3.10.1.1.3
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.3={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.4={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.5={o}1.3.6.1.6.3.10.1.2.2
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.6={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.7={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.8={s}
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.9={i}4
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.10={i}1
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.11={s}SHADESAuthPassword
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.12={s}SHADESPrivPassword
 snmp4j.agent.cfg.value.1.3.6.1.6.3.15.1.2.2.1.0.13=

 
Version:
1.2
Author:
Frank Fock