Created
July 10, 2015 13:10
-
-
Save LewisMcMahon/88c0cc9ca1d04fb9d531 to your computer and use it in GitHub Desktop.
AWS Cloudwatch metric for Ubuntu security updates available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudwatch put-metric-data --metric-name "Security Updates Available" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(/usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
requires cloud-utils and aws cli
for all updates not just security ones change "cut -d ';' -f 2" to "cut -d ';' -f 1"