Skip to main content

Centreon Database

Overview​

Centreon Database Plugin Pack will help you set up monitoring for Centreon monitoring database.

Pack Assets​

Templates​

The Centreon Plugin Pack Centreon Central brings a host template:

  • App-Monitoring-Centreon-Database-custom

It brings the following service templates:

Service AliasService TemplateService DescriptionDefault
PartitioningApp-Centreon-MySQL-Partitioning-customCheck Centreon Database partitionningX
Connection-TimeApp-DB-MySQL-Connection-Time-customCheck Centreon Database connection timeX
Connections-NumberApp-DB-MySQL-Connections-Number-customCheck Centreon Database connections numberX
Database-sizeApp-DB-MySQL-Database-Size-customCheck Centreon Database sizeX
Myisam-KeycacheApp-DB-MySQL-Myisam-Keycache-customCheck Centreon Database partitionningX
Open-FilesApp-DB-MySQL-Open-Files-customCheck Centreon Database open filesX
QueriesApp-DB-MySQL-Queries-customCheck Centreon Database queries numberX
SlowqueriesApp-DB-MySQL-Slowqueries-customCheck Centreon Database slow queriesX
SwapOS-Linux-Swap-SNMP-customCheck swap usageX
MemoryOS-Linux-Memory-SNMP-customCheck memory usageX
LoadOS-Linux-Load-SNMP-customCheck loadX
CpuOS-Linux-Cpu-SNMP-customCheck Cpu usageX

Collected metrics & status​

Database indicators:

Metric NameUnit
Partitioning Statusstring

System indicators:

Metric nameUnit
cpu.utilization.percentage%
core.cpu.utilization.percentage%

Prerequisites​

Creating a database user for Service Partitioning Monitoring​

In order to be able to collect the needed information from the database, a database user with specific privileges is required:

CREATE USER 'monitor_user'@'IP_POLLER' IDENTIFIED BY 'a_very_secure_passwd';
GRANT SELECT ON *.* to 'monitor_user'@'IP_POLLER';

SNMP​

SNMP must be configured on each poller being monitored. You can refer to this documentation describing how to set up a quick SNMP configuration.

Setup​

  1. Install the Centreon Plugin packages on the poller that will monitor Centreon monitoring database:
yum install centreon-plugin-Applications-Monitoring-Centreon-Database centreon-plugin-Operatingsystems-Linux-Snmp

  1. On the Centreon Web interface, install the Centreon Database Centreon Plugin Pack on the Configuration > Plugin Packs 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 Centreon Central server settings.
  • Select the App-Monitoring-Centreon-Database-custom template to apply to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
  • Values for macros MYSQLUSERNAME and MYSQLPASSWORD are the ones set before when creating the user to monitor the database.
MandatoryMacro
XMYSQLPORT
XMYSQLUSERNAME
XMYSQLPASSWORD
SNMPEXTRAOPTIONS

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 CLI using the centreon-engine user account (su - centreon-engine) and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_mysql.pl \
--plugin=database::mysql::plugin \
--host=localhost \
--username='monitor_user' \
--password='centreon' \
--port='3306' \
--mode=threads-connected \
--warning-usage='' \
--critical-usage='' \
--warning-usage-prct='' \
--critical-usage-prct=''

The expected command output is shown below:

OK: Client connected threads total: 151 used: 10 (6.62%) free: 141 (93.38%)

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

/usr/lib/centreon/plugins//centreon_mysql.pl \
--plugin=database::mysql::plugin \
--host=localhost \
--help

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

/usr/lib/centreon/plugins//centreon_mysql.pl \
--plugin=database::mysql::plugin \
--list-mode

Troubleshooting​

Please find all the troubleshooting documentation for the Centreon Plugins in the dedicated page