In cloudwatch, I've set up an alarm when an instance check fails. I want generate a report all EC2 instances server uptime whenever a reboot, stopped and start happen. Do I need to create a log group in order to send a report to S3 to be downloaded? Do advise me if there are other way to download a report of ec2 server uptime?
How to generate monthly report for EC2 server uptime
109 Views Asked by Prasad At
1
There are 1 best solutions below
Related Questions in AMAZON-EC2
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Using Amazon managed Prometheus to get EC2 metrics data in Grafana
- Unable to ping remote websites from an ipV6 only ubuntu ec2 Instance
- Unable to install mysql on Amazon Linux 2023
- AWS Elastic Beanstalk - Deployment Issues with Flask backend (React frontend already deployed with S3 and Cloudfront)
- AWS ECS agent does not start in EC2 instance
- Moving a website from a subdomain to the domain root
- Switch to Cloudfront CDN causing issues for small number of users
- Selenium parser
- ReadTimeout error when downloading images on AWS EC2 but not locally
- Iam not able to login to bastion server-permission denied error
- No GPU EC2 instances associated with AWS Batch
- Django Deployment on AWS EC2 with Docker Compose: Seeking Advice on Security, Scalability, and Best Practices
- How to host a react and django application on ec2
- Connection services in different containers in the same ec2 instance
Related Questions in AWS-CLOUDWATCH-LOG-INSIGHTS
- Setting up alarms for Cloudwatch Insight Queries
- AWS Cloudwatch not consistently logging lambda invocations
- Cloudwatch Logs Insights search filter in mutliple messages
- Count number of pods without using kubectl if Amazon CloudWatch Container Insights with Enhanced Observability is installed
- AWS Cloudwatch - Custom metric filter metrics doesn't appear in metric namespace
- Troubleshooting Invalid Metric Filter Pattern Error in Terraform for AWS CloudWatch Log Metric Filter
- AWS CloudWatch Logs Insights | Filtering with failures?
- filtering the same starting value multiple times
- I did not received data points while calling AWS IVS- AWS Cloud watch ConcurrentViews (Java)
- AWS CloudWatch & Xray Intergration with my Application
- CloudWatch Insights query gives blank row in output
- AWS X-Ray Segments Sent from NestJS App Not Visible in X-Ray Console
- AWS Cloudwatch Log Insights filtering by timestamp in Terraform
- Cloudwatch log insights count_distinct() set default 0 value when no logs are present
- Use logInsights based on a field and then dedup data
Related Questions in AWS-CONFIG
- How to disable Configurations History Delivery for account in AWS Config
- Custom AWS Config rule with Guard policy for checking User access key
- Amazon ECS task definitions should have secure networking modes and user definitions
- How to track changes to AWS WAF Web ACL using AWS Config?
- refereshToken is empty aws-amplify javascript
- Aws config for Api security monitoring
- AWSServiceRoleForConfig Unauthorized
- AWS Config recorder stuck at "Taking inventory..." status
- AWS Config rule iam-policy-in-use remains non-compliant despite adding policies
- Using two or more regions from a single profile in one AWS Account
- How to generate monthly report for EC2 server uptime
- Using Terraform to setup multiple Tags for AWS Config using approved-amis-by-tag
- Security hub reporting 'AWS Config should be enabled'
- How do I check in AWS Config query whether particular key exists or not?
- How to use configuration file from ~/.aws/config instead of shared-credentials-file location?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I dont believe this functionality exists out of the box in AWS, but you can "roll your own" fairly easily.
As you already have an alarm and SNS topic you just need to subscribe/trigger a lambda function from the SNS topic to actually record that notification to an object on S3. Writing 1 file per event in response to each SNS message would be a good idea - especially if you have a bunch of machines that happen to change state at the same time. If your reading, updating and replacing a report object in S3 you could potentially end up loosing some events. To get around this...
Once you have seperate notifications being created by each status change in s3, you can write another lambda that reads the objects in S3 and compiles your report. You can either write this report back to S3, or use SES from your Lambda to send it via an email. You can use EventBridge to trigger a lambda function on a schedule
Also, A few additional thoughts:
/startstopevents/2024/02/24/randomly-generated-filename.json). This makes reporting super-easy - your 2nd lambda just needs to list all the objects with a prefix of/startstopevents/2024/02- all the details you need are in the individual objects)