[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SNMP agent library?

Marcus Bristav

4/12/2007 9:37:00 PM

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

7 Answers

Marcus Bristav

4/13/2007 9:57:00 AM

0

Hi Francis,

On 4/13/07, Francis Cianfrocca <garbagecat10@gmail.com> 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

4/13/2007 6:24:00 PM

0

On 4/13/07, Francis Cianfrocca <garbagecat10@gmail.com> 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

4/14/2007 4:32:00 PM

0

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 <garbagecat10@gmail.com> wrote:
> On 4/13/07, Marcus Bristav <marcus.bristav@gmail.com> wrote:
> >
> > On 4/13/07, Francis Cianfrocca <garbagecat10@gmail.com> 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).
>

Brian Candler

4/14/2007 4:35:00 PM

0

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.

Peña, Botp

4/16/2007 3:12:00 AM

0

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

pls. thanks for eventmachine et al.
kind regards -botp

Matt Matson

2/10/2008 6:54:00 PM

0

Francis Cianfrocca wrote:
> On 4/13/07, Marcus Bristav <marcus.bristav@gmail.com> 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-....

Francis Cianfrocca

2/10/2008 7:36:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Feb 10, 2008 1:54 PM, Matt Matson <m2matson@gmail.com> wrote:

> Francis Cianfrocca wrote:
> > On 4/13/07, Marcus Bristav <marcus.bristav@gmail.com> 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.