Thursday, November 19, 2015

Oracle Database on Amazon - monitoring and alerting

See my last post about creating an Oracle database on Amazon – you can have a free one up and running in about 30 minutes.

Once set up, it's also very easy to implement monitoring and alerting.

So, assuming you've signed into the AWS console and are looking at your Instance(s):


Click on the 'Show Monitoring' button and you will see something like this:

Pretty impressive.

Note there are several pages, click on the number at the top right or select 'Show All'.

Below the charts is a section called 'CloudWatch Alarms'. 

To create an alarm, just click on the 'Create Alarm' button.

If you haven't set up an alarm before, click on 'Create Topic':


Enter a topic name – I made a mistake and called this the name I wanted to call the alarm -  better name would be the instance name and Amazon. 

Enter your email address and specify the metric and threshold – it might be worth setting one what will alarm so you can test that it works (it does).



So here I've asked it to monitor the disk space and alert me if the free space is more than 7000MB  -which it is, so I should get an alert.

Click on 'Create Alarm'.

Check your email, you will have a confirmation link to check. Click on the link and the alarm will be enabled and a confirmation will pop up:



Within a short time, you should receive an email alert:



How cool is that?
If you go back to the AWS console web page and refresh it, all sorts of things are happening:


You can click on the links to drill-down for more information.

Now that you know it's working, click on the alarm name to edit it and change the >= to <= . 
This will alert you if your 10GB of free space drops below 7GB – or set it to what you want. Save the changes.



On page 2 there are 2 charts called 'CPU Credit Usage' and 'CPU Credit Balance'. 
To make sure you don't get your credit card charged, you can set up billing alerts. 

Although it's after the event, if you set the threshold low it should give you time to log on and shut it down or delete it before it goes mad (it would be nice if you could set a limit, if there is I haven't found it yet).

Click on the 'View All CloudWatch Alarms' link, it will open a new page.

To the left of the page, click on 'Billing'


If your instance is not set to US East as the region, you will see this:


Click on the 'US East' link.

The page will refresh, click on the 'Create a billing alarm' link under 'Alarm Summary':


A window will open. Set the threshold (I set 0), create a new list and enter a name and email address, then click on 'Create Alarm'


You will be sent a confirmation to the email address, click on the link to confirm.

If you have accrued any charges you will be sent a mail immediately. I somehow ran up 40c worth of charges.

You can now close the window.

There is also an App for the phone (of course there is).

Go to Google Play or Apple App store depending on your phone and search for 'AWS console'.

Download and install it, select 'root account' and enter your username / password and sign in



Make sure the region is the one you created the database in (top right) and scroll down to 'RDS Instances' and you should see yours there.

 Select it and  select 'CloudWatch Metrics' to see the charts.




It also shows alarm status.




Next time I'll look at how to upload data to the database, which is what you will need to do if someone wants to migrate an existing database to the cloud.


No comments:

Post a Comment