Skip to main content

Parity API

Overview​

Parity Blockchain is a fork of the Ethereum Blockchain.

The Centreon Monitoring Connector Parity API aims to get information and metrics from the Parity API.

Pack assets​

Monitored objects​

  • Blockchain Parity nodes
    • Parity
    • Info
    • Eth
    • Net

Collected metrics & status​

Metric nameDescriptionUnit
parity.pending.transactionsNumber of pending transactions
parity.mempol.usageMemory pool usageB
parity.mempol.sizeMemory pool sizeB
parity.peers.connectedNumber of connected peers
parity.peers.maxMaximum number of peers
parity.peers.usagePeers usage expressed in percent%

Prerequisites​

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

Setup​

  1. Install the Centreon package on every Centreon Poller expected to monitor Parity network nodes:
yum install centreon-plugin-Blockchain-Parity-Restapi
  1. On the Centreon Web interface, install the Parity API Centreon Monitoring Connector on the Configuration > Monitoring Connector Manager page

Host configuration​

  • Log into Centreon and add a new Host through "Configuration > Hosts".
  • Fill the "Name", "Alias" & "IP Address / DNS" fields according to your Blockchain Parity Server settings
  • Apply the Blockchain-Parity-Restapi-custom template and configure all the mandatory Macros:
MandatoryNameDescription
PARITYAPIPORT(Default: '8545')
PARITYPROTO(Default: 'http')
PARITYAPIURLPATH(Default: '/')
TIMEOUT
PARITYEXTRAOPTIONSAny extra option you may want to add to every command_line (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 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_api.pl  \ 
--plugin=blockchain::parity::restapi::plugin \
--mode=net \
--hostname=10.0.0.1 \
--port=8545 \
--proto=http \
--timeout=10 \
--proto=http \
--api-path=/ \
--warning-peers='' \
--critical-peers='1:'

Expected command output is shown below:

OK: Parity network module: connected peers: 2

This command would trigger a WARNING alarm if the number of peers is reported as (--warning-peers) and a CRITICAL alarm if less than 1 (--critical-peers=1:).

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

/usr/lib/centreon/plugins//centreon_blockchain_parity_api.pl  \ 
--plugin=blockchain::parity::restapi::plugin \
--mode=net \
--help

Troubleshooting​

UNKNOWN: Can't connect to ...​

This error message means that the Centreon Plugin couldn't successfully connect to the Parity 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 Parity 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'.