Community
Zenoss Newsletter

Monitored by Zenoss
SourceForge.net Logo

Monitoring Email Delivery and Receipt

by zenoss last modified 2007-06-08 09:47AM

How to use check_email_delivery to monitor sending of email via SMTP and receipt of email at an IMAP server

check_email_delivery is a plugin that sends an email via smtp and checks receipt of that email via imap. This can be added to a zenoss perf config to trigger events when there is a problem with the email circuit.

Steps:

  • Obtain check_email_delivery.pl, check_smtp_send.pl and check_imap_receive.pl from here and place them in $ZENHOME/libexec.
  • Remove the .pl extension from all three files
  • Make the files executable by the zenoss user. Something like chmod 755 should do the trick.
  • Test the plugin with something like the line below. If your smtp and imap servers are on different boxes or ifyou use nonstandard ports then take a look at the check_email_delivery code to determine the proper arguments. You can use any address for --mailfrom, but using an address you can check might help you in debugging if necessary.
    > ./check_email_delivery.pl -H <your smtp/imap server> --mailto <email address for test messages> 
    --mailfrom <your email address>
    --username <username for imap login>
    --password <password for imap login>
    --libexec $ZENHOME/libexec
  • Create a new data source in one of your performance configurations with something like the following settings:
    Source Type = Command
    Enabled = True
    Use SSH = False
    Component = <whatever, maybe check_email_delivery>
    Event Class = /Cmd/Fail (or something else if you'd like)
    Severity = anything but clear
    Cycle Time = how frequently you want this check to be performed
  • For Command Template use the same command you used from the command line with the following changes:
    1. No leading ./, just start the command with 'check_email_delivery...'
    2. Instead of hard-coding the device IP for -H you can specify ${dev/manageIp} to pull the ip from whichever device this command is being run on: check_email_delivery -H ${dev/manageIp} ...
  • Save the perf config.
  • Restart zencommand if you want to pick up these changes immediately. Otherwise just wait until the next zencommand config cycle (usually 30 min) for the command to start executing.

Troubleshooting:

  • If you want to confirm that things are working change the command template to use the wrong password for the imap login. You should start seeing errors when zencommand picks up that config change. (Assuming at least one device is being monitored with this perf config.)
  • Make sure zCommandPath is properly set to $ZENHOME/libexec
  • Double check permissions on check_email_delivery, check_smtp_send and check_imap_receive.
AddThis Social Bookmark Button
Document Actions