We have this platform that monitor the health of our entire network, when an incident (server down, link down, link up, etc.) occurs, it send an alert. This alert should be catch by a software that I'm developing an my software should propagate this event through a SNMP trap to other devices on the network.

Everything until this point seems fine... except that the server that detects the failure can just emit emails. So i have to detect when a new email arrives and send an SNMP message. The problem here is that the time passed between the reception of the event and the transmission of the message has to be less than 5 seconds. I cannot have a process checking my an email every 5 seconds since this would kill performance.

I was thinking of a trigger activated by the pop server. I've considered everything from installing outlook and make it check my pop server every second to develop a module over an open source pop server... i haven't have any success to this point.

What can you recommend? any guidance will be highly appreciated.



I recommend you convert this from a poll process to a push process. Couple ways I can think of:

Make it so that the email gets sent to a linux server and dumped into a directory. Then run icrond on that directory. That will use inotify to immediately perform an action when a new file appears in the directory.

Alternate: send the mail to a linux server, and use a procmail recipe. That recipe can execute an arbitrary command on that message, like this:

* ^To.*alert@example.com
* ^Subject.*ALERT
| ~/bin/do_trap_thingie

Either approach is workable, the procmail one is probably simpler to set up.

  • "Make it so that the email gets sent to a linux server and dumped into a directory". I like that, in what ways could i do that? – user33760 Jan 19 '11 at 1:20
  • Set up a linux server that can receive mail, create an account on the machine, send your alert mail to thatuser@thatmachine. It's hard to be much more specific than that... – Phil Hollenback Jan 19 '11 at 2:35
  • right Phil, i get it now. In my environment it is impossible to install a linux machine, would you happen yo know which pop server is used by default by linux? – user33760 Jan 19 '11 at 12:42
  • dovecot is the standard pop server in a lot of linux distros these days. – Phil Hollenback Jan 19 '11 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.