Skip to content

Instantly share code, notes, and snippets.

@LewisMcMahon
Last active August 29, 2015 14:24
Show Gist options
  • Save LewisMcMahon/9ece67274e1f941ffc6f to your computer and use it in GitHub Desktop.
Save LewisMcMahon/9ece67274e1f941ffc6f to your computer and use it in GitHub Desktop.
AWS Cloudwatch metric for sendmail queue length
aws cloudwatch put-metric-data --metric-name "sendmail queue" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(mailq | grep -Po "(?<=Total requests\: )([0-9]+)"| paste -sd+ | bc)
@LewisMcMahon
Copy link
Author

requires cloud-utils and aws cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment