DenRaf's Blog

  • Contact

Contact
View Raf Nijskens's profile on LinkedIn
OpenSource
Linux
Powered by Drupal, an open source content management system
Get Firefox
Fosdem
Visit Inuits Technical home

Locations of visitors to this page

Tags in TagCloud

6 acer ADP1 Android apache automaticmenu caching cats Centos closed source cron Debian dell Dell R200 deploy Dream driver drupal drupalcron eclair edit faceted_search fedora flat jscalendar Fosdem funambol G1 imagefield_gallery litejazz menu_tree module multiple domains mysql node_page O2Micro old openfire OSD otrs password trigger password_trigger plutado Ports presentation recover response header rpm svn sync syncml tagadelic ubuntu user filter user_import wordpress wordpress 2.3 wp2drupal xmlsitemap zabbix zimbra
more tags
Home

zabbix

Zimbra monitoring with zabbix

Submitted by DenRaf on Fri, 12/04/2009 - 17:37
  • [View]

At our company we run zimbra as our collaboration tool and we use zabbix as our monitoring solution. Almost every service we have is monitored nicely, but unfortunately our zimbra was not. Because zimbra exists out of several services you want to know the status of every service. For that I wrote a little script.

First of all the zabbix agent configuration:


UserParameter=zimbra.clamav,/etc/zabbix/check_zimbra.sh antivirus
UserParameter=zimbra.spam,/etc/zabbix/check_zimbra.sh antispam
UserParameter=zimbra.logger,/etc/zabbix/check_zimbra.sh logger
UserParameter=zimbra.mailbox,/etc/zabbix/check_zimbra.sh mailbox
UserParameter=zimbra.mta,/etc/zabbix/check_zimbra.sh mta
UserParameter=zimbra.snmp,/etc/zabbix/check_zimbra.sh snmp
UserParameter=zimbra.spell,/etc/zabbix/check_zimbra.sh spell
UserParameter=zimbra.stats,/etc/zabbix/check_zimbra.sh stats

This use the custom check_zimbra:

#!/bin/bash

check=$1
maxage=30
file='/tmp/zimbra_status'

#check if file exists
if [[ -e $file ]]
then
OLD=`stat -c %Z $file`
NOW=`date +%s`

export PATH=$PATH:/opt/zimbra/bin
# if older then maxage, update file
if [[ `expr $NOW - $OLD` -gt $maxage ]]
then
sudo -u zimbra zmcontrol status > $file
fi

else

export PATH=$PATH:/opt/zimbra/bin
sudo -u zimbra zmcontrol status > $file
fi

AVSTATUS=`cat $file |grep $check|awk '{ print $2 }'`

if [[ $AVSTATUS != "Running" ]]; then
echo 0
fi

echo 1

As you can see we store the output of the slow zmcontrol in a file for a configurable amount of time. This way you can cache that output and win some time.
For this to run you need to add the next rule to the /etc/sudoers file:


zabbix ALL=(zimbra) NOPASSWD:/opt/zimbra/bin/zmcontrol

  • DenRaf's blog
  • 4 comments
Tags:
  • SysAdmin
  • zabbix
  • zimbra
Syndicate content

Guided search

Click a term to initiate a search.

Categories

  • drupal (26)
  • Linux (6)
  • SysAdmin (6)
  • Uncategorized (5)
  • Linux-tools (3)

Date authored

  • 2010 (5)
  • 2009 (10)
  • 2008 (27)
  • 2007 (11)

TagCloud

  • drupal (26)
  • Ports (7)
  • cron (6)
  • drupalcron (6)
  • 6 (3)
  • OSD (3)
  • zimbra (3)
  • cats (2)
  • Fosdem (2)
  • funambol (2)
  • more...

Recent blog posts

  • OSD2010: Day 2
  • OSD2010: Day 1
  • OSD2010: Pre notes
  • Howto: Android 2.1 on G1/ADP1/Dream
  • Updated look
  • Zimbra monitoring with zabbix
  • New module: Node Page Template
  • AutomaticMenu module for drupal 6
  • Drupal synchronisation
  • Imagefield_gallery module for drupal 6
more

Recent comments

  • Thanks for the nice blog. It
    50 weeks 6 hours ago
  • I prefer this updated
    50 weeks 4 days ago
  • Agreed.
    1 year 14 weeks ago
  • Working on this
    1 year 16 weeks ago
  • Thanx for tutorial. IT'S
    1 year 17 weeks ago
  • Amon Ra recovery tool
    1 year 20 weeks ago
  • Please help me
    1 year 25 weeks ago
  • This is so dumb
    1 year 26 weeks ago
  • I've installed it on my
    1 year 29 weeks ago
  • I am also having the same
    1 year 30 weeks ago

Syndicate

Syndicate content
I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.