Last active
July 25, 2018 05:22
-
-
Save LewisMcMahon/3d4612201159a4a42d43 to your computer and use it in GitHub Desktop.
AWS Cloudwatch metric for postfix queue length
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 "Mail Queue" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(echo $(($(mailq | grep -Po "(?<=in )([0-9]+)"| paste -sd+ | bc)+0))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
requires cloud-utils and aws cli