In my stack I'm using EC2 and NodeJS with PM2.
Time to time PM2 fails and the server goes down.
I'd like to create an email notification for these cases.
What I got so far:
- crontab job to ping the server every 10 minutes and write to a log file if it's down.
- CloudWatch monitoring that log file.
- Missing step.
- SNS Event and Subscription to send me an email.
My plan is to install the CloudWatch agent and configure the crontab in some others customer's servers. Group all them in the same CloudWatch/SNS flow.
I'm working on step 3: the connection between CloudWatch and SNS.
Using CloudWatch's wizard, it seems like I can only send statistics, like "the number of logs", and not the log itself.
The log created in step 1 has data about the server that is down, and I'd like to add it to the email message.
EDIT It's not a personal setup. And for some reason, my boss says the CloudWatch is a must to.