Hi,
I have some output that is killing the JSON when it has % signs, which seemed odd to me that percent signs alone would kill the JSON, so I decided to test it out and the output I'm getting is wildly inconsistent (but interesting). In the examples below, I see the output correctly in the HTML page (cgi-bin/extinfo.cgi). The first one is the example of when it works correctly.
Input:
Group Share% Use
JSON Output:
"Group Share% Use"
Input:
Group Share% Use% Share
JSON Output:
"Group Share% Use�����hare"
Input:
Group Share% Use% hare
JSON Output:
"Group Share% Use 0x0.000300000003p-1022re"
Input:
Group 90%
JSON Output:
""
Input:
Testing % sign
JSON Output:
"Testing `֞ign"
Any ideas? I'm using commit 6081644, but I had this problems with % signs when I was using 4.0.4 and 4.0.7 (the release from last week).
inconsistent output when using % signs
Re: inconsistent output when using % signs
I opened an issue on github: https://github.com/NagiosEnterprises/na ... e/issues/4
There is a chance that the % signs are not escaped correctly in the cgis. Eric[0] or Eric[1] should respond here or on github rather soon.
There is a chance that the % signs are not escaped correctly in the cgis. Eric[0] or Eric[1] should respond here or on github rather soon.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: inconsistent output when using % signs
Thanks again for reporting issues with the JSON CGI. Andy is correct that the percent signs were not being escaped. Commit 04c80dd appears to resolve this issue. I've tested each of the cases you listed and they now display correctly. Please test the commit and let us know whether it works for you.
Re: inconsistent output when using % signs
I tested it with the live data and everything shows up perfectly. Thank you!
a side note: a coworker suggested that I try the HTML code for percent signs: and that broke things even worse!, but this commit fixes that issue as well.
a side note: a coworker suggested that I try the HTML code for percent signs:
Code: Select all
%
Re: inconsistent output when using % signs
Thanks for the feedback! Closing up.
Former Nagios employee