Monitoring Ironport Mailgateway with Zabbix

Abstract

Monitoring a mail gateway is a good idea. You want to know what it is working all the day and you want to be the first one to know if it is not working any more. Mail is still one of the most sensitive applations in an enterprise. In this blog entry I want to describe how I monitor my Ironport Mailgateway appliances with Zabbix.

Monitoring Ironport Mailrelay with Zabbix

Monitoring all equipment you operate is always a good idea. Especially a mail gateway is still a senstivce application in every company. You want to know what it is doing all the day and you want to be the first one to know if it is not working any more.

In this blog entry I want to describe how I monitor my Ironport Mailgateway appliances with Zabbix.

The Basics

Since you cannot install a Zabbix Agent on the appliance Simple Network Management Protocol (SNMP) is one of the few options left. But looking at the MIB of the Ironport mail appliance you recognize that all good data to measure the perfomance of the machine is missing.

So SNMP offers you only to monitor the machine basics like temperature, number of mail transfer threads, oldest message in the queue, CPU, memory, and queue utilization, the power supply, fan and RAID status. As you can see in my template (download: here ) I included it already.

From these data I get nice triggers on CPU, memory and queue utilization and graphs of the oldest mails on my machines.

Performance Data

Since Ironport does not provide any performance data though the SNMP agent I found that the Ironport appliance offers a website the displays all the data in XML format:

http://myironport/xml/status

On the website of the contributed scripts in the support forums of Ironport I found a nice script to parse the XML output. I modified it a little bit to use it together with Zabbix. If parses several counters for a host passed from the callung script. The calling script also is responsible to wget the status.xml file. The central part of the script is here:

my @counterAttrs = ('inj_msgs', 'rejected_recips', 'dropped_msgs', 'delivered_recips', 'deleted_recips');
my $result = "";
my $attrib = "";

print "Parsing status file for host $host\n";

foreach (@counterAttrs) {
      $attrib = $_;
      print $attrib." ".$counter{$attrib};

      $result = `/usr/sbin/zabbix-sender -z 127.0.0.1 -s $host -k $attrib -o $counter{$attrib}`;
}

The script parses the important data from the status file and calls the Zabbix trapper to feed the data into the monitoring system. You can download the whole script from here . You can easily write a wrapper script that fetches the status data in XML format with wget for all your Ironport mail gateways and calls the parser script afterwards. A cronjob calls the wrapper script all 5 minutes. So you get nice graphs that display the performance data of your appliances.

Please note that I have different scales on the right and the left side. If I would plot all graphs with the same scale, the last three graphs would not be visible any more.

Michael Schwartzkopff, 01. February 2013