Skip to main content

Ceph Rest API

Pack Assets​

Templates​

The Centreon Pack Ceph brings a host template:

  • App-Ceph-Restapi-custom

It brings the following service templates:

Service AliasService TemplateDefaultDiscovery
HealthApp-Ceph-Restapi-HealthX
OsdApp-Ceph-Restapi-OsdX
PoolsApp-Ceph-Restapi-PoolsX

Discovery rules​

Rule nameDescription
App-Ceph-Restapi-Pool-NameDiscover pools and monitor utilization

Collected metrics & status​

Metric nameDescriptionUnit
health statusCurrent overall cluster status

Prerequisites​

To monitor your Ceph, a user with read privileges is required. Please refer to their official documentation: https://docs.ceph.com/en/latest/mgr/ceph_api/

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor Ceph RestAPI resources:
yum install centreon-plugin-Applications-Ceph-Restapi
  1. On the Centreon web interface, install the Ceph 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 Ceph RestAPI server settings.
  • Apply the App-Ceph-Restapi-custom template to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryNameDescription
XCEPHAPIPORTPort used (Default: 8443)
XCEPHAPIPROTOSpecify http if needed (default: 'https')
XCEPHAPIUSERNAMEApi username
XCEPHAPIPASSWORDApi password
CEPHAPIEXTRAOPTIONSAny 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_ceph_restapi.pl \
--plugin=apps::ceph::restapi::plugin \
--mode=osd \
--hostname='10.0.0.1' \
--port='8443' \
--proto='https' \
--api-username='my-username' \
--api-password='my-password' \
--verbose

The expected command output is shown below:

OK: Number of osd detected: 3, online 100.00% (3 on 3), participating 100.00% (3 on 3) | 'osd.detected.count'=3;;;0; 'osd.online.count'=3;;;0;3 'osd.online.percentage'=100.00%;;;0;100 'osd.participating.count'=3;;;0;3 'osd.participating.percentage'=100.00%;;;0;100

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

/usr/lib/centreon/plugins/centreon_ceph_restapi.pl \
--plugin=apps::ceph::restapi::plugin \
--mode=osd \
--help

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

/usr/lib/centreon/plugins/centreon_ceph_restapi.pl \
--plugin=apps::ceph::restapi::plugin \
--list-mode

Troubleshooting​

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