Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Technical FAQs

rem31 edited this page Apr 13, 2022 · 15 revisions

Some technical questions about Centreon

Contents

Centreon Web UI

Centreon Poller


Centreon Web UI

Get the version of Centreon Web in UI

Go to the page Administration > About and you should get the version of Centreon Web UI and also the commit of the build


Centreon Poller

Generate a core dump during a segfault

This following procedure describes how to configure coredumpctl to retrieve core dumps if a segfault happens.

Activate core dump generation

Before retrieving a core dump, you must configure the system for it to generate core dumps at segfault.

  1. Install gdb

    for centos 7:

    yum install devtoolset-9-gdb
    ln -s /opt/rh/devtoolset-9/root/usr/bin/{gdb,gcore,gdb-add-index,gstack,pstack} /usr/bin/

    For others distributions, use your OS software manager, for examples:

    yum install gdb

    or

    apt install gdb
  2. Uncomment "DumpCore=yes" in "/etc/systemd/system.conf"

  3. Replace "DefaultLimitCORE=" by "DefaultLimitCORE=infinity" in "/etc/systemd/system.conf"

  4. Add these lines in "/etc/sysctl.conf":

    kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e 
    fs.suid_dumpable=2
    
  5. Add "LimitCORE=infinity" in "/usr/lib/systemd/system/cbd.service" just after the line "User"

  6. Add "LimitCORE=infinity" in "/usr/lib/systemd/system/centengine.service" just after the line "User"

  7. Restart systemd to commit the changes:

    sysctl -p 
    systemctl daemon-reexec

Retrieve a core dump

After activating core dumps generation, you must wait for a segfault to occur. You will see them in the system's log "/var/log/messages".

  1. List the core dumps:
    coredumpctl list
  2. Retrieve the core dump
    coredumpctl -o <filename.core> dump /usr/sbin/centengine

This command will store the last coredump of /usr/sbin/centengine to a file named filename.core.

You can do the same with /usr/sbin/cbd.

Generate a coredump manually

Sometimes, it can be interesting to generate a coredump manually. For example if centreon-engine looks blocked but not crashed.

The procedure for that is to install gdb on the server:

for centos 7:

yum install devtoolset-9-gdb
source /opt/rh/devtoolset-9/enable

For others distributions, use your OS software manager, for examples:

yum install gdb

or

apt install gdb

Then the generation is made in two steps:

  1. get the PID of the program you want a coredump ; here is an example with centengine:

    ps ax | grep centengine
    2272 ?        Ssl   33:43 /usr/sbin/centengine /etc/centreon-engine/centengine.cfg
  2. generate the coredump:

    gcore 2272

    where 2272 is the PID you get at the step 1.

    In the current directory, you should find a new file core.2272 that is the coredump.

Generate more logs for Centreon Broker

Warning All this section works for centreon-broker versions between 20.04 and 20.10. Since centreon-21.04, those new logs can be configured directly from the Centreon WUI.

Since centreon-broker 20.04, we have new logs, more accurate than our old logs. In centreon-broker 21.04, they are configurable directly in the WUI, but before you needed to configure a file, here is how to fill it.

You can add a file named "/etc/centreon-broker/log-config.json" containing this:

{
    "console": false,
    "log_path": "/tmp",
    "loggers": [
        {
            "name": "sql",
            "level": "warn"
        }
    ]
}

Be careful, if the console label is set to true, this also enables cbmod logs to be written on the console. This can make conflicts with centengine, because they both use the stdout stream. So unless you know what you are doing set console to false.

You have choice between several loggers:

  • core
  • sql
  • bbdo
  • tcp
  • tls
  • lua
  • perfdata
  • bam

For the level, from the higher level to the lower, you have:

  • trace
  • debug
  • info
  • warn
  • err
  • critical
  • off

Here is more complete example of the log-config.json file:

{
    "console": false,
    "log_path": "/tmp",
    "loggers": [
        {
            "name": "sql",
            "level": "debug"
        },
        {
            "name": "bbdo",
            "level": "warn"
        },
        {
            "name": "perfdata",
            "level": "err"
        }
    ]
}

You will then find a log named after the Broker's name into the "/tmp" directory.