xWyatt / check_rest_api

Nagios Core plugin to check output from a RESTful JSON API
GNU General Public License v3.0
10 stars 5 forks source link

Internal type mismatch for max and min thresholds #27

Open okrouhly opened 1 year ago

okrouhly commented 1 year ago

I have realized that at least versions 1.2.0 and 1.1.0 contain wrong pointer destination type that is primary set to "double" in read_input.c BUT set to "int" in check_thresholds.c. It leads to wrong evaluation of critical and/or warning values set to infinity, e.g. "80:" does not work as expected. Current workarround is to set threshold to e.g. to something like "80:9999".

Clean fix is to change two occurences of "int min, max, inclusive"; lines to "double min, max, inclusive;" in file src/check_thresholds.c

Jan