Skip to main content
Question

Host macros not saved after 24.10 -> 25.10 upgrade

  • March 19, 2026
  • 4 replies
  • 9 views

Forum|alt.badge.img+1

Hello,

 

I just updated to 25.10 and when editing a host using Centreon-Web, New host macro value are not saved.

I can see the correct form payload values, HTTP status is 200, nothing is shown in centreon-web or sql-errors, but no new entry is added to on_demand_macro_host SQL table.

 

Any idea ?

 

Edit: I just figured out something: the hosts where it’s failing have a large number of macros, hosts with less entries work

 

Thanks

4 replies

Forum|alt.badge.img+11

Just to be sure for the services, are you using independent services for each of your hosts or are you using some services for multiple hosts ?

I remember that there is issues with macros when services refer to multiple hosts. This is now a non recommended way to do it and is planned to be removed at some point.


Forum|alt.badge.img+1
  • Author
  • Steward *
  • March 19, 2026

It’s independ (service template associated to host template) => generate one service per host

 

However, I just figured out….

 

I create the file /etc/php/8.2/fpm/conf.d/99-local-centreon-overrides.ini containing:

max_input_vars = 10000

 

However, this file is specific to currently used PHP 8.2 so it will become irrelevant next time Centreon switches to a different version, so I created a monitoring check discovering running FPM version and checking for associated local overrides config and expected PHP parameters…

 

*Disclaimer* It’s Claude Code vibe-coded:

At /usr/local/bin/check_centreon_php_fpm_config.sh

#!/bin/bash

# Add any PHP ini variables to check here, with their expected values
declare -A REQUIRED_VARS=(
# ADCE 2026-03-19: If this value is too low, hosts with many macros value are saved but entries are discarded
[max_input_vars]=10000
)

if [[ "$EUID" -ne 0 ]]; then
echo "UNKNOWN: This check must be run as root"
exit 3
fi

# Find running PHP-FPM version via systemctl
FPM_SERVICE=$(systemctl list-units --type=service --state=running | grep -oP 'php\S+-fpm\.service' | head -1)

if [[ -z "$FPM_SERVICE" ]]; then
echo "UNKNOWN: No running PHP-FPM service found"
exit 3
fi

PHP_VERSION=$(echo "$FPM_SERVICE" | grep -oP '\d+\.\d+')
OVERRIDE_FILE="/etc/php/${PHP_VERSION}/fpm/conf.d/99-local-centreon-overrides.ini"

if [[ ! -f "$OVERRIDE_FILE" ]]; then
echo "CRITICAL: Override file not found: $OVERRIDE_FILE (PHP ${PHP_VERSION})"
exit 2
fi

ERRORS=()
SUMMARY=()

for VAR in "${!REQUIRED_VARS[@]}"; do
EXPECTED_VAL="${REQUIRED_VARS[$VAR]}"

if ! grep -q "^${VAR}" "$OVERRIDE_FILE"; then
ERRORS+=("$VAR not set")
continue
fi

CURRENT_VAL=$(grep "^${VAR}" "$OVERRIDE_FILE" | sed 's/^[^=]*=\s*//' | tr -d '[:space:]')

if [[ "$CURRENT_VAL" != "$EXPECTED_VAL" ]]; then
ERRORS+=("$VAR = $CURRENT_VAL, expected $EXPECTED_VAL")
else
SUMMARY+=("$VAR = $CURRENT_VAL")
fi
done

if [[ "${#ERRORS[@]}" -gt 0 ]]; then
OUTPUT=$(IFS='; '; echo "${ERRORS[*]}")
echo "CRITICAL: $OUTPUT in $OVERRIDE_FILE (PHP ${PHP_VERSION})"
exit 2
fi

OUTPUT=$(IFS=', '; echo "${SUMMARY[*]}")
echo "OK: $OUTPUT in $OVERRIDE_FILE (PHP ${PHP_VERSION})"
exit 0

 

Run through NRPE with sudo


Forum|alt.badge.img+11

I suppose but the limit for the php input is there for DDOS reasons.
If you have that many macros i would question your usage here at the host level.
Aren’t some of them more appropriate to be applied on services ?

I’m confused how you can encounter that issue, but maybe your use case is oddly specific.

Good you figured it out.


Forum|alt.badge.img+1
  • Author
  • Steward *
  • March 19, 2026

26 individual disks monitoring parameters, 3 parameters per disk, Centreon seems to includes 5 parameters per macro (like name, value, password, order...), that’s roughly 400/1000.

 

Remaining slots are probably taken by the rest of the host edit form.

 

Imho, that’s a perfectly reasonable config and Centreon should set an increased value ;)