Skip to main content

NtopNG Rest API

Pack Assets​

Templates​

The Centreon Pack NtopNG brings 1 host template:

  • App-Monitoring-Ntopng-Restapi-custom

It brings the following Service Templates:

Service AliasService TemplateDefaultDiscovery
AlertsApp-Monitoring-Ntopng-Restapi-AlertsX
Host-FlowsApp-Monitoring-Ntopng-Restapi-Host-Flows
Netflow-HealthApp-Monitoring-Ntopng-Restapi-Netflow-HealthX
Probe-HealthApp-Monitoring-Ntopng-Restapi-Probe-HealthX

Collected metrics & status​

Metric nameDescriptionUnit
alerts.severity.error.countNumber of alerts with error severity
alerts.severity.warning.countNumber of alerts with warning severity
alerts.severity.info.countNumber of alerts with informational severity
alert statusCurrent alert status
type#alerts.type.detected.countNumber of alerts detected by type

Prerequisites​

To monitor your NtopNG, the Rest API must be configured. E.g: https://www.ntop.org/guides/ntopng/api/

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor NtopNG RestAPI resources:
yum install centreon-plugin-Applications-Monitoring-Ntopng-Restapi
  1. On the Centreon Web interface, install the NtopNG RestAPI Centreon Pack on the Configuration > Monitoring Connector Manager page.

Configuration​

Host​

  • Log into Centreon and add a new Host through Configuration > Hosts.
  • Fill the Name, Alias & IP Address / DNS fields according to your NtopNG RestAPI server settings.
  • Apply the App-Monitoring-Ntopng-Restapi-custom template to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryNameDescription
XNTOPNGAPIPORTPort used (Default: 3000)
XNTOPNGAPIPROTOSpecify https if needed (default: 'http')
XNTOPNGAPIUSERNAMEApi username
XNTOPNGAPIPASSWORDApi password
NTOPNGAPIEXTRAOPTIONSAny extra option you may want to add to the command (eg. a --verbose flag)

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_monitoring_ntopng_restapi.pl \
--plugin=apps::monitoring::ntopng::restapi::plugin \
--mode=probe-health \
--hostname='10.0.0.1' \
--port='443' \
--proto='https' \
--api-username='my-username' \
--api-password='my-password' \
--verbose

The expected command output is shown below:

OK: cpu utilization: 2.10%, cpu load: 0.06, memory used: 11.83 %, dropped alerts: 0.00/s | 'cpu.utilization.percentage'=2.10%;;;0;100 'cpu.load.percentage'=0.06;;;0; 'memory.usage.percentage'=11.83%;;;0;100 'alerts.dropped.persecond'=0.00/s;;;0;

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

/usr/lib/centreon/plugins/centreon_monitoring_ntopng_restapi.pl \
--plugin=apps::monitoring::ntopng::restapi::plugin \
--mode=probe-health \
--help

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

/usr/lib/centreon/plugins/centreon_monitoring_ntopng_restapi.pl \
--plugin=apps::monitoring::ntopng::restapi::plugin \
--list-mode

Troubleshooting​

Please find the troubleshooting documentation for the API-based plugins in this chapter.