Watch a demo of AWS CloudWatch.
- [Instructor] Okay, we're in Amazon EC2 and we're going to basically show you CloudWatch, but we have a couple things we're going to show you. And the first is the services menu. As you can see, there are dozens and dozens of services Amazon provides. It's a bit intimidating at first, but if you kind of understand that they're grouped in certain categories, compute, storage, database systems, you can launch all these things on demand. migration, developer tools, management tools, which we're going to focus on. And with CloudWatch, security, identity, compliance analytics, artificial intelligence, and all kinds of new things are added all the time.
And every time you go out to this dashboard, it's going to look differently. You can actually group them. Or you can see them by alphabetical order. What we're going to do here is we're going to launch an instance of something, and then we're going to monitor, or basically setup monitoring, so let's go ahead and do that. So, I'm going to go ahead and click EC2 and I'm going to say launch an instance. And I'm going to launch an Amazon Linux instance. And I will, let's see, free tier eligible, better go with that, and so go ahead and review and launch.
So what I'm doing here, EBS only, TCP protocol instance details, all that stuff looks fine. I'm going to go ahead and launch the instance. And choose a key pair. I'm going to proceed without it because we don't need security on this thing. We're not going to do anything with it. And go ahead and launch it, and away it goes. And your instance is now launching. And we'll get, made view instance there. It doesn't take that long on Amazon to get an instance launched, and there it is. So you can see, it's launched United States West Coast data center.
Instance status is pending. Status check is initializing. In a few seconds we're going to have it ours and we'll be able to use it any way we want. We can load things on it. We can load apps, we can load data. We can basically use it as it if it was down all in the data center, which is kind of the power of Cloud computing. So, what I'm going to do from here is, looks like, it's initializing, the instance is running. So it's about up. So this is going to take a few minutes to initialize. So for the purposes of our demonstration, we're going to go ahead and fast forward.
Okay, the wait is over. Our server's been initialized and as you can see, it's running. Again, it's on the West Coast. Status is running and status checks are good so we get the green light. Alarm statuses are none. So let's go in and create an alarm. So I'll go into CloudWatch Monitoring and I will add edit an alarm. Alarms are important because the really allow us to, in essence, monitor the systems and if things were out of whack, so CPU is too high or disk space utilization is too high or we're running out of memory on a storage system, we want to do something and it's certainly going to let us know there's a problem.
But we can also take corrective action as well. So let's go ahead and create the alarm. So up here there's no SNS topics found, I'll go ahead and create one with the recipient being, let's see, I'll say that'd be me, because I would like to know if my server's down. We'll call this Demo. And the cool thing here is that I can take an action, so I can reboot this instance, I can recover it, I can stop it. You know what, I'll go ahead and say stop. If there's some issue there, I want to stop the issues.
And I can setup my identity access management role, which is another powerful thing to do. So in other words, I can create some sort of EC2 action access so I can basically identify what's going on. And by the way, there's other things I can do here. Disk Reads, Disk Writes, Network In, Network Out, Status Check Failed, all these sorts of things I can monitor, and by the way, you can create custom points of monitoring as well, so Amazon allows you to build these things into the system that you're able to monitor, for example for application level monitoring, things like that.
So when CPU Utilization average is greater than equal to, let's say five, for at least one consecutive period of one minute, I'm going to stop the instance. I guess I'll get a email as well, which is good since the instance has stopped. Need to create the role here. So I'm going to go ahead and create the alarm. And there it is. Click the alarm to view additional details with options, Amazon CloudWatch opens a new window. And note, you created a new SNS topic or added to the email address.
Each new address will receive a subscription email to be confirmed within three days. And so I actually have to go to my other computer, which is off-camera, by the way. Go ahead and say yes to verify that I'm okay with receiving emails from Amazon on this. And this is ready to go. So this is my alert and rule and basically ready to monitor the system. And not only just monitor the system and let me know if something gets out of whack, but take corrective action and be able to either restart or stop the server, and you typically want to reboot something if some issue comes up where it's going to make your application unstable.
You know, it's the middle of the night and you can't get up and fix it, then having these automated alarms, which actually take corrective action, which is called self-healing is absolutely very cool. So anyway, let's go ahead and click on this. And there's an alarm. And so it's pending confirmation, having a config status out there. And by the way, it provides us with some details here. Just let me move this up. History, State update, alarm updated, insufficient data, okay, this is from previously, and just did a configuration update, we created this alarm.
Details are here. We can look at server utilization again above five is going to kick off our alarm, which is going to stop the thing. And we can read everything here. Created from EC2 Console. CPU Utilization greater than five for one minute period of time. And we're going to go ahead and do an instance stop if that occurs, and so, and the email's pending confirmation. So I won't get an email until I confirm that. Statistics are average, period of one minute. And so we may set up a hundred different alarms. So we may have our web servers that are monitored and if something occurs, we can go ahead and launch it, stop the system, and basically do any kind of corrective action.
At the very minimum, we're going to get an email and get a text message that we got to go kick something and logging in Amazon and restarting the servers, we can certainly do that manually, remotely. But it's better, you know, letting Amazon take over and let them go ahead and reboot or stop or start or whatever needs to be done to the particular server to get your application up and running. So a couple other things here, we have logs and you can create a log group. We're going to talk about logging in the course.
It's important that we understand what happened. Log group demo, never expires, and we can setup different filters in here. And setup subscriptions. So we can add metrics and filters. Set up custom data logs, filter patterns, in other words, things that we're looking for in the logs such as errors and IP address reboots and things like that. Further down the way we have metrics.
And we can look at the EBS metrics, the EC2 metrics, and kind of go ahead and set this up. So since we lost EC2 instance, we can say, per-instance metrics, and we'll do across all instances. We can turn on CPU Utilization, Disk Writes, Disk Reads, Networking In, Networking Out. And all these things, since I just created this instance, this is just popping up. So these are things I can graph and monitor over time. And so if you're in to looking at these kind of graphs, obviously it doesn't have a lot of data now, but we can select any metric name here and there's other things as well you're able to do.
And graph those dynamically. And again, you can set up custom metrics as well and kind of get very creative with how you're going to monitor and manage this system. So anyway, that's it for CloudWatch. It's a very competent tool, and if you're going to be running your servers on Amazon Web Services, then this is something you should take a look at, because it's absolutely there, built around the Amazon way of doing things. I wouldn't recommend using this if you're going to, you know, leverage Google Cloud Services or Microsoft.
But if you're leveraging Amazon, this is perhaps the way to go.
- Cloud health, performance, security, and governance monitoring
- Cloud monitoring analytics
- Cloud monitoring costs
- AWS CloudWatch
- Librato CloudWatch
- Cloud Cruiser
- Microsoft cloud monitoring
- Rackspace cloud monitoring
- Creating a cloud monitoring and operations plan
- Defining cloud monitoring operations patterns