Activities

January 2015
M T W T F S S
« Dec   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031  

How do I monitor uptime of my bulk smtp server externally

Here is my challenge, I have configured a highly reputed email server using Postfix MTA for sending bulk emails. So it’s a crucial for us to monitor the uptime of this service. So I decided to use nagios system to verify the SMTP authentication in 3 mts interval along with 2 failure checks and can send email notification. Also I do not need to mess up other nagios configuration for this setup.

What you need to do is,

1. create a file (email_monitoring.cfg) having following entries ( after modify it with your values) under “/etc/nagios/objects” folder

2. Add this file (email_monitoring.cfg) entry in nagios main configuration file (/etc/nagios/nagios.cfg) to activate it.

3. For syntactical test, you may use nagios -v /etc/nagios/nagios.cfg command

The following are the independent nagios configuration for monitoring remote SMTP server,

define host{
        use             mail-server
        host_name       RC_emailhost
        alias           RC_mail01
        address         54.21.17.11
        }

define service{
use                             local-service
host_name                       RC_emailhost
service_description             OR_SMTP_Uptime
check_command                   check_or_smtp
notifications_enabled           1
}

########## Service  command declaration ####
define command{
        command_name    check_or_smtp
        command_line      /usr/local/nagios/libexec/check_smtp  -p 25 -A LOGIN -U info@serveridol.com  -P password  -H outbound.serveridol.com
        }
########## Host check declaration  ###########
define command {
command_name check-host-alive-by-smtp
command_line $USER1$/check_smtp -H $HOSTADDRESS
}
######### Email alert list and group creation #########
define contact{
contact_name                    lijum
use                             generic-contact
alias                           Email
email                           liju@serveridol.com
}

define contactgroup{
        contactgroup_name       mail-admins
        alias                   Mail Administrators
        members                 lijum
        }

####### Email Host template definition ##########
define host{
        name                            mail-server
        use                             generic-host
        check_period                    24x7
        check_interval                  1
        retry_interval                  1
        max_check_attempts              2
        check_command                   check-host-alive-by-smtp
        notification_period             24x7
        notification_interval           30
        notification_options            d,u,r
        contact_groups                  mail-admins
        register                        0
        }

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>