Skip to main content

Amazon Direct Connect

Pack Assets​

Templates​

The Centreon Monitoring Connector Amazon Direct Connect brings a host template:

  • Cloud-Aws-Directconnect-custom-custom

It brings the following service templates:

Service AliasService TemplateService DescriptionDefaultDiscovery
Virtual-InterfacesCloud-Aws-Directconnect-Virtual-Interfaces-ApiCheck virtual interfacesXX
ConnectionsCloud-Aws-Directconnect-Connections-ApiCheck connectionsX

Default services are automatically created when the host template is applied.

Services templates with the Discovery field are linked to a service discovery rule.

Discovery rules​

The pack provides a discovery rule to automatically discover Amazon Direct Connect resources.

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

Collected metrics & status​

Metric NameUnit
connection state
connection_name#connection.egress.bitspersecondbps
connection_name#connection.ingress.bitspersecondbps
connection_name#connection.egress.packets.persecond/s
connection_name#connection.ingress.packets.persecond/s
connection_name#connection.outbound.light.level.dbmdBm
connection_name#connection.inbound.light.level.dbmdBm

Prerequisites​

AWS Configuration​

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

AWS PrivilegeDescription
directconnect:describe-connectionsReturns all connections.
directconnect:describe-virtual-interfacesReturns all virtual interfaces.
cloudwatch:getMetricStatisticsGet metrics from the AWS/DX 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​

Monitoring Pack​

If the platform uses an online license, you can skip the package installation instruction below as it is not required to have the pack displayed within the Configuration > Monitoring Connector Manager menu. If the platform uses an offline license, install the package on the central server with the command corresponding to the operating system's package manager:

dnf install centreon-pack-cloud-aws-directconnect

Whatever the license type (online or offline), install the Amazon Direct Connect Pack through the Configuration > Monitoring Connector Manager menu.

Plugin​

Since Centreon 22.04, you can benefit from the 'Automatic plugin installation' feature. When this feature is enabled, you can skip the installation part below.

You still have to manually install the plugin on the poller(s) when:

  • Automatic plugin installation is turned off
  • You want to run a discovery job from a poller that doesn't monitor any resource of this kind yet

More information in the Installing the plugin section.

Use the commands below according to your operating system's package manager:

dnf install centreon-plugin-Cloud-Aws-Directconnect-Api

Configuration​

Host​

  1. Log into Centreon and add a new host through Configuration > Hosts.
  2. Fill the Name, Alias & IP Address/DNS fields according to your ressource settings.
  3. Apply the Cloud-Aws-Directconnect-custom-custom template to the host
  4. Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryMacroDescriptionDefault
AWSACCESSKEYSet AWS access key
AWSASSUMEROLESet arn of the role to be assumed
AWSCUSTOMMODEChoose a custom modeawscli
AWSREGIONSet the region name
AWSSECRETKEYSet AWS secret key
CONNECTIONIDConnection id
EXTRAOPTIONSAny extra option you may want to add to every command line (eg. a --verbose flag)
PROXYURLProxy URL if any

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_directconnect_api.pl \
--plugin=cloud::aws::directconnect::plugin \
--mode=connections \
--custommode=awscli \
--aws-secret-key='*******************' \
--aws-access-key='**********' \
--region='eu-west-1' \
--proxyurl='http://myproxy.mycompany.org:8080'
--statistic=average \
--timeframe='600' \
--period='60' \
--verbose

The expected command output is shown below:

OK: connection 'Centreon-EqFA5-Connection-1-10Gbps' state: available [bandwidth: 10Gbps] - statistic 'Average' outbound data: 19.58 Mb/s, inbound data: 53.96 Mb/s, inbound light level: -1.48 dBm, outbound light level: -1.37 dBm, outbound packets data: 7318.25 /s, inbound packet data: 8787.87 /s | 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.egress.bitspersecond'=19579682.84bps;;;; 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.ingress.bitspersecond'=53962349.94bps;;;; 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.inbound.light.level.dbm'=-1.48dBm;;;; 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.outbound.light.level.dbm'=-1.37dBm;;;; 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.egress.packets.persecond'=7318.25/s;;;; 'Centreon-EqFA5-Connection-1-10Gbps~average#connection.ingress.packets.persecond'=8787.87/s;;;;
Checking connection 'Centreon-EqFA5-Connection-1-10Gbps'
state: available [bandwidth: 10Gbps]
statistic 'Average' outbound data: 19.58 Mb/s, inbound data: 53.96 Mb/s, inbound light level: -1.48 dBm, outbound light level: -1.37 dBm, outbound packets data: 7318.25 /s, inbound packet data: 8787.87 /s

Available custom modes​

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

/usr/lib/centreon/plugins/centreon_aws_directconnect_api.pl \
--plugin=cloud::aws::directconnect::plugin \
--list-custommode

The plugin brings the following custom modes:

  • paws
  • awscli

Available modes​

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

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

The plugin brings the following modes:

ModeTemplate
connectionsCloud-Aws-Directconnect-Connections-Api
discoveryUsed for host discovery
list-connectionsNot used in this Plugin Pack
list-virtual-interfacesUsed for service discovery
virtual-interfacesCloud-Aws-Directconnect-Virtual-Interfaces-Api

Available options​

Global options​

All global options are listed here:

