zabbix icon indicating copy to clipboard operation
zabbix copied to clipboard

Zabbix latest data shows jq parse error like below

Open hxr918 opened this issue 5 years ago • 11 comments

Zabbix Web Latest data items shows the jq parse error like below: parse error: Invalid numeric literal at line 1, column 31337

but no this error when i execute the mongodb.sh script on the mongo server.

please help me out.

hxr918 avatar Mar 08 '19 04:03 hxr918

Getting below error while executing mongodb.sh jq: error: Invalid numeric literal at EOF at line 1, column 7 (while parsing '.27017.') at , line 1: .localhost.27017.admin jq: error: syntax error, unexpected LITERAL, expecting $end (Unix shell quoting issues?) at , line 1: .localhost.27017.admin jq: 2 compile errors

manjeetlakra avatar Mar 09 '19 08:03 manjeetlakra

Please correct it.

manjeetlakra avatar Mar 09 '19 08:03 manjeetlakra

add 2>/dev/null to line 60 of mongodb.sh to fix this problem.

value=$(echo $output | jq $index 2>/dev/null)

I've requested merge request for this.

mrtzgh avatar Mar 09 '19 09:03 mrtzgh

Thanks for quick response but after adding 2>/dev/null in script zabbix item says Value "" type of "string" not suitable for value type "Numeric (unsigned)"

Please let us know how will it resolve.

manjeetlakra avatar Mar 09 '19 09:03 manjeetlakra

Hi , Jq should have these values to work:- jq '.localhost."27017".admin'

manjeetlakra avatar Mar 09 '19 10:03 manjeetlakra

Can you help ?

manjeetlakra avatar Mar 11 '19 10:03 manjeetlakra

Hi manjeetlakra, the fix I proposed was for this error : "parse error: Invalid numeric literal at line 1, column 31337". for your case, you can add "echo $output" to end of the script and run it manually and check the output.

mrtzgh avatar Mar 11 '19 10:03 mrtzgh

Your fix is working on command line but in zabbix dashboard it is showing Value "" type of "string" not suitable for value type "Numeric (unsigned)" due to which graphs are not coming. Can you tell me how will this resolve.

manjeetlakra avatar Mar 11 '19 11:03 manjeetlakra

Sorry your fix is working. Thanks for support. Appreciated.

manjeetlakra avatar Mar 11 '19 11:03 manjeetlakra

add 2>/dev/null to line 60 of mongodb.sh to fix this problem.

value=$(echo $output | jq $index 2>/dev/null)

I've requested merge request for this.

yes, it is resolved as your suggestion. Thanks a lot

hxr918 avatar Mar 18 '19 04:03 hxr918

Sorry your fix is working. Thanks for support. Appreciated.

I have added above line to mongodb.sh script but still some item showing same error. Could you please suggest the fix?

vyankatesh22 avatar Dec 27 '21 06:12 vyankatesh22