Amazon SNS
Pack Assetsβ
Templatesβ
The Centreon Plugin Pack Amazon SNS brings a host template:
- Cloud-Aws-Sns-custom
It brings the following service templates:
Service Alias | Service Template | Service Description | Default |
---|---|---|---|
Sns-Topic-Notifications | Cloud-Aws-Sns-Topic-Notifications-Api | Check Amazon SNS notifications per topic | X |
Discovery rulesβ
The pack provides a discovery rule to automatically discover SNS resources:
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/sns/latest/dg/sns-monitoring-using-cloudwatch
- Sns-Topic-Notifications
Metric name | Description |
---|---|
sns.notifications.published.count | The number of messages published to your Amazon SNS topics. |
sns.notifications.delivered.count | The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. |
sns.notifications.failed.count | The number of messages that Amazon SNS failed to deliver. |
sns.notifications.filtered.count | The number of messages that were rejected by subscription filter policies. |
Prerequisitesβ
AWS Configurationβ
Configure a service account (access/secret keys combo) for which the following privileges have to be granted:
AWS Privilege | Description |
---|---|
sns:ListTopics | Returns a list of the requester's topics. |
cloudwatch:listMetrics | List all metrics from Cloudwatch AWS/VPN namespace |
cloudwatch:getMetricStatistics | Get 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.
- perl-Paws-installation
- aws-cli-installation
yum install perl-Paws
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
For now, it is not possible to use paws in the following situations:
- if you are using a proxy to reach AWS Cloudwatch APIs.
- to automatically add Hosts in Centreon using the Host Discovery feature
Setupβ
- Online License
- Offline License
- Install the plugin package on every Centreon poller expected to monitor SNS resources:
yum install centreon-plugin-Cloud-Aws-Sns-Api
- On the Centreon web interface, on page Configuration > Plugin Packs, install the Amazon SNS Centreon Plugin Pack.
- Install the plugin package on every Centreon poller expected to monitor SNS resources:
yum install centreon-plugin-Cloud-Aws-Sns-Api
- Install the Amazon SNS Centreon Plugin Pack RPM on the Centreon central server:
yum install centreon-pack-cloud-aws-sns
- On the Centreon web interface, on page Configuration > Plugin Packs, install the Amazon SNS Centreon Plugin Pack.
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-Sns-custom template to the host.
- Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
Mandatory | Nom | Description |
---|---|---|
X | AWSSECRETKEY | AWS Secret key of your IAM role. Password checkbox must be checked |
X | AWSACESSKEY | AWS Access key of your IAM role. Password checkbox must be checked |
X | AWSREGION | Region where the instance is running |
X | AWSCUSTOMMODE | Custom mode to get metrics, 'awscli' is the default, you can also use 'paws' perl library |
PROXYURL | Configure proxy URL | |
TOPICNAME | Topic name (Default : '.*') | |
EXTRAOPTIONS | Any extra option you may want to add to every command line (eg. a --verbose flag) | |
DUMMYSTATUS | Host state. Default is OK, do not modify it unless you know what you are doing | |
DUMMYOUTPUT | Host 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_sns_api.pl \
--plugin=cloud::aws::sns::plugin \
--mode=notifications \
--custommode=awscli \
--aws-secret-key='*******************' \
--aws-access-key='**********' \
--region='eu-west-1' \
--proxyurl='http://myproxy.mycompany.org:8080'
--statistic=sum \
--timeframe='600' \
--period='60' \
--topic-name='my_sns_topic_1' \
--filter-metric='NumberOfNotificationsFailed' \
--warning-notifications-failed=0 \
--critical-notifications-failed=5 \
--verbose
Expected command output is shown below:
OK: 'my_sns_topic_1' Statistic 'Sum' number of notifications failed: 0 | 'my_sns_topic_1~sum#sns.notifications.failed.count'=0;;;;
Notifications for topic 'my_sns_topic_1' :
Statistic 'Sum' number of notifications failed: 0
All available options for a given mode can be displayed by adding the
--help
parameter to the command:
/usr/lib/centreon/plugins//centreon_aws_sns_api.pl \
--plugin=cloud::aws::sns::plugin \
--mode=notifications \
--help
All available modes can be displayed by adding the --list-mode
parameter to
the command:
/usr/lib/centreon/plugins//centreon_aws_sns_api.pl \
--plugin=cloud::aws::sns::plugin \
--list-mode
Troubleshootingβ
Please find the troubleshooting documentation for Centreon Plugins typical issues.