Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of uninitialized value $output_value in concatenation (.) or string at check_json.pl line 252 #30

Open
alexandruvilceloiu opened this issue Jul 3, 2017 · 4 comments

Comments

@alexandruvilceloiu
Copy link

When having multiple records like:

{
"from": "0.050",
"error": false,
"test": {
"test01": {
"alive": true,
"value": 147.43,
"rate_below_threshold": false,
"last_time": "Mon, 03 Jul 2017 11:31:46 GMT"
}
}
}

I got empty response for value ('{test}->{test01}->{value}')
e.g.:
/usr/lib64/nagios/plugins/check_json.pl --url "https://example.com/test.json" --attribute '{test}->{test01}->{value}' --warning 140: --critical 110: --perfvars '{test}->{test01}->{value}' --outputvars '{test}->{test01}->{value}'
Use of uninitialized value $output_value in concatenation (.) or string at /usr/lib64/nagios/plugins/check_json.pl line 252.

And no value returned..

@Marcus-Raphael-Schuel
Copy link

I have the same problem.


XYZ@icinga:~# /omd/sites/PVM/local/lib/icinga/plugins/check_json.pl --url http://ABC.int.XYZ.de/solar_api/v1/GetPowerFlowRealtimeData.fcgi --attribute '{Body}->{Data}->{Inverters}->{1}->{SOC}' --warning 2: --critical 1: --perfvars * -o '{Body}->{Data}->{Inverters}->{1}->{SOC}'

Use of uninitialized value $output_value in concatenation (.) or string at /omd/sites/PVM/local/lib/icinga/plugins/check_json.pl line 252.

Check JSON status API OK - SOC:


expected result:
Check JSON status API OK - SOC:3


file GetPowerFlowRealtimeData.fcgi contains:
{
"Body" : {
"Data" : {
"Inverters" : {
"1" : {
"Battery_Mode" : "nearly depleted",
"DT" : 99,
"E_Day" : 750.20001220703125,
"E_Total" : 7241021.5,
"E_Year" : 248388,
"P" : 108,
"SOC" : 3
}
...

@pswired
Copy link

pswired commented Apr 23, 2019

I have the same problem.

@danja95
Copy link

danja95 commented Nov 25, 2019

Having same issue, when value is not with '' or ""

e.g.: "value1": 0, <- not ok
e.g.: "value1": "0", <- ok

can please somebody fix this?

@danja95
Copy link

danja95 commented Nov 25, 2019

this commit fixed my problem! e73d74a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants