Nagios 4.0.7 Segmentation fault, statusjson.cgi

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
syska
Posts: 3
Joined: Mon Sep 22, 2014 4:46 am

Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by syska »

Hi,

Just installed nagios 4.0.7 on a freebsd 10.0-RELEASE-p7 server. Web interface and checks is running fine.

Upgraded because I wanted to play with the statusjson.cgi etc. but it seems to fail.

I have no file called: jsonquery.php ... not sure is this is needed but the information could be helpful later.

When going to: /nagios/jsonquery.html I get a nice fine interface as shown here: http://labs.nagios.com/2014/06/19/explo ... -7-part-1/

When changing the select list ... I get a http 500 error. Explorer further it's because of a segmenation.

When running from the command line I get this:
[root@freebsd /usr/local/www/nagios/cgi-bin]# ./statusjson.cgi
Cache-Control: no-store
Pragma: no-cache
Last-Modified: Mon, 22 Sep 2014 09:58:04 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-type: application/json; charset=utf-8

Segmentation fault (core dumped)
[root@freebsd /usr/local/www/nagios/cgi-bin]#

After settings the REQUEST_METHOD & REMOTE_USER

Now I'm lost ... I know that something is wrong :-) But how do I debug from here?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by abrist »

There were a few escaping issues in the 4.0.7 cgis. Please upgarde to 4.0.8.
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.
syska
Posts: 3
Joined: Mon Sep 22, 2014 4:46 am

Re: Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by syska »

abrist wrote:There were a few escaping issues in the 4.0.7 cgis. Please upgarde to 4.0.8.
Thanks for the update.

I will give it a try when the freebsd ports maintainer updates the port to 4.0.8 ... hopefully it will happen soon.

Just happy that it's a generel issue and not just me :-)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by abrist »

Not just you. Eric[0] caught it fair soon after the 4.0.7 release.
From the 4.0.8 release notes (http://www.nagios.org/projects/nagiosco ... on-history):
Fixed segfault in archive JSON CGI when plugin output was empty (Eric Stanley)
Also, you may be glad to hear that the following was also performed in that same update:
Fixed escaping in JSON CGIs so all required characters are escaped, and in the correct order (Eric Stanley)
Cheers!
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.
syska
Posts: 3
Joined: Mon Sep 22, 2014 4:46 am

Re: Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by syska »

I was just in contact with the FreeBSD port maintainer ... 4.0.8 don't compile on FreeBSD(for some reason), so his waiting on the next release to give it another try.

But as long as the web part is working ... it's fine for now. Just really looking forward to the json part ... might try to create a Windows Phone App ... since the once available now it very bad.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios 4.0.7 Segmentation fault, statusjson.cgi

Post by abrist »

syska wrote:I was just in contact with the FreeBSD port maintainer ... 4.0.8 don't compile on FreeBSD(for some reason), so his waiting on the next release to give it another try.
He should open an issue on github for this. It is not our intention to slight the BSD community. But we need the report so we know it exists and have enough information to fix the issue. If you get a chance to reach out to the maintainer again, please mention the github issue tracker at:
https://github.com/NagiosEnterprises/nagioscore/issues
syska wrote:Just really looking forward to the json part
Yes. I have been playing with the cgis for a year and they are finally getting close to being bug free and comprehensive. The escaping patch was important. As was the newest commit that added support for service next_check (somehow it went unnoticed by us for a year!)
I have found angularjs to be a good framework for a snappy client. It also minimizes server load.
syska wrote:might try to create a Windows Phone App
Please do so! We would post it on the exchange so it could get some traction.
Cheers!
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.
Locked