centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

apps::protocols::http::plugin --mode collection

Open MohaLaD opened this issue 11 months ago • 1 comments

Hi

with line 340 as : my $encoded = JSON::XS->new->allow_nonref(1)->utf8->pretty->encode($content);

it works: { "f5-fan-psu-stats:psu-stats": { "psu-current-in": "0.16", "psu-current-out": "2.8", "psu-voltage-in": "228.8", "psu-voltage-out": "12.0", "psu-temperature-1": "33.0", "psu-temperature-2": "29.0", "psu-temperature-3": "50.0", "psu-fan-1-speed": 9500 } } ======> returned JSON structure: { "f5-fan-psu-stats:psu-stats" : { "psu-temperature-3" : "50.0", "psu-fan-1-speed" : 9500, "psu-voltage-in" : "228.8", "psu-current-in" : "0.16", "psu-current-out" : "2.8", "psu-temperature-1" : "33.0", "psu-voltage-out" : "12.0", "psu-temperature-2" : "29.0" } } ======> variables http.tables.platformDetailsRequestEntries.[0].psu-voltage-out = 12.0 http.tables.platformDetailsRequestEntries.[0].psu-temperature-1 = 33.0 http.tables.platformDetailsRequestEntries.[0].psu-current-in = 0.16 http.tables.platformDetailsRequestEntries.[0].psu-current-out = 2.8 http.tables.platformDetailsRequestEntries.[0].psu-temperature-2 = 29.0 http.tables.platformDetailsRequestEntries.[0].psu-temperature-3 = 50.0 http.tables.platformDetailsRequestEntries.[0].psu-voltage-in = 228.8 http.tables.platformDetailsRequestEntries.[0].psu-fan-1-speed = 9500

with line 340 as : my $encoded = JSON::XS->new->utf8->pretty->encode($content);

i got error : UNKNOWN: hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at {{mypath}} line 340.

MohaLaD avatar Feb 27 '24 15:02 MohaLaD

You can use following patch: https://github.com/centreon/centreon-plugins/pull/4915

garnier-quentin avatar Mar 06 '24 15:03 garnier-quentin

Hello :)

This issue should had been resolved during the June release with the PR https://github.com/centreon/centreon-plugins/pull/5044 Feel free to re-open this issue if not.

lucie-dubrunfaut avatar Jul 09 '24 09:07 lucie-dubrunfaut