Zabbix EC2 Monitoring With Mikoomi

First I want to give credit and “props” to to the original author, Jayesh Thakrar,
of the Zabbix Mikoomi plugins not just the EC2 plugin but also the mongodb plugin as well. The origional EC2 plugin for Zabbix offers many great features I simply needed to extend it to add support for VPN, VPCs and Availability Zone monitoring. For those who are interested the original version can be found here:

http://code.google.com/p/mikoomi/

I am not going to go into all the gory details about how to install and configure zabbix or install the Mikoomi plugin for AWS. The details can be found here:

http://code.google.com/p/mikoomi/wiki/04

I do want to focus on a few of the additions to the plugin that I have created and why I needed to add them.

VPC Support For Mikoomi EC2

When I initially tried to use the Mikoomi plugin I noticed that it was only reporting on the number of standard EC2 instances I created, but it wasn’t reporting the number of VPC instances which I had created. I was very confused by this and looked at the Amazon documentation over and over again unable to figure out why this was happening. Finally, I realized that the API version being called in the Mikoomi plugin was simply an older version, one that didn’t support reporting on VPC instances (or Elastic IPs for that matter). The current API version being used in the updated plugin is:

 2012-06-01

This is an important thing to take note of because as new features of AWS are created by Amazon and as this plugin is extended it will become more and more important to update the API version to be compatible with the changes.

VPC vs Standard Elastic IPs

Once I changed the version of the API I also noticed that now the total number of Elastic IPs where being reported properly not only my “standard” Elastic IPs but also IPs allocated for my VPC; however I wanted to add in more functionality so I added in support to differentiate between the standard and the VPC elastic IPs. This would be a good item to set triggers on because you are limited to the number of Elastic IPs you can have and this limit is different for the “standard” and “VPC” side of the house.

Describe VPCs

Next, I wanted to add basic support for monitoring my VPC. I added two simple items:

  • EC2 VPC Count – Total
  • VPC Count – Available

I also added a trigger for this which simply states:

"VPC Count - Available" < "VPC Count - Total"

Set a trigger. This way if your EC2 environment goes down you can get a clear idea what happened. Obviously if your VPC goes down you are in trouble.

VPN Overview

A good VPC is only as strong as the VPN connection back to your central office or datacenter. In my current environment my VPC instances need access to some production environments in my datacenter. I wasn’t exactly sure the best way to go about setting up the VPN monitoring so here is what I came up with.

  • EC2 Customer Gateway Available – Total
  • EC2 Customer Gateway Count – Total

There is also a trigger set on these two items which basically states:

"EC2 Customer Gateway Available - Total" < "EC2 Customer Gateway Count - Total"

This will set a trigger if one of the VPC gateways on your side is down but is configured in the AWS interface.

Next, I wanted to monitor the actual status of the VPC connection state. For instance there could be a chance that Amazon updates something on their end which breaks your current configuration, a network device on their end could go down, etc.. there are a variety of reasons why your VPN connection might actually go down so I wanted to make sure to monitor the status of the connection and created the following items:

  • EC2 VPN Connection Count – Total
  • EC2 VPC Connection State – Available

I also setup the following trigger for these two items:

"EC2 VPC Connection Count State - Available" > "EC2 VPN Connection Count - Total"

This way if the number of configured VPN connections is lower then the number of VPN connections in state “available” a trigger will be set.

EC2 Availability Zone Status

The last and final tweak I wanted to make was to check the status of availability zones. As you may or may not know there are 4 (someone correct me if I am wrong here) availability zones per region, however you are given access to 3 of the availability zones when you create an account and begin deploying instances to EC2. I added the following items for this:

  • EC2 Availability Zones – Available
  • EC2 Availability Zones – Total

I also setup a trigger which states the following:

"EC2 Availability Zone - Available" < "EC2 Availability Zone - Total"

Again, this way if an availability zone goes down you can quickly understand why 1/3 of your environment is down (please tell me you are deploying instances to multiple AZs).

Git Repo Mikoomi EC2
Now that you have read about all the changes to the Mikoomi EC2 plugin you probably want to know where you can actually check out a copy of these changes, well fear not, below is the git repo where these changes are available:

https://github.com/bcarpio/mikoomi-aws-ec2

I hope these changes and modifications help you in your EC2 journey. If you have comments or suggestions please feel free to comment here on my blog or on my git repo.

5 Comments

Add a Comment

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