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,