Check the queue size of specified SQS queue.
check-aws-sqs-queue-size --access-key-id=<aws-access-key-id> --secret-access-key=<aws-secret-access-key> --region=<aws-region> --queue=<the-name-of-the-aws-sqs-queue>
First, build this program.
go get github.com/mackerelio/go-check-plugins
cd $(go env GOPATH)/src/github.com/mackerelio/go-check-plugins/check-aws-sqs-queue-size
go install
Or you can use this program by installing the official Mackerel package. See Using the official check plugin pack for check monitoring - Mackerel Docs.
Next, you can execute this program :-)
check-aws-sqs-queue-size --access-key-id=<aws-access-key-id> --secret-access-key=<aws-secret-access-key> --region=<aws-region> --queue=<the-name-of-the-aws-sqs-queue>
If there are no problems in the execution result, add a setting in mackerel-agent.conf .
[plugin.checks.aws-sqs-queue-size-sample]
command = ["check-aws-sqs-queue-size", "--access-key-id", "<aws-access-key-id>", "--secret-access-key", "<aws-secret-access-key>", "--region", "<aws-region>", "--queue", "<the-name-of-the-aws-sqs-queue>"]
-r, --region= AWS Region
-i, --access-key-id= AWS Access Key ID
-s, --secret-access-key= AWS Secret Access Key
-q, --queue= The name of the queue name
-w, --warning= warning if the number of queues is over (default: 10)
-c, --critical= critical if the number of queues is over (default: 100)
The plugin uses the instance profile if possible, or you can configure AWS_PROFILE
or AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables in the env
settings.
Please execute check-aws-sqs-queue-size -h
and you can get command line options.