Skip to main content

Amazon SQS

Pack Assets​

Templates​

The Centreon Monitoring Connector Amazon SQS brings a host template:

  • Cloud-Aws-Sqs-custom

It brings the following service templates:

Service AliasService TemplateService DescriptionDefault
Sqs-QueuesCloud-Aws-Sqs-Queues-ApiCheck Amazon SQS queuesX

Discovery rules​

The pack provides a discovery rule to automatically discover SQS resources:

image

More information about the Host Discovery module is available in the Centreon documentation: Host Discovery

Collected metrics & status​

More information about collected metrics is available in the official Amazon documentation: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-monitoring-using-cloudwatch

Metric nameDescriptionUnit
sqs.queue.messages.oldest.secondsThe approximate age of the oldest non-deleted message in the queue.s
sqs.queue.messages.delayed.countThe number of messages in the queue that are delayed and not available for reading immediately.
sqs.queue.messages.notvisible.countThe number of messages that are in flight.
sqs.queue.messages.visible.countThe number of messages available for retrieval from the queue.
sqs.queue.messages.empty.countThe number of ReceiveMessage API calls that did not return a message.
sqs.queue.messages.deleted.countThe number of messages deleted from the queue.
sqs.queue.messages.received.countThe number of messages returned by calls to the ReceiveMessage action.
sqs.queue.messages.sent.countThe number of messages added to a queue.

Prerequisites​

AWS Configuration​

Configure a service account (access/secret keys combo) for which the following privileges have to be granted:

AWS PrivilegeDescription
sqs:ListQueuesReturns a list of your queues in the current region.
cloudwatch:listMetricsList all metrics from Cloudwatch AWS/VPN namespace
cloudwatch:getMetricStatisticsGet metrics values from Cloudwatch AWS/VPN namespace

Plugin dependencies​

To interact with Amazon APIs, you can use either use the awscli binary provided by Amazon or paws, a Perl AWS SDK (recommended). You must install it on every poller expected to monitor AWS resources.

For now, it is not possible to use paws if you are using a proxy to reach AWS Cloudwatch APIs.

yum install perl-Paws

Setup​

  1. Install the package on every Centreon poller expected to monitor SQS resources:
yum install centreon-plugin-Cloud-Aws-Sqs-Api
  1. On the Centreon web interface, on page Configuration > Monitoring Connector Manager, install the Amazon SQS Centreon Monitoring Connector.

Configuration​

  • Log into Centreon and add a new host through Configuration > Hosts.
  • In the IP Address/DNS field, set the following IP address: 127.0.0.1.
  • Aplly the Cloud-Aws-Sqs-custom template to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryNomDescription
XAWSSECRETKEYAWS Secret key of your IAM role. Password checkbox must be checked
XAWSACESSKEYAWS Access key of your IAM role. Password checkbox must be checked
XAWSREGIONRegion where the instance is running
XAWSCUSTOMMODECustom mode to get metrics, 'awscli' is the default, you can also use 'paws' perl library
QUEUENAMEQueue name (Default : '.*')
PROXYURLConfigure proxy URL
EXTRAOPTIONSAny extra option you may want to add to every command line (eg. a --verbose flag)
DUMMYSTATUSHost state. Default is OK, do not modify it unless you know what you are doing
DUMMYOUTPUTHost check output. Default is 'This is a dummy check'. Customize it with your own if needed

How to check in the CLI that the configuration is OK and what are the main options for?​

Once the plugin is installed, log into your Centreon poller's CLI using the centreon-engine user account (su - centreon-engine) and test the plugin by running the following command (Some of the parameters such as --proxyurl have to be adjusted):

/usr/lib/centreon/plugins/centreon_aws_sqs_api.pl \
--plugin=cloud::aws::sqs::plugin \
--mode=queues \
--custommode=awscli \
--aws-secret-key='*******************' \
--aws-access-key='**********' \
--region='eu-west-1' \
--proxyurl='http://myproxy.mycompany.org:8080'
--statistic=average \
--timeframe='600' \
--period='60' \
--queue-name='my_sqs_queue_1' \
--filter-metric='NumberOfMessagesSent|NumberOfMessagesReceived' \
--critical-messages-sent=1: \
--critical-messages-received=1: \
--verbose

Expected command output is shown below:

OK: 'my_sqs_queue_1' Statistic 'Average' number of messages sent: 45, number of 
messages received: 32 | 'my_sqs_queue_1~average#sqs.queue.messages.sent.count'=45;;1:;; 'my_sqs_queue_1~average#sqs.queue.messages.received.count'=32;;1:;;
SQS Queue'my_sqs_queue_1'
Statistic 'Average' number of messages sent: 45, number of messages received: 32

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins//centreon_aws_sqs_api.pl \
--plugin=cloud::aws::sqs::plugin \
--mode=queues \
--help

All available modes can be displayed by adding the --list-mode parameter to the command:

/usr/lib/centreon/plugins//centreon_aws_sqs_api.pl \
--plugin=cloud::aws::sqs::plugin \
--list-mode

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.