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

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
rgee
Posts: 4
Joined: Mon Jul 13, 2015 12:14 pm

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

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Is the cgi executable?

Code: Select all

ls -la /usr/local/nagios/sbin
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.
rgee
Posts: 4
Joined: Mon Jul 13, 2015 12:14 pm

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

Post 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"
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rgee
Posts: 4
Joined: Mon Jul 13, 2015 12:14 pm

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

Post 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.
rgee
Posts: 4
Joined: Mon Jul 13, 2015 12:14 pm

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

Post by rgee »

I forgot to mention that I did uninstall and re-install Chrome to make sure everything was back to their original defaults.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post by jolson »

Are we good to lock this thread and mark it as resolved? We appreciate you posting your solution back to the forums!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked