Page 1 of 1

Nagios 3 / Apache 2.4 - Clicking host link downloads a file

Posted: Mon Jul 13, 2015 12:24 pm
by rgee
We are running Nagios 3.2.3 on Apache 2.4, and I know the DefaultType directive has been removed. While testing out Nagios on Apache 2.4 on RHEL 5.x, clicking on the Current->Hosts link causes Chrome, FF, and IE browsers to download a status.cgi file instead of displaying the Hosts page. Has anyone else run into this type of issue? I've tried some ForceType directives without success.

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Mon Jul 13, 2015 1:22 pm
by abrist
Is the cgi executable?

Code: Select all

ls -la /usr/local/nagios/sbin

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Mon Jul 13, 2015 3:54 pm
by rgee
Yes, the Nagios sbin directory appears to be executable by everyone.

$ ls -la sbin
total 3312
drwxrwxr-x 2 group owner 4096 Oct 31 2012 ./
drwxrwxr-x 9 group owner 4096 Nov 1 2012 ../
-rwxrwxr-x 1 group owner 239312 Oct 31 2012 avail.cgi*
-rwxrwxr-x 1 group owner 244152 Oct 31 2012 cmd.cgi*
-rwxrwxr-x 1 group owner 210608 Oct 31 2012 config.cgi*
-rwxrwxr-x 1 group owner 255696 Oct 31 2012 extinfo.cgi*
-rwxrwxr-x 1 group owner 189096 Oct 31 2012 histogram.cgi*
-rwxrwxr-x 1 group owner 186288 Oct 31 2012 history.cgi*
-rwxrwxr-x 1 group owner 186032 Oct 31 2012 notifications.cgi*
-rwxrwxr-x 1 group owner 177904 Oct 31 2012 outages.cgi*
-rwxrwxr-x 1 group owner 182448 Oct 31 2012 showlog.cgi*
-rwxrwxr-x 1 group owner 244304 Oct 31 2012 status.cgi*
-rwxrwxr-x 1 group owner 185032 Oct 31 2012 statusmap.cgi*
-rwxrwxr-x 1 group owner 198352 Oct 31 2012 statuswml.cgi*
-rwxrwxr-x 1 group owner 182992 Oct 31 2012 statuswrl.cgi*
-rwxrwxr-x 1 group owner 206576 Oct 31 2012 summary.cgi*
-rwxrwxr-x 1 group owner 198384 Oct 31 2012 tac.cgi*
-rwxrwxr-x 1 group owner 193192 Oct 31 2012 trends.cgi*

However, Chrome's version of Firebug shows the following message when I click on the "host" link. It appears as if the browsers don't really know how to interpret this particular "host" link, but the other Nagios cgi links appear to function properly.

Resource interpreted as Document but transferred with MIME type application/octet-stream: "http://localhost:8881/nagios/cgi-bin/st ... hostdetail"

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Mon Jul 13, 2015 7:53 pm
by Box293
Should the results be the nagios instead of group/owner?

Code: Select all

ls -la /usr/local/nagios/sbin/
total 5148
drwxrwxr-x 2 nagios nagios   4096 Dec  5  2014 .
drwxr-xr-x 9 root   root     4096 Dec  5  2014 ..
-rwxrwxr-x 1 nagios nagios 320576 Dec  5  2014 archivejson.cgi
-rwxrwxr-x 1 nagios nagios 301880 Dec  5  2014 avail.cgi
-rwxrwxr-x 1 nagios nagios 300296 Dec  5  2014 cmd.cgi
-rwxrwxr-x 1 nagios nagios 273136 Dec  5  2014 config.cgi
-rwxrwxr-x 1 nagios nagios 314136 Dec  5  2014 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 265128 Dec  5  2014 histogram.cgi
-rwxrwxr-x 1 nagios nagios 244504 Dec  5  2014 history.cgi
-rwxrwxr-x 1 nagios nagios 244496 Dec  5  2014 notifications.cgi
-rwxrwxr-x 1 nagios nagios 318272 Dec  5  2014 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 236264 Dec  5  2014 outages.cgi
-rwxrwxr-x 1 nagios nagios 240376 Dec  5  2014 showlog.cgi
-rwxrwxr-x 1 nagios nagios 314160 Dec  5  2014 status.cgi
-rwxrwxr-x 1 nagios nagios 316416 Dec  5  2014 statusjson.cgi
-rwxrwxr-x 1 nagios nagios 261088 Dec  5  2014 statusmap.cgi
-rwxrwxr-x 1 nagios nagios 256816 Dec  5  2014 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 240400 Dec  5  2014 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 265024 Dec  5  2014 summary.cgi
-rwxrwxr-x 1 nagios nagios 252736 Dec  5  2014 tac.cgi
-rwxrwxr-x 1 nagios nagios 269224 Dec  5  2014 trends.cgi

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Tue Jul 14, 2015 3:19 pm
by rgee
The group owner was just me hiding the real user and groups.

I finally used IE and FF to view the Nagios Host link, and they were both able to properly display the Web Page without attempting to download the status.cgi file. I also found out the trends.cgi and histogram.cgi also did not work, because they were referring to a missing libtff.so.2 Free Type library. After the sysadmin added the 32-bit version of the libtff.so.2 library, the next error was due to the trends.cgi and histogram.cgi scripts referring to an outdated directory name. After the sysadmin added the gd-devel library, I recompiled Nagios from source, restarted Apache, and cleared out Chrome's browser cache and clicked on the Nagios Host link again. Sure enough, Chrome was finally able to properly display the Nagios Hosts Web Page instead of trying to download it.

I suspect Chrome's browser cache and the some incorrect setting for Nagios was causing the Hosts link (status.cgi) to be downloaded.

Thanks for everyone's suggestions.

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Tue Jul 14, 2015 3:30 pm
by rgee
I forgot to mention that I did uninstall and re-install Chrome to make sure everything was back to their original defaults.

Re: Nagios 3 / Apache 2.4 - Clicking host link downloads a f

Posted: Wed Jul 15, 2015 10:16 am
by jolson
Are we good to lock this thread and mark it as resolved? We appreciate you posting your solution back to the forums!