OptionDescriptionType
--modeChoose a mode.Global
--dyn-modeSpecify a mode with the path (separated by '::').Global
--list-modeList available modes.Global
--mode-versionCheck minimal version of mode. If not, unknown error.Global
--versionDisplay plugin version.Global
--custommodeChoose a custom mode.Global
--list-custommodeList available custom modes.Global
--multipleMultiple custom mode objects (required by some specific modes)Global
--pass-managerUse a password manager.Global
--verboseDisplay long output.Output
--debugDisplay also debug messages.Output
--filter-perfdataFilter perfdata that match the regexp.Output
--filter-perfdata-advAdvanced perfdata filter. Eg: --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")'Output
--explode-perfdata-maxPut max perfdata (if it exist) in a specific perfdata (without values: same with '_max' suffix) (Multiple options)Output
--change-perfdata --extend-perfdataChange or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target[,[newuom],[min],[m ax]] Common examples: Change storage free perfdata in used: --change-perfdata=free,used,invert() Change storage free perfdata in used: --change-perfdata=used,free,invert() Scale traffic values automaticaly: --change-perfdata=traffic,,scale(auto) Scale traffic values in Mbps: --change-perfdata=traffic_in,,scale(Mbps),mbps Change traffic values in percent: --change-perfdata=traffic_in,,percent()Output
--extend-perfdata-groupExtend perfdata from multiple perfdatas (methods in target are: min, max, average, sum) Syntax: --extend-perfdata-group=searchlabel,newlabel,target[,[newuom],[m in],[max]] Common examples: Sum wrong packets from all interfaces (with interface need --units-errors=absolute): --extend-perfdata-group=',packets_wrong,sum(packets_(discard |error)_(in|out))' Sum traffic by interface: --extend-perfdata-group='traffic_in_(.*),traffic_$1,sum(traf fic_(in|out)_$1)'Output
--change-short-output --change-long-outputChange short/long output display: --change-short-output=pattern~replace~modifierOutput
--change-exitChange exit code: --change-exit=unknown=criticalOutput
--range-perfdataChange perfdata range thresholds display: 1 = start value equals to '0' is removed, 2 = threshold range is not display.Output
--filter-uomFilter UOM that match the regexp.Output
--opt-exitOptional exit code for an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc) (Default: unknown).Output
--output-ignore-perfdataRemove perfdata from output.Output
--output-ignore-labelRemove label status from output.Output
--output-xmlDisplay output in XML format.Output
--output-jsonDisplay output in JSON format.Output
--output-openmetricsDisplay metrics in OpenMetrics format.Output
--output-fileWrite output in file (can be used with json and xml options)Output
--disco-formatDisplay discovery arguments (if the mode manages it).Output
--disco-showDisplay discovery values (if the mode manages it).Output
--float-precisionSet the float precision for thresholds (Default: 8).Output
--source-encodingSet encoding of monitoring sources (In some case. Default: 'UTF-8').Output

Custom modes options​

All custom modes specific options are listed here:

OptionDescriptionType
--aws-secret-keySet AWS secret key.Awscli
--aws-access-keySet AWS access key.Awscli
--aws-session-tokenSet AWS session token.Awscli
--aws-role-arnSet arn of the role to be assumed.Awscli
--aws-profileSet AWS profile.Awscli
--endpoint-urlOverride AWS service endpoint URL if necessary.Awscli
--regionSet the region name (Required).Awscli
--periodSet period in seconds.Awscli
--timeframeSet timeframe in seconds.Awscli
--statisticSet cloudwatch statistics (Can be: 'minimum', 'maximum', 'average', 'sum').Awscli
--zeroedSet metrics value to 0 if none. Usefull when CloudWatch does not return value when not defined.Awscli
--timeoutSet timeout in seconds (Default: 50).Awscli
--sudoUse 'sudo' to execute the command.Awscli
--commandCommand to get information (Default: 'aws'). Can be changed if you have output in a file.Awscli
--command-pathCommand path (Default: none).Awscli
--command-optionsCommand options (Default: none). Only use for testing purpose, when you want to set ALL parameters of a command by yourself.Awscli
--proxyurlProxy URL if anyAwscli
--skip-ssl-checkAvoid certificate issuer verification. Useful when AWS resources are hosted by a third-party. Note that it strips all stderr from the command result. Will be enhanced someday. Debug will only display CLI instead of evreything.Awscli

Modes options​

All modes specific options are listed here:

OptionDescriptionType
--critical-connection-egress='10Mb' --verbose See 'https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing\_metrics\_wit h_cloudwatch.html' for more informations. Default statistic: 'average' / All satistics are valid.Mode
--filter-connection-idFilter connection id (can be a regexp).Mode
--filter-metricFilter metrics (Can be: 'ConnectionBpsEgress', 'ConnectionBpsIngress', 'ConnectionPpsEgress', 'ConnectionPpsIngress', 'ConnectionLightLevelTx', 'ConnectionLightLevelRx') (Can be a regexp).Mode
--warning-statusSet warning threshold for status. Can used special variables like: %{state}, %{bandwidth}, %{connectionName}Mode
--critical-statusSet critical threshold for status. Can used special variables like: %{state}, %{bandwidth}, %{connectionName}Mode
--warning- --critical-Thresholds. Can be 'connection-egress', 'connection-ingress', 'connection-packets-egress', 'connection-packets-ingress', 'connection-ligh-level-outbound', 'connection-ligh-level-inbound.Mode

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

/usr/lib/centreon/plugins/centreon_aws_directconnect_api.pl \
--plugin=cloud::aws::directconnect::plugin \
--mode=connections \
--help

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.