Skip to main content

Parity Ethpoller API

Overview​

Event poller with RESTful API for both Ethereum and Hyperledger Fabric Blockchain technologies.

The Centreon Plugin-Pack Ethpoller API connects to various API endpoints to gather application, adoption and utilization metrics of a Blockchain implementation.

Pack assets​

Monitored objects​

  • Blockchain Parity Ethpoller endpoint
    • Tracking
    • Stats
    • Disk

Collected metrics & status​

Metric nameDescriptionUnit
parity.tracking.events.perminuteNumber of events by minute
parity.tracking.mined.block.prctPercentage of block mined%
parity.tracking.balance.changes.perminuteNumber of balance changes per minutewei

Prerequisites​

To get data from the BCM/ETH Poller, deploy it within your Blockchain network thanks to IRT-Systemx's official documentation

To get data from the API, the Poller must be able to communicate with it over the configured port (default: 8000).

Setup​

  1. Install the Centreon Plugin package on every Centreon Poller expected to monitor Parity or Hyperledger blockchains:
yum install centreon-plugin-Blockchain-Parity-Ethpoller-Restapi
  1. On the Centreon Web interface, install the Ethpoller API Centreon Plugin Pack on the "Configuration > Plugin Packs" page

Configuration​

Host configuration​

  • Log into Centreon and add a new Host through "Configuration > Hosts".
  • Fill the "Name", "Alias" & "IP Address / DNS" fields according to your TO CHANGE Server settings
  • Apply the Blockchain-Parity-Ethpoller-Restapi-custom template and configure all the mandatory Macros:
MandatoryNameDescription
XETHPOLLERAPIPORTPort used (Default: '8000')
XETHPOLLERPROTOProtocol used (Default: 'http')
XETHPOLLERAPIURLPATHPath to the API - (Default: '/')
TIMEOUTRequest timeout
ETHPOLLEREXTRAOPTIONSAny extra option you may want to add to every command_line (eg. a --verbose flag)

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

Once the plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_blockchain_parity_ethpoller_api.pl  \ 
--plugin=blockchain::parity::ethpoller::plugin \
--mode=tracking \
--hostname=10.0.0.1 \
--port='8000' \
--proto='http' \
--url-path='/' \
--timeout='10' \
--warning-balance-changes='' \
--critical-balance-changes='' \
--warning-events-frequency='' \
--critical-events-frequency='' \
--warning-mining-frequency='' \
--critical-mining-frequency='' \
--warning-mining-prct='' \
--critical-mining-prct='50:'

Expected command output is shown below:

OK: Events metrics are ok - Mining metrics are ok - Balances metrics are ok |
'agent1#parity.tracking.events.perminute'=5.00;;;; 'agent2#parity.tracking.events.perminute'=15.00;;;; 'agent3#parity.tracking.events.perminute'=15.00;;;; 'agent4#parity.tracking.events.perminute'=10.00;;;; 'agent5#parity.tracking.events.perminute'=0.00;;;; 'credit#parity.tracking.events.perminute'=10.00;;;; 'deploy#parity.tracking.events.perminute'=20.00;;;; 'registry#parity.tracking.events.perminute'=5.00;;;; 'black#parity.tracking.mined.block.perminute'=5.00;;;; 'black#parity.tracking.mined.block.prct'=33.41%;;;0; 'gray#parity.tracking.mined.block.perminute'=10.00;;;; 'gray#parity.tracking.mined.block.prct'=33.14%;;;0; 'white#parity.tracking.mined.block.perminute'=10.00;;;; 'white#parity.tracking.mined.block.prct'=33.46%;;;0; 'master#parity.tracking.balance.changes.perminute'=0.00wei;;;; 'random#parity.tracking.balance.changes.perminute'=729999999999997378560.00wei;;;;

This command would trigger a CRITICAL alarm if a node mined less than 50% of all blocks (--critical-mining-prct=50:).

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

All plugin modes can be listed with the following command:

/usr/lib/centreon/plugins//centreon_blockchain_parity_ethpoller_api.pl  \ 
--plugin=blockchain::parity::ethpoller::plugin \
--list-mode

Troubleshooting​

UNKNOWN: Can't connect to ...​

This error message means that the Centreon Plugin couldn't successfully connect to the Ethpoller API. Check that no third party device (such as a firewall) is blocking the request.

UNKNOWN: Cannot decode json response​

This error message means that the Centreon Plugin couldn't successfully connect to the Ethpoller API. Check that no third party device (such as a firewall) is blocking the request. A proxy connection may also be necessary to connect to the API. This can be done by using this option in the command: --proxyurl='http://proxy.mycompany:8080'.