Showing posts with label zimbra. Show all posts
Showing posts with label zimbra. Show all posts

Wednesday, 13 July 2011

Nagios - Zimbra Mail Server Checks


#Define Host
define host{
        use                     linux-server
        host_name               Zmail01
        alias                   Zmail01.a24group.com
        address                 10.0.0.18
        }

#Define Host
define host{
        use                     linux-server
        host_name               a24mailer
        alias                   a24mailer.com
        address                 10.0.0.251
        }

define host{
        use                     linux-server
        host_name               Zmail03
        alias                   Zmail03.arabellahealth.co.uk
        address                 10.0.0.91
        }


define host{
        use                     linux-server
        host_name               Zimsa
        alias                   Zimsa.a24.co.za
        address                 10.0.0.252
        }


define host{
        use                     linux-server
        host_name               Zimsutton
        alias                   Zmailsutton
        address                 178.78.120.35
        }

#monitor ping
define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,Zimsutton,a24mailer
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }



#Root Partition monitoring
define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,Zimsutton,a24mailer
        service_description             Root Partition
        check_command                   check_local_disk!20%!10%!/
        }

#Current Users
define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,Zimsutton,a24mailer
        service_description             Current Users
        check_command                   check_local_users!20!50
        }

#Monitor processes
define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,Zimsutton,a24mailer
        service_description             Total Processes
        check_command                   check_local_procs!250!400!RSZDT
        }

#Monitor HTTP
define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,a24mailer
        service_description             HTTP
        check_command                   check_http
        notifications_enabled           0
        }


define service{
        use                             local-service         ; Name of service template to use
        host_name                       Zmail01,Zmail03,Zimsa,Zimsutton,a24mailer
        service_description             IMAP
        check_command                   check_imap
        notifications_enabled           0
        }


Friday, 1 July 2011

Nagios - Zimbra mail queue checks

Monitoring Zimbra Mail queue's with Nagios 

edit 
vi /usr/local/nagios/libexec/utils.pm

remove
$PATH_TO_MAILQ   = "/usr/bin/mailq";

Add
$PATH_TO_MAILQ  ="/opt/zimbra/postfix/sbin/mailq";

Test
/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_mailq 10.0.0.251 -w 100 -c 150

Error
root@Nagi:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_mailq 10.0.0.251 -w 100 -c 150
ERROR: /opt/zimbra/postfix/sbin/mailq is not executable by (uid 0:gid(0 0))


Fix Error

edit 
vi /etc/sudoers

nagios ALL=(zimbra) NOPASSWD: /usr/local/nagios/libexec/check_clamav.pl

nagios ALL=(zimbra) NOPASSWD: /usr/local/nagios/libexec/check_mailq