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

SysAdmin

sysadmin

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

Too many open files

Submitted by DenRaf on Thu, 02/26/2009 - 19:02
  • [View]

Has anyone a clue on this one ?

sudo cat /proc/sys/fs/file-max
1048576

sudo cat /etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576

sudo cat /etc/sysctl.conf
fs.file-max=1048576

ulimit -n
1048576

But yet when my service starts at boot:

sudo cat /proc/pid/limits | grep files
Max open files 1024 1024 files

Whenever I restart my service everything is ok:
sudo cat /proc/pid/limits | grep files
Max open files 1048576 1048576 files

This is running on a Debian Etch with kernel 2.6.28

  • DenRaf's blog
  • 4 comments
Tags:
  • SysAdmin
  • Debian

Muliple domains support in Openfire

Submitted by DenRaf on Fri, 10/12/2007 - 06:38
  • [View]

On the openfire-forum and on a lot of others is this the subject of many threads, however it almost works out of the box.

I'm running 3 domains which all like jabber support. Lazy as I am, I just want to maintain one jabber-server instance. All 3 domains are being authenticated on the same LDAP-server.

Openfire version: 3.3.3

LDAP Settings
Host: ldap.mydomain.com
Port: 389
Base DN: dc=com
Administrator DN: uid=admin,ou=people,dc=mydomain,dc=com

Result is that all users of all domains are able to login and chat with each other. Users of the not default domain are also able to use the groupchats. But not everything is ok, there are also some issues:

Users of the not default domain:

  • aren't listed
  • show up as member of the default domain
  • Not only show up as those, but for access lists you have to use the default domain. So this could give a user conflict
  • DenRaf's blog
  • 1 comment
Tags:
  • SysAdmin
  • LDAP Auth
  • multiple domains
  • openfire
  • Zimbra LDAP

OTRS and remote MySQL database

Submitted by DenRaf on Mon, 10/08/2007 - 07:23
  • [View]

At our new company we have a dedicated MySQL database machine and we use OTRS for ticketing.

The thing is when you use the packages provided by otrs, you end up installing mysql-server on the otrs-machine. And that's just what I didn't want to do. So instead of just complaining I edited the spec files, the rcotrs-config files and rebuilded the rpm.

Now you don't need to install mysql-server anymore and the otrs init file isn't checking anymore for a running database. However the otrs init still tests the connection to the database. Just what we want.

You can download the src rpm here and the normal rpm here. In the src rpm you also find the spec files for the other supported plaforms (redhat 7.x, redhat 8.0, suse from off 7.3)

  • DenRaf's blog
  • 2 comments
Tags:
  • Linux
  • SysAdmin
  • mysql
  • otrs
  • rpm

Auto svn-recover on old svn systems

Submitted by DenRaf on Fri, 08/24/2007 - 22:39
  • [View]

These days if you are using the latest svn with berkely db, this is not one of your problems. Auto-recovery is build-in.

But for people like me that stick by their old svn for various reasons it is a waist of time for recovering every corrupted repository. For making it yourself easy, you make a script for that, that you hit when you noted that a repository was corrupted. But still, not easy enough. So you make a script that checks every repository configured and if one is corrupted, fixing it at the same time. Good, now we are getting there, but still. Sometimes the check will hang endlessly and so will your script. So what then?

Expect. Use expect to check your repository and add a timeout. So when the check will hang, kill it after the timeout is reached.
Expect expects various outputs of the command it executes, and for each expect rule you can do something. For instance giving it an exit-code.

I noted something quiet important, expect 5.42 only compares to the last line of a multi-line response of the command it executes.

You can find my script here.

Almost everything is configurable, even mail notification.

You can add this script to your cron tasks, so you just have to do nothing IF one fails.

  • DenRaf's blog
  • Add new comment
Tags:
  • SysAdmin
  • old
  • recover
  • svn

Apache redirect response header

Submitted by DenRaf on Fri, 08/24/2007 - 22:08
  • [View]

All admins of advanced Apache setups will cross this problem someday. So did I :)

You have some nice reverse proxy setup, everything working just fine, except that one redirect that happens on one of the backend machines to a non default port.
You have no choice then redirect that to a default port. I searched long after this, and with me a collegue

Lets say when you surf to http://myhost.mydomain.com, you are proxied to backend server with ip 193.155.88.23. End for example that backend server redirects you to a non-default port like 8443. And you end up with your browser going to 193.155.88.23:8443 directly. If these ports aren't blocked already, you'll probably go to somewhere completely different.
Normal redirects are catched by your proxy and you'll not see a thing, but not these.

Everybody knows the mod_rewrite module, but that only handles request headers. For this you need to change to response headers. You could do this with some fancy stuff with something self written for using mod_perl or so, but the solution is by far more simplier.

mod_headers is the answer to this problem:

In your VirtualHost config for that machine on your proxy:

Header edit Location ^https://193.155.88.23:8443 https://myhost.mydomain.com

This will have as a result that the location header send by your backend server will be changed to https://myhost.mydomain.com if it starts with https://193.155.88.23:8443. Your browser directly go to https://myhost.mydomain.com and problem is solved.

  • DenRaf's blog
  • 1 comment
Tags:
  • SysAdmin
  • apache
  • edit
  • mod_headers
  • response header
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 4 days ago
  • I prefer this updated
    51 weeks 2 days ago
  • Agreed.
    1 year 15 weeks ago
  • Working on this
    1 year 16 weeks ago
  • Thanx for tutorial. IT'S
    1 year 18 weeks ago
  • Amon Ra recovery tool
    1 year 21 weeks ago
  • Please help me
    1 year 26 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 31 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.