SNMP agent library?

Discussion in 'Ruby' started by Marcus Bristav, Apr 12, 2007.

  1. I need to write an SNMP agent (raise traps and expose MIBs). Is there
    a nice Ruby open source library to help with this? I saw Ruby SNMP but
    that only seems to handle the management side of it. Please also let
    me if I'm wrong about that.

    Regards,

    Marcus
    Marcus Bristav, Apr 12, 2007
    #1
    1. Advertising

  2. Hi Francis,

    On 4/13/07, Francis Cianfrocca <> wrote:
    > If you don't find anything appropriate that already exists, let me know. I
    > wrote a SNMP agent on top of EventMachine (except for traps, which in my
    > application are verboten) for managing an access-control appliance. It
    > exposes a handful of standard MIBs and of course it's extensible.
    >
    > I put some of the necessary SNMP protocol support in the Net::LDAP library,
    > so it can use the BER functionality. This may be useful if you end up
    > rolling your own agent. Sync to the latest source code, because it's not in
    > the latest Net::LDAP release, which is somewhat out of date.


    I'd be very interested in this. Is the SNMP code available somewhere
    or is it used in your company? Traps would be possible to add I
    suppose (if I study the protocol somewhat...)?

    /Marcus
    Marcus Bristav, Apr 13, 2007
    #2
    1. Advertising

  3. On 4/13/07, Francis Cianfrocca <> wrote:

    > We're using it internally and it works quite well. Traps are not difficult
    > to implement, but they do evil things to your network ;-). The agent would
    > need some documentation before a public release. Are you willing to help
    > with that?
    >


    I can help with documentation. Keep in mind though that I'm still in
    research mode so the speed won't be that great initially. But I've
    heard only good things about Eventmachine so it will be exciting to
    test it out and learn to use it. Maybe we can find more uses for it
    here :)

    /Marcus
    Marcus Bristav, Apr 13, 2007
    #3
  4. Ok. You can send me offlist to my address used here.

    This sounds very interesting indeed. Thanks a lot :)

    /Marcus

    On 4/14/07, Francis Cianfrocca <> wrote:
    > On 4/13/07, Marcus Bristav <> wrote:
    > >
    > > On 4/13/07, Francis Cianfrocca <> wrote:
    > >
    > > I can help with documentation. Keep in mind though that I'm still in
    > > research mode so the speed won't be that great initially. But I've
    > > heard only good things about Eventmachine so it will be exciting to
    > > test it out and learn to use it. Maybe we can find more uses for it
    > > here :)

    >
    >
    >
    > Ok, I refactored our app-specific MIB handling out and I have a
    > functionally-complete SNMP agent (minus trap support). You have to add your
    > own MIBs. Eventually we should have built-in support
    > for the standard ones, as long as they are easily scriptable. Here's what
    > your code would look like:
    >
    > #--------------------------------------------------------
    > require "rubygems"
    > require "eventmachine"
    > require "net/snmp"
    >
    > require 'snmpagent'
    > include EventMachine::SnmpAgent
    >
    > agnt = Agent.new :verbose=>true
    >
    > agnt.add_object [1,3,6,1,2,1,1,1,0], "baloney"
    > agnt.add_object [1,3,6,1,2,1,1,3,0], proc {`cat
    > /proc/uptime`.split.first.to_i * 100}
    >
    > agnt.run
    > #--------------------------------------------------------
    >
    >
    > You can test with snmpwalk or any "real" management system. This code has
    > been tested against OpenView, Argent, SolarWinds, and some others. Obviously
    > the example only adds two managed objects. In practice you would add your
    > "real" objects in a Ruby module whose name you pass to
    > EventMachine::SnmpAgent::Agent#new.
    >
    > If you're interested, I can send the library to your private email. If
    > anyone else is interested, let me know here and I'll put a distro package on
    > the EventMachine rubyforge page.
    >
    > The net/snmp library comes from the Net::LDAP library (on Rubyforge).
    >
    Marcus Bristav, Apr 14, 2007
    #4
  5. On Sat, Apr 14, 2007 at 11:08:33PM +0900, Francis Cianfrocca wrote:
    > agnt = Agent.new :verbose=>true
    >
    > agnt.add_object [1,3,6,1,2,1,1,1,0], "baloney"
    > agnt.add_object [1,3,6,1,2,1,1,3,0], proc {`cat
    > /proc/uptime`.split.first.to_i * 100}
    >
    > agnt.run

    ...
    > If you're interested, I can send the library to your private email. If
    > anyone else is interested, let me know here and I'll put a distro package on
    > the EventMachine rubyforge page.


    I'm interested.

    Regards,

    Brian.
    Brian Candler, Apr 14, 2007
    #5
  6. Marcus Bristav

    Peña, Botp Guest

    From: Francis Cianfrocca [mailto:]=20
    # anyone else is interested, let me know here and I'll put a=20
    # distro package on the EventMachine rubyforge page.

    pls. thanks for eventmachine et al.
    kind regards -botp
    Peña, Botp, Apr 16, 2007
    #6
  7. Marcus Bristav

    Matt Matson Guest

    Francis Cianfrocca wrote:
    > On 4/13/07, Marcus Bristav <> wrote:
    >> > I put some of the necessary SNMP protocol support in the Net::LDAP

    >> /Marcus
    >>
    >>

    >
    > We're using it internally and it works quite well. Traps are not
    > difficult
    > to implement, but they do evil things to your network ;-). The agent
    > would
    > need some documentation before a public release. Are you willing to help
    > with that?
    >
    > Is there anyone else who would want to use such a thing?


    I'm very interested in using / contributing to your agent code!
    -m2matson
    --
    Posted via http://www.ruby-forum.com/.
    Matt Matson, Feb 10, 2008
    #7
  8. [Note: parts of this message were removed to make it a legal post.]

    On Feb 10, 2008 1:54 PM, Matt Matson <> wrote:

    > Francis Cianfrocca wrote:
    > > On 4/13/07, Marcus Bristav <> wrote:
    > >> > I put some of the necessary SNMP protocol support in the Net::LDAP
    > >> /Marcus
    > >>
    > >>

    > >
    > > We're using it internally and it works quite well. Traps are not
    > > difficult
    > > to implement, but they do evil things to your network ;-). The agent
    > > would
    > > need some documentation before a public release. Are you willing to help
    > > with that?
    > >
    > > Is there anyone else who would want to use such a thing?

    >
    > I'm very interested in using / contributing to your agent code!
    > -m2matson
    >




    Take a look at the implementation in Ruby/EventMachine. The SNMP agent
    skeleton is in a separate gem which you'll find on the Rubyforge
    EventMachine project page. The test cases should show you how to use it.
    It's pretty simple, actually.
    Francis Cianfrocca, Feb 10, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ofer Razon

    SNMP Agent development

    Ofer Razon, May 31, 2004, in forum: Perl
    Replies:
    1
    Views:
    2,083
    Hans =?iso-8859-1?Q?J=F8rgen?= Jakobsen
    Jun 1, 2004
  2. alain

    SNMP agent

    alain, Apr 4, 2007, in forum: Python
    Replies:
    7
    Views:
    624
  3. 01211983

    Agent SNMP (need help)

    01211983, Apr 14, 2009, in forum: Java
    Replies:
    1
    Views:
    421
    01211983
    Apr 15, 2009
  4. Talking to SNMP Agent from ASP

    , Dec 2, 2005, in forum: ASP General
    Replies:
    0
    Views:
    150
  5. Replies:
    0
    Views:
    97
Loading...

Share This Page