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

TOPIC: t2email.rb script not working

t2email.rb script not working 11 years 9 months ago #708

  • TN
  • TN's Avatar
Hi there,

I'm using unbrowse SNMP version 1.6.0.1321 and using the t2email ruby script so that we can send emails whenever we see SNMP traps but it's not working at all. We can start the ruby script with no problems but whenever we send a trap, the script exists with the message, "stopping the trap receiver". We've tried using Ruby 1.8.7 and 1.9.3 and it's the same thing. Is this t2email script not compatible with the version of 'Unbrowse SNMP' that we're using? Thank you very much!
The administrator has disabled public write access.

Re:t2email.rb script not working 11 years 9 months ago #709

Looks like an error with sending the email. Can you remove the following lines and see what the error message is ?

1. Remove the lines the lines that say begin/rescue/end


So the main loop should look like this
last_processed = 0

while true
	 trap_text = ""
     end_id  = trap_mgr.TrapCount
	 (last_processed..end_id-1).each do |tid|
         trap_text << pr_trap(trap_mgr.GetTrapByIdx(tid))
		 trap_mgr.DeleteTrapByIdx(tid-1)
	 end
     last_processed = end_id
     
     # send email out
     unless trap_text.empty?
		mail_this("Unbrowse SNMP Trap report", trap_text, mail_settings, server_settings)
	 end

     sleep(mail_frequency_seconds)
end

Now run the script and we can see the actual error message. Post that message here.

Thanks,
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: vivek [unleash]
Time to create page: 0.035 seconds