Skip to main content

AWS Lambda

Pack Assets​

Templates​

The Centreon Monitoring Connector AWS Lambda brings a host template:

  • Cloud-Aws-Lambda-custom

It brings the following service template:

Service AliasService TemplateService DescriptionDefault
Lambda-InvocationsCloud-Aws-Lambda-Invocations-ApiCheck Memcached performancesX

Discovery rules​

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

image

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

Collected metrics & status​

Metric NameUnit
lambda.function.duration.millisecondsms
lambda.function.invocations.countcount
lambda.function.errors.countcount
lambda.function.deadlettererrors.countcount
lambda.function.throttles.countcount
lambda.function.iteratorage.millisecondscount

Prerequisites​

AWS Configuration​

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

AWS PrivilegeDescription
lamdba:ListFunctionsGet a list of Lambda function
cloudwatch:getMetricStatisticsGet metrics from the AWS/EC2 namespace on Cloudwatch.

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 AWS Lambda resources:
yum install centreon-plugin-Cloud-Aws-Lambda-Api
  1. On the Centreon web interface, on page Configuration > Monitoring Connector Manager, install the AWS Lambda Centreon Monitoring Connector.

Configuration​

Host​

  • 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-Lambda-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
PROXYURLConfigure proxy URL
FUNCTIONNAMEFunction name (Default : '.*')
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:

/usr/lib/centreon/plugins//centreon_aws_lambda_api.pl \
--plugin=cloud::aws::lambda::plugin \
--mode=invocations \
--custommode='awscli' \
--aws-secret-key='' \
--aws-access-key='' \
--region='eu-west-1' \
--proxyurl='' \
--filter-metric='' \
--timeframe='600' \
--period='60' \
--name='myfunctions' \
--zeroed \
--verbose

The expected command output is shown below:

OK: Function 'myfunctions' All metrics are ok | 'myfunctions~average#lambda.function.throttles.count'=0.00;;;; 'myfunctions~average#lambda.function.errors.count'=0.00;;;; 'myfunctions~average#lambda.function.iteratorage.milliseconds'=0.00;;;; 'myfunctions~average#lambda.function.invocations.count'=0.00;;;; 'myfunctions~average#lambda.function.deadlettererrors.count'=0.00;;;; 'myfunctions~average#lambda.function.duration.milliseconds'=0.00;;;; 'myfunctions~sum#lambda.function.throttles.count'=0.00;;;; 'myfunctions~sum#lambda.function.errors.count'=0.00;;;; 'myfunctions~sum#lambda.function.iteratorage.milliseconds'=0.00;;;; 'myfunctions~sum#lambda.function.invocations.count'=0.00;;;; 'myfunctions~sum#lambda.function.deadlettererrors.count'=0.00;;;; 'myfunctions~sum#lambda.function.duration.milliseconds'=0.00;;;;
Checking Function 'myfunctions'
Statistic 'Average' Metrics Throttles: 0.00, Errors: 0.00, Iterator Age: 0.00, Invocations: 0.00, Dead Letter Errors: 0.00, Duration: 0.00
Statistic 'Sum' Metrics Throttles: 0.00, Errors: 0.00, Iterator Age: 0.00, Invocations: 0.00, Dead Letter Errors: 0.00, Duration: 0.00

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

/usr/lib/centreon/plugins//centreon_aws_lambda_api.pl \
--plugin=cloud::aws::lambda::plugin \
--mode=invocations \
--help

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

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

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.