BLOG     |     FORUM
Welcome, Guest
Username: Password: Remember me
Get quick Unbrowse SNMP help from Unleash Networks Engineers. The fastest way.

TOPIC: New article : Sending emails on SNMP Traps

New article : Sending emails on SNMP Traps 14 years 3 months ago #263

It helps to keep track of SNMP Trap activity on your network even if you are not around. Making this happen is easy using the Unbrowse SNMP scripting interface. You get the performance win of a native C++ multithreaded trap receiver and the flexibility of a language like Ruby.

I just posted a new article along with a sample Ruby script to accomplish this. You just need to fill in your email server details. Needless to say all versions of SNMP (v1/v2/v3) and IPv4 and IPv6 are supported. You can even decrypt and authenticate SNMPv3 traps.


Check out the article at - Sending emails on SNMP Traps"Sending emails on receiving SNMP Traps"


Enjoy !
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
Last Edit: 14 years 3 months ago by vivek [unleash].
The administrator has disabled public write access.

Re:New article : Sending emails on SNMP Traps 14 years 2 months ago #275

I am looking to have Unbrowse send out emails only when certain criteria are met (certain severity) and then only send out emails on those alarms. Do you think that is possible?
The administrator has disabled public write access.

Re:New article : Sending emails on SNMP Traps 14 years 2 months ago #276

Yes. You can match any criteria you want.

SNMP Traps dont have a concept of priority, so you have to use Unbrowse to assign severity for each trap you are interested in (Traps > Manage Profiles > New Profile)


Alternately if you know the OIDs of the traps you want to trigger emails you can simply add those in the script.


Can you edit the Ruby script (see first post in this thread) to add your custom logic ? If not , reply here and we can help you out

Vivek
Unleash
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
The administrator has disabled public write access.

Re:New article : Sending emails on SNMP Traps 14 years 2 months ago #278

Thanks for your reply. What we are looking to do is have one alert that sends out email to one email address for a certain severity and to another email if the severity is critical. I don't know Ruby scripting very well is there any way you could point me in the right direction?

I'm not looking for an email every 30 minutes with a summary i want this more to be an email every time a trap comes in and sent to the correct person based on either the severity set by Unbrowse or by the var bind for severity which would be the best situation for us.


Thanks,

Donny
The administrator has disabled public write access.

Re:New article : Sending emails on SNMP Traps 14 years 2 months ago #279

Yes, this can be done quite easily. I will post a script here that can do this.

1. You define severity levels based on observed varbind values or based on the trap itself.

2. When you get a trap, you check its severity and set the "To" email field to the correct target.

This would work well if the volume of traps are not high. What if you get 20 traps at once ? Do you want a consolidated email or 20 separate emails ?
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
The administrator has disabled public write access.

Re:New article : Sending emails on SNMP Traps 14 years 2 months ago #280

I have attached the output i am getting after running the script you mentioned. It says it is sending email but it is never sent.

ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]


C:\Documents and Settings\Administrator\Desktop>dir
Volume in drive C has no label.
Volume Serial Number is 70EA-E1A5

Directory of C:\Documents and Settings\Administrator\Desktop

02/17/2010 10:53 AM <DIR> .
02/17/2010 10:53 AM <DIR> ..
02/12/2010 10:26 AM 7,934 Customers.CSV
02/12/2010 10:29 AM <DIR> DOWNLOADS
02/17/2010 10:52 AM 4,764 fileRead.php
02/12/2010 09:18 AM <DIR> mibs
02/17/2010 09:20 AM 68,202 My Devices
02/17/2010 11:02 AM 4,757 t2mail.rb
02/11/2010 02:09 PM 1,978 Unbrowse SNMP.lnk
5 File(s) 87,635 bytes
4 Dir(s) 26,905,776,128 bytes free

C:\Documents and Settings\Administrator\Desktop>t2mail.rb
Loaded the Unbrowse SNMP Trap Server
Starting ..
Listening for traps ..
"Unable to send mail 530 5.7.0 Must issue a STARTTLS command first. 6sm3295407yx
g.30\n"
"Sent email at 2010-02-17 11:14:13 -0700"
stopping the trap receiver
C:/Documents and Settings/Administrator/Desktop/t2mail.rb:157:in `method_missing
': unknown property or method: `Stop' (WIN32OLERuntimeError)
HRESULT error code:0x800706ba
The RPC server is unavailable.
from C:/Documents and Settings/Administrator/Desktop/t2mail.rb:157:in `<
main>'

C:\Documents and Settings\Administrator\Desktop>ruby t2email.rb
ruby: No such file or directory -- t2email.rb (LoadError)

C:\Documents and Settings\Administrator\Desktop>t2mail.rb
Loaded the Unbrowse SNMP Trap Server
Starting ..
Listening for traps ..
"Unable to send mail 530 5.7.0 Must issue a STARTTLS command first. 5sm45912ywd.
29\n"
"Sent email at 2010-02-17 11:19:01 -0700"
stopping the trap receiver
C:/Documents and Settings/Administrator/Desktop/t2mail.rb:157:in `method_missing
': unknown property or method: `Stop' (WIN32OLERuntimeError)
HRESULT error code:0x800706ba
The RPC server is unavailable.
from C:/Documents and Settings/Administrator/Desktop/t2mail.rb:157:in `<
main>'

C:\Documents and Settings\Administrator\Desktop>
The administrator has disabled public write access.
Moderators: vivek [unleash]
Time to create page: 0.035 seconds