INTRODUCTION AND THE IDEA :
This blog post is in continuation of my last blog post Capturing & Analyzing online users Trend on Reddit with Powershell . According to the advice from one of the best IT pros I know – Trevor Sullivan (Twitter handle @PCGeek) who suggested me to pump all the data points script captures from Reddit’s Powershell Community page to AWS Cloud Watch, I decided to give it a shot.
Just to give you an idea AWS CloudWatch is Amazon Monitoring service and it can do much more than just plotting graphs using the data points you send to the cloud. You can use Amazon CloudWatch to collect and track metrics, collect and monitor log files, set alarms, and automatically react to changes in your resources.
HOW IT WORKS:
In my previous blog post we’ve already covered capturing “Number of users online” on Reddit Powershell Group, now we just need to find a way to pump the data points captured by the Powershell script to AWS Cloud watch, luckily that was pretty easy! Here is a documentation to publish data points to AWS CloudWatch using PowerShell
I made small additions (Highlighted) to my previous Powershell code and we are good to go!
Once I ran the script it started capturing data and sending it to AWS Cloud
But, wait! How would I see my data on AWS?
THE AWS THING:
To view your data points on AWS CloudWatch follow the below steps
- Obviously, you need an AWS subscription, If you have one Sign Into AWS console.If not create one! Please 😀
- On the home page, Under the ‘Services‘ section in Top-Left Corner select CloudWatch in ‘Managment Tools’ category.
- Once the Cloud Watch page opens, click on “Browse Metrics” Button.
- A new page will open, now click on “Usage Metrics” under custom namespaces and you’ll find the Metric for data points you’ve pushed to AWS using PowerShell script.
- Moment you check the checkbox next to ‘online users‘, You’ll see a graph populating with data, like in the following animation
- Now to set an ALARM with a Threshold (Online users greater or equal to 80) in order to get notified using Amazon SNS , follow the steps in the animation below.
Once you’re all set and if the ALARM goes off, you’ll start receiving notification into your inbox like one in the screenshot below –
Long story short, pumping the data points to AWS CloudWatch is a better alternative than storing them into a CSV file (Like in the previous blog post) keeping in mind the Beautiful graph, Setting up the Alarms and Push notifications, AWS CloudWatch has no match!
If you like the script and the Idea, give me or Trevor (@PCGeek) shout on twitter! Until then have fun! 🙂