Skip to main content

Centreon Monitoring Agent

Introduction​

The Centreon Monitoring Agent (CMA) collects metrics and computes statuses on the servers it monitors, and sends them to Centreon. Centreon plugins as well as Nagios-compatible plugins can be used with this agent.

Limitations​

The Centreon Monitoring Agent is in Beta Phase. The following limitations need to be considered :

  • The scope of supported monitoring is limited, new (native) controls will be introduced in the final version.
  • Manual configuration is required. In the final version, this will be possible via the user interface and largely automated.

Supported OSs​

The CMA can be installed on and monitor the following OSs:

  • Alma 8
  • Alma 9
  • Debian 11
  • Debian 12
  • Ubuntu 22.04 LTS

Step 1: Configure Centreon​

Install the Monitoring Connector​

  1. On your central server, go to Configuration > Monitoring Connector Manager.
  2. Install the Linux Centreon Monitoring Agent monitoring connector.

Create the CMA connector​

On your central server:

  1. Go to Configuration > Commands > Connectors.
  2. Create a new connector with the following values:
ParameterValue
Connector NameCentreon Monitoring Agent
Connector DescriptionCentreon Monitoring Agent
Command Lineopentelemetry --processor=centreon_agent --extractor=attributes --host_path=resource_metrics.resource.attributes.host.name --service_path=resource_metrics.resource.attributes.service.name
Used by commandType Centreon-Monitoring-Agent and click Select all
Connector StatusEnabled

Configure Engine​

  1. On the poller that will receive the data from the agent, install the centreon-engine-opentelemetry package.

  2. Configure how the poller and the agent will communicate:

  • Some agents can connect to the poller, while the poller can connect to some other agents.
  • You can select several pollers at once in a single configuration form so that you don't have to do the same configuration several times.
  1. Go to Configuration > Pollers > Agent configurations and click Add poller/agent configuration.
  2. In the window that opens, select the type of agent you want to configure. Additional fields appear.
  3. In the Parameters section, select the poller(s) that will receive data from the agent.
  4. In the OTLP receiver section, enter the file names for the certificates for the part of the poller that will receive data from the agent, i.e., the poller's engine. Communication between the agent and the poller is always in HTTPS. You need to store the certificates in the /etc/pki/ directory of the poller.
  1. If the agent is not allowed to connect to the poller for security reasons (e.g. when the poller is in a DMZ), enable Connection initiated by poller. Then, in Host configurations, define all the hosts on which the agent will be installed. Here the certificates are optional, but if you use them, store them in the /etc/pki/ directory of the poller.

If you configure several pollers at once, make sure all certificate files have the same name.

  1. Deploy the configuration.

  2. Restart the monitoring engine:

    systemctl restart centengine

The CMA can now communicate with Centreon. You can set up the monitoring of your hosts.

Step 2: Prepare the host​

Download and install the agent​

  • Install the centreon-monitoring-agent package.
  1. Modify the /etc/centreon-monitoring-agent/centagent.json file (4 cases):
{
"log_level":"trace",
"endpoint":"<IP POLLER>:4317",
"host":"host_1",
"log_type":"file",
"log_file":"/var/log/centreon-monitoring-agent/centagent.log"
}

Log configuration​

You can configure two kinds of log output:

  • file: the CMA logs into a file, the path is configured in the log_file option.
  • stdout: standard output is used.

If you choose to log into a file, log rotation can be customized using the log_max_file_size and log_max_files options.

Allowed log levels are: trace, debug, info, warning, error, critical and off.

  1. Restart the CMA:
systemctl restart centagent

Deploy the Centreon plugin​

The Centreon plugin will execute the checks on the host.

Enable our plugins repository and install the plugin​

This repository will provide you our packaged plugins as well as the dependencies that are not available in the standard distribution repositories.

cat >/etc/yum.repos.d/centreon-plugins.repo <<'EOF'
[centreon-plugins-stable]
name=Centreon plugins repository.
baseurl=https://packages.centreon.com/rpm-plugins/el8/stable/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1

[centreon-plugins-stable-noarch]
name=Centreon plugins repository.
baseurl=https://packages.centreon.com/rpm-plugins/el8/stable/noarch/
enabled=1
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1

[centreon-plugins-testing]
name=Centreon plugins repository. (UNSUPPORTED)
baseurl=https://packages.centreon.com/rpm-plugins/el8/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1

[centreon-plugins-testing-noarch]
name=Centreon plugins repository. (UNSUPPORTED)
baseurl=https://packages.centreon.com/rpm-plugins/el8/testing/noarch/
enabled=0
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1

[centreon-plugins-unstable]
name=Centreon plugins repository. (UNSUPPORTED)
baseurl=https://packages.centreon.com/rpm-plugins/el8/unstable/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1

[centreon-plugins-unstable-noarch]
name=Centreon plugins repository. (UNSUPPORTED)
baseurl=https://packages.centreon.com/rpm-plugins/el8/unstable/noarch/
enabled=0
gpgcheck=1
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
module_hotfixes=1
EOF

Install the plugin:

dnf install -y centreon-plugin-Operatingsystems-Linux-Local.noarch

Step 3: Monitoring a host with the CMA​

Create hosts using templates​

On the central server, create hosts and apply to them the OS-Linux-Centreon-Monitoring-Agent-custom template.