snmp2xml4j

Printer-friendly versionPDF version

Overview

Snmp2xml4j contains several Java Written tools easing the process of performing and transforming an snmp queries into a structured xml.

Currently the it is able to do snmpget, snmptset, snmpwalk and to transform the results through xslt. It provides a bridge between MIBs and raw data received from the SNMP enabled devices.

Liecense

Snmp2xml4j is distributed under a dual software license. GPL 2 for non commercial use and a commercial software license if you would like to embed it in your "commercial" application.

Repository

The primary repository is in.

https://github.com/iTransformers/snmp2xml4j

Distribution

The library has been distributed over maven central.

An example usage

snmp-walk.bat Walk -md $SNMP2XML4J/mibs -a 10.10.10.10/161 -c public -v 2c -t 1000 -r 1 -m 100 -f output.xml -o "system"

An example ouput.xml

<?xml version="1.0" ?>

<root>
<iso oid="1" >
    <org oid="1.3" >
        <dod oid="1.3.6" >
            <internet oid="1.3.6.1" >
                <mgmt oid="1.3.6.1.2" >
                    <mib-2 oid="1.3.6.1.2.1" >
                        <system oid="1.3.6.1.2.1.1" >
                            <sysDescr oid="1.3.6.1.2.1.1.1">adult playground</sysDescr>
                            <sysObjectID oid="1.3.6.1.2.1.1.2">1.2.3.4</sysObjectID>
                            <sysUpTime oid="1.3.6.1.2.1.1.3" >
                            </sysUpTime>
                            <sysContact oid="1.3.6.1.2.1.1.4">nmil@itransformers.net</sysContact>
                            <sysName oid="1.3.6.1.2.1.1.5">HeartOfGold</sysName>
                            <sysLocation oid="1.3.6.1.2.1.1.6">nbu</sysLocation>
                            <sysServices oid="1.3.6.1.2.1.1.7">0:00:00.05</sysServices>
                            <sysORLastChange oid="1.3.6.1.2.1.1.8">0:00:00.05</sysORLastChange>
                        </system>
                    </mib-2>
                </mgmt>
            </internet>
        </dod>
    </org>
</iso>
</root>