Checking The Status Of Your ELB With Zabbix

In my current environment (not for this blog lol) I leverage multiple ELBs to provide multi availability zone HA. We also use Zabbix to monitor our EC2 environment (in a previous post I extended the Mikoomi EC2 Zabbix plugin) so I figured I would create a way to have Zabbix alert on outages with backend nodes configured in our ELBs.


Here are the items which are configured in our AWS ELB Template:

  • AWS Total Elastic Load Balancers
  • AWS Number Of Elastic Load Balancers With Out Of Service Pool Members
  • AWS Elastic Load Balancers With Out Of Service Pool Members
  • AWS Instance IDs of Out Out Service Pool Members

The following is a list of “Triggers” which come configured with the template:

  • An Elastic Load Balancer Has A Pool Member Out Of Service In {HOSTNAME}

Here is the Zabbix template which needs to be imported into your Zabbix Web Interface:

To make the Zabbix template work you need to put the file on your zabbix server in the “ExternalScripts” location which is defined in your zabbix_server.conf file. On my system this is /usr/local/etc/zabbix/bin (but I modify my config specifically to this value).

This script requires the following options:

  • -k – AWS Access Keys
  • -s – AWS Secret Access Key
  • -r – Region (us-west-1 or us-east-1, etc..)
  • -n – Name – This is the NAME of the node as defined in your Zabbix web interface. For instance I define a node as US-EAST-1 and then assign the AWS ELB Template to that node

Here is the script:

For some reason I have a problem passing switches to script in the Zabbix web interface, so I simply wrote a wrapper around the script that sends the output of the script to a file, and then calls zabbix_sender to actually to a bulk send of the output of to the Zabbix server. This also needs to go into your “ExternalScripts” directory as defined in your zabbix_server.conf file:

Configure A Node In Zabbix
Finally you will want to configure a node in Zabbix which uses this script:

  • Configuration >> Hosts >> Create Host
  • Name: (Personally I Name This After My Region)

Next, you are going to want to define the following macros:


Finally, you will simply attach the Template_Amazon_ELB_AWS to the US-EAST-1 host.

Hopefully this helps you with the monitoring of your AWS ELBs.


Tags:, , ,

Add a Comment

Your email address will not be published. Required fields are marked *