So the next question on our minds is; we have our Opsview system using Amazon RDS as a back-end for storage, allowing us to scale out as our data set grows – giving us a more efficient setup – however we still need to monitor RDS to ensure that it is functioning correctly.

Monitoring via the application

There are 2 ways of doing this – firstly, we need to monitor the MySQL database, as we would normally. To do this it is very simple (as the access control is already done using the “access.sql” we piped in the previous guide). However, assuming that this is a new RDS instance we want to monitor, you will have to do the following steps:

1. mysql -u username -ppassword -h rdshostname.amazon-ec2.com -P 3306

2. GRANT SELECT ON *.* TO ‘opsviewro’@’opsviewipaddress’ IDENTIFIED BY ‘PASSWORD’;

3. Set-up the RDS “security group” to allow the Opsview EC2 instance’s IP address, access to the RDS database on port 3306.

Now that our Opsview server can connect to our RDS DB on port 3306 (i.e. MySQL and all derivatives henceforth), we can begin to monitor using the built-in “Database – MySQL Server” template in the software.

Simply navigate to “Settings > Hosts > Add”, and enter the address of the RDS DB (you can get this via the RDS console page) and then choose “Database – MySQL Server” from the “Host Templates” section at the bottom like so:

[Snipped the image for brevity]

Next we need to navigate to “Monitors” and under the “Database – MySQL” service group, click on “MySQL DB Processes” so that it has a minus next to it (to remove it from our host). This is because this particular check uses check_nrpe to ensure a “mysql” process is running on the box – and as we dont have access to the underlying box to install an NRPE agent, we can remove this:

Finally, click on the “Attributes” tab and we can add our permissions to allow us to access the RDS DB (outlined at the start of this blog):

We can click “Submit changes” now, and then reload our Opsview via “Settings > Apply Changes” and we can then view our newly monitored Amazon RDS database as below:


Monitoring via Amazon RDS

Now we are monitoring the application from within the application, we can next look at monitoring RDS via AWS CloudWatch (API) and get the underlying system information.

This will be “out of the box” in Opsview 4.4 (end of July) so i wont go into too much nitty gritty here, but we will be using the nagios plugin check_cloudwatch_status and a few ruby gems it requires.

Once we have added the ruby gems required, we can begin monitoring via CloudWatch. For ease of view, i will clone the above host and remove MySQL checks and add just the RDS checks, so we have clear seperation – and we can then add the RDS template to the original host later.

So, lets add the template via the GUI:

[Again, edited for brevity]. Now we’ve got our host template added, we need to add our attributes again and specify the variables for this RDS instance:

Here we have to specify our address (…amazonaws.com) and then our instance (opsviewdbseperate). In EC2, this would be our “i-232XXX” number. Next, click submit changes, reload Opsview again – and voila, we are monitoring RDS via AWS Cloudwatch:

Closing thoughts

In Opsview 4.4 [End of July ’13] we will be able to literally add an RDS database, monitor its performance via MySQL commands, and also monitor its performance via AWS (underneath) – all via the one Opsview dashboard – with very minimal configuration. Pretty neat!