Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
1.98k stars 571 forks source link

Performance data values parsing problem: inf, -inf #10073

Open RincewindsHat opened 4 weeks ago

RincewindsHat commented 4 weeks ago

Describe the bug

Some special performance data values like inf and -inf are parsed without hesitation by Icinga2 although they are probably in every case caused by a faulty plugin. Since the performance data value in Icinga2 is internally a double as far as I could deduct, the value is "correctly" parsed (by strtold in the end if I am correct), but the resulting DBL_MIN or DBL_MAX can later cause errors in Performance data writers (InfluxDB(2)) which do not accept inf or -inf as numbers.

To Reproduce

  1. Provide a check result with a performance data value foo=inf to Icinga2
  2. get the
    [2024-06-07 10:37:59 +0200] warning/Influxdb2Writer: Unexpected response code: Bad Request
    [2024-06-07 10:37:59 +0200] warning/Influxdb2Writer: Unexpected Content-Type: application/json; charset=utf-8

    message in /var/log/icinga2/icinga2.log

Expected behavior

Reject performance data values which are not concrete numbers and write a warning/error message to the log, so one can debug the monitoring plugin.

Your Environment

Include as many relevant details about the environment you experienced the problem in

RincewindsHat commented 4 weeks ago

ref/NC/820245