Nagios email – Customize Nagios Notifications

Nagios - Customize your Nagios notifications

Add more info to your Nagios notifications

I finally got tired of getting Nagios notifications that didn’t have all the info I wanted in them. Specifically, I was guessing if the problem had been acknowledged based on the notification interval (how long since I received the last notification), or logging in to Nagios to check.
I decided to customize the Nagios email notifications by editing the # 'host-notify-by-email' command definition, which is the notification type that I’ve been using.

Before, the # 'host-notify-by-email' command definition looked like this:

command[host-notify-by-email]=/bin/echo -e "***** Nagios *****nnHost "$HOSTALIAS$" is $HOSTSTATE$!nn$HOSTADDRESS$nnDate/Time: $DATETIME$n" | /bin/mail -s 'Host $HOSTNAME$ is $HOSTSTATE$!' $CONTACTEMAIL$

which produced a notification that simply included the hostname, the state, and the date/time. I hopped on over to the Nagios Macros page at Sourceforge and grabbed what I wanted, then edited the # 'host-notify-by-email' command definition as follows:

# 'host-notify-by-email' command definition
define command{

     command_name host-notify-by-email
command_line /bin/echo -e "***** Nagios *****nnThis is a $NOTIFICATIONTYPE$ notice that "$HOSTALIAS$" is $HOSTSTATE$!nnHost IP is $HOSTADDRESS$nnDuration is $HOSTDURATION$nnDate/Time: $LONGDATETIME$nn SummarynTotal Unhandled Host Problems:$TOTALHOSTPROBLEMSUNHANDLED$nTotal Unhandled Service Problems:$TOTALSERVICEPROBLEMSUNHANDLED$" | /bin/mail -s 'Host $HOSTNAME$ is $HOSTSTATE$!' $CONTACTEMAIL$

Now my Nagios email notifications look like this:

***** Nagios *****

This is a PROBLEM notice that DevServer is DOWN!

Host IP is

Duration is 0d 0h 0m 0s

Date/Time: Tue Aug 3 13:19:25 PDT 2010

Nagios Summary
Total Unhandled Host Problems:1
Total Unhandled Service Problems:0

The “This is a PROBLEM notice” part is created by the $NOTIFICATIONTYPE$ macro. This is nice because it tells you what kind of notification it is (“PROBLEM”, “RECOVERY”, “ACKNOWLEDGEMENT”, “FLAPPINGSTART”, “FLAPPINGSTOP”, “FLAPPINGDISABLED”, “DOWNTIMESTART”, “DOWNTIMEEND”, or “DOWNTIMECANCELLED”), which is much more useful than just getting another DOWN notice when a problem is acknowledged.

Check out my other Nagios posts, and please leave a comment if you have another tip or trick on customizing your Nagios notifications.


Changing the IP address of a Scalix Server

Change your Scalix IP without breaking things

Scalix webmail - Change your Scalix IP address

Changing the IP of a Scalix server is really easy. Along with changing the obvious stuff (etc/hosts, /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth0…) just follow these directions from the Scalix Wiki:

Update the Postgres Client Authentication

Changing your IP address does not update Postgres and access to the Scalix API is then denied. To rectify this you need to modify the file /var/opt/scalix/NN/postgres/data/pg_hba.conf. Remember NN is the abreviation of your Scalix node, so it will change depending on the hostname of your scalix server.
Find the line that looks like:

host    scalix      scalix   md5

Edit the file to change this line to look like:

host    scalix      scalix   md5

Update the Search and Index Service

Changing your IP address does not update the Search and Index Service properties. To rectify this you need to modify the file /var/opt/scalix/NN/sis/ Again remember NN is the abreviation of your Scalix node!
Find the lines that look like:


Edit the file to change the lines to look like:


Update the Uber Manager Service

As above changing your IP address does not fix the Uber Manager. To fix this you need to modify the file /var/opt/scalix/NN/caa/scalix.res/config/ Again remember NN is the abreviation of your Scalix node!
Find the line that looks like:


Edit the file to change the line to look like:


Reboot and enjoy your server

After you have finished this procedure please reboot. Everything should be working just like before.
Do remember, however, that this post only covered Scalix. Other services or other parts of the server which depend on the IP Address instead of hostname will still need to be changed.


PGP Encryption – Enigmail in Thunderbird email

Enigmail is a security extension to Mozilla Thunderbird and Seamonkey. It enables you to write and receive email messages signed and/or encrypted with the OpenPGP standard.

PGP Encryption - Enigmail automatically decrypts and verifies your Email





To install and configure Enigmail:

1) Install GnuPG

2) Find the appropriate Enigmail package, download and install

3) Create your Keypair

4) Set up ‘Per-Recipient Rules’. This will allow you to automatically sign and/or encrypt mail to specific people (or based on other rules). Just go to ‘OpenPGP’>’Edit Per-Recipient Rules’

Thanks Chris!


Scalix install on Centos 5

For ALL of the details, check out the Scalix ver11.3-11.4 Installation Guide (pdf).

All hosts (running any Linux variation) require the following packages before installation:

• bash
• ncurses
• libstdc++
• coreutils
• grep
• diffutils
• gawk
• sed


• tk
• cyrus-sasl-md5 (32-bit libs)*
• cyrus-sasl-plain (32-bit libs)*
• sendmail (v8.12 and above)
• sendmail -cf
• Python v2.2 through 2.4
• openssl
• which

In addition to the packages listed above, all Red Hat, Fedora, and CentOS Linux hosts require the following:

• procps
• elinks
• krb5-libs

libstdc++ (32-bit libs)*
• libxml2 (32-bit libs)*
• ncurses (32-bit libs)*

• httpd

*Use the 32-bit libs on both 32-bit and 64-bit platforms

PostgreSQL 7.4.x, 8.0.x, or 8.1.x, including the following packages:
• postgresql-server
• postgresql-libs
• postgresql
• pgdg
• mx

Almost all of these packages are part of a Centos 5 install. In order to determine if you have the right software installed, you can view it. To list all of the .rpm packages that are installed on the system, run this command:
rpm -qa

You can also determine the version number for a specific package (for example, diffutils) with the -q extension:
rpm -q diffutils

And of course, if you ain’t got ’em, yum ’em.

Set up a fully qualified domain and hostname, static ip, dns, etc.

Make sure these ports aren’t in use:
25/TCP for SMTP
80/TCP for Apache HTTP
110/TCP for POP
143/TCP for IMAP
389/TCP for LDAP
5729/TCP for Scalix UAL (open when Scalix is running)
5757/UDP for Scalix UDP
443/TCP for HTTPS
465/TCP for SMTPS
993/TCP for IMAPS
995/TCP for POP3S
5767/TCP for Scalix UAL-S

Disable SELinux

Check out LVM

Install: Download the Scalix .bin file, and place it in a convenient directory on the host, for example the root home folder. In a terminal window, if the file is not in the root home folder, use the cd command to change to the appropriate folder. Launch the installation programs by entering bash and the .bin file name, for example:
bash scalix-11.3.0-GA-enterprise-redhat-intel.bin

Test SWA (Scalix Web Access). Make sure the Tomcat service is started, by entering:
ps -ef | grep tomcat

or restart it with
/etc/init.d/scalix-tomcat restart

and then browse to Webmail: