fr.jrds:snmpcodec

snmpcodec is a free and opensource implementation of OIDTextFormat and VariableTextFormat for SNMP4J.

License

License

GroupId

GroupId

fr.jrds
ArtifactId

ArtifactId

snmpcodec
Last Version

Last Version

0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

fr.jrds:snmpcodec
snmpcodec is a free and opensource implementation of OIDTextFormat and VariableTextFormat for SNMP4J.
Project URL

Project URL

https://github.com/fbacchella/snmpcodec
Source Code Management

Source Code Management

https://github.com/fbacchella/snmpcodec.git

Download snmpcodec

How to add to project

<!-- https://jarcasting.com/artifacts/fr.jrds/snmpcodec/ -->
<dependency>
    <groupId>fr.jrds</groupId>
    <artifactId>snmpcodec</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/fr.jrds/snmpcodec/
implementation 'fr.jrds:snmpcodec:0.0.7'
// https://jarcasting.com/artifacts/fr.jrds/snmpcodec/
implementation ("fr.jrds:snmpcodec:0.0.7")
'fr.jrds:snmpcodec:jar:0.0.7'
<dependency org="fr.jrds" name="snmpcodec" rev="0.0.7">
  <artifact name="snmpcodec" type="jar" />
</dependency>
@Grapes(
@Grab(group='fr.jrds', module='snmpcodec', version='0.0.7')
)
libraryDependencies += "fr.jrds" % "snmpcodec" % "0.0.7"
[fr.jrds/snmpcodec "0.0.7"]

Dependencies

compile (2)

Group / Artifact Type Version
org.snmp4j : snmp4j jar 2.7.0
org.antlr : antlr4-runtime jar 4.7.1

provided (1)

Group / Artifact Type Version
org.antlr : antlr4 jar 4.7.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

snmpcodec is a resilient SNMP parser and formater. It's purpose is not to manage a mib, check module or similar tasks. It's used to help processing SNMP messages, and be able to use all the broken modules that can be found all around.

For this taks, it uses the excelent ANLTR parser generator that recover from many failure in module source. It can also take hint and help about the way to process file or missing symbols.

It can process table index

MibTree resolver = new MibTree();
OID vacmAccessContextMatch = new OID("1.3.6.1.6.3.16.1.4.1.4.7.118.51.103.114.111.117.112.0.3.1");
Map<String, Object> parts = resolver.parseIndexOID(vacmAccessContextMatch.getValue());
parts.forEach( (i,j)-> System.out.format("%s '%s' %s\n", i, j, j.getClass().getName()));

will output.

vacmAccessTable 'vacmAccessContextMatch' java.lang.String
vacmGroupName 'v3group' java.lang.String
vacmAccessContextPrefix '' java.lang.String
vacmAccessSecurityModel '3' java.lang.Integer
vacmAccessSecurityLevel 'noAuthNoPriv' java.lang.String

It can also be used with SNMP4J as it provides an help class that implement OIDTextFormat and VariableTextFormat.

To use it, just call

    OIDFormatter.register()

It will then used the property snmpcodec.mibdirssnmpcodec.mibdirs formatted as path using the JVM's path separator. If this property is not set, modules are searched in /usr/share/snmp/mibs/usr/share/snmp/mibs.

It's available in Maven, just add in your dependencies:

<dependency>
    <groupId>fr.jrds</groupId>
    <artifactId>snmpcodec</artifactId>
    <version>0.0.5</version>
</dependency>

Versions

Version
0.0.7
0.0.6
0.0.5