Code Monkey home page Code Monkey logo

jmx2snmp's Introduction

Bridge

// export JMX beans either through Spring, Guice or jmxutils
final MBeanExporter exporter = new MBeanExporter(ManagementFactory.getPlatformMBeanServer());
exporter.export("bean:name=test1", new TestBeanImpl()); 

// fire up JMX
final JmxServer jmxServer = new JmxServer(InetAddress.getByName("localhost"));
jmxServer.start();  

// load mib mapping
final URL url = JmxutilsTestCase.class.getResource("/org/vafer/jmx2snmp/mapping.properties");
final JmxMib jmxMib = new JmxMib();
jmxMib.load(new FileReader(url.getFile()));

// build MBean index
final JmxIndex = new JmxIndex();

// fire up SNMP bridge
final SnmpBridge snmpBridge = new SnmpBridge(InetAddress.getByName("localhost"), 1161, jmxIndex, jmxMib);
snmpBridge.start();

// show inconsistencies in the mapping (if there are)
snmpBridge.report();

Mapping

1.3.6.1.4.1.27305 = <oid>
1.3.6.1.4.1.27305.12 = test1
1.3.6.1.4.1.27305.12.1 = AnotherInt
1.3.6.1.4.1.27305.12.2 = Blue
1.3.6.1.4.1.27305.12.3 = Boolean
1.3.6.1.4.1.27305.12.4 = BooleanArray
1.3.6.1.4.1.27305.12.5 = IntArray
1.3.6.1.4.1.27305.12.6 = IntegerArray
1.3.6.1.4.1.27305.12.7 = Long
1.3.6.1.4.1.27305.12.8 = SomeInt
1.3.6.1.4.1.27305.12.9 = SomeObjects
1.3.6.1.4.1.27305.12.10 = SomethingMapped
1.3.6.1.4.1.27305.12.11 = SomethingUnique
1.3.6.1.4.1.27305.12.12 = String
1.3.6.1.4.1.27305.12.13 = StringArray
1.3.6.1.4.1.27305.12.14 = StringTable
1.3.6.1.4.1.27305.12.15 = TestRowArray

Test

snmpwalk -On -c public -v 1 localhost:1161 1.3.6.1.4.1.27305.12
snmpget -On -c public -v 1 localhost:1161 1.3.6.1.4.1.27305.12.8

Integration with snmpd

proxy -v 1 -c public localhost:1161 .1.3.6.1.4.1.27305

License

Licensed under the Apache License, Version 2.0 (the "License") You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.