Links Broken after EPEL update to 4.2.4

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
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

I seem to be having an issue opposite to some that I found when searching the forums.

On Centos 7 and using the EPEL repo, I Updated from nagios-4.0.8-2.el7.x86_64 to 4.2.4-2.el7.x86_64 and now the links for trends and histogram are broken. All the other links seem to be working fine. All links worked prior to the update.

Example of links (spaces added for readability):
http:// nagios/nagios/cgi-bin/trends.html?host=somehost&service=someservice

http:// nagios/nagios/cgi-bin/histogram.html?host=somehost&service=someservice

I get the error message: The requested URL /nagios/cgi-bin/trends.html was not found on this server.

Which makes sense because those html files are not in the cgi-bin directory, they are in the html directory.

Did I just not search the forums hard enough? Can anyone point me in the right direction to resolve this?

Any help would be appreciated. Thanks.
Last edited by dwhitfield on Thu Mar 02, 2017 10:43 am, edited 1 time in total.
Reason: marking with green check mark
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Links Broken after EPEL update to 4.2.4

Post by tgriep »

Those links are defined in a file called side.php and I would guess that the upgrade did overwrite that file correctly and that is the cause of the broken links.

Here is a snippet from the side.php file to compare your version to.

Code: Select all

<ul class="navsectionlinks">
                        <li><a href="<?php echo $cfg["cgi_base_url"];?>/avail.cgi" target="<?php echo $link_target;?>">Availability</a></li>
                        <li>
                                <a href="trends.html" target="<?php echo $link_target;?>">Trends</a>
                                <a href="<?php echo $cfg["cgi_base_url"];?>/trends.cgi" target="<?php echo $link_target;?>">(Legacy)</a>
                        </li>
                        <li><a href="<?php echo $cfg["cgi_base_url"];?>/history.cgi?host=all" target="<?php echo $link_target;?>">Alerts</a>
                        <ul>
                                <li><a href="<?php echo $cfg["cgi_base_url"];?>/history.cgi?host=all" target="<?php echo $link_target;?>">History</a></li>
                                <li><a href="<?php echo $cfg["cgi_base_url"];?>/summary.cgi" target="<?php echo $link_target;?>">Summary</a></li>
                                <li>
                                        <a href="histogram.html" target="<?php echo $link_target;?>">Histogram</a>
                                        <a href="<?php echo $cfg["cgi_base_url"];?>/histogram.cgi" target="<?php echo $link_target;?>">(Legacy)</a>
                                </li>
                        </ul>
                        </li>
                        <li><a href="<?php echo $cfg["cgi_base_url"];?>/notifications.cgi?contact=all" target="<?php echo $link_target;?>">Notifications</a></li>
                        <li><a href="<?php echo $cfg["cgi_base_url"];?>/showlog.cgi" target="<?php echo $link_target;?>">Event Log</a></li>
                </ul>
These are the 2 lines that control those links. Take a look at then and edit then if needed.

Code: Select all

<a href="trends.html" target="<?php echo $link_target;?>">Trends</a>
<a href="histogram.html" target="<?php echo $link_target;?>">Histogram</a>
Be sure to check out our Knowledgebase for helpful articles and solutions!
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Re: Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

The date stamp on side.php matches the date the update was done and the code matches what you have exactly.

I realize side.php is for the menu on the left. Those links are working. The links in question are the trends and histogram links in the top left corner of a service screen.
service.png
The httpd error log shows this:

Code: Select all

[Wed Mar 01 06:55:06.633426 2017] [cgi:error] script not found or unable to stat: /usr/lib64/nagios/cgi-bin/trends.html, referer: http://nagios/nagios/cgi-bin//extinfo.cgi?type=2&host=somehost&service=someservice
With those links, it is looking for the html in the cgi-bin instead of the html directory where they are.

To further confuse me, if I inspect the linkbox with Chrome developer tools, the urls are reflected properly: "../trends.html?host=somehost&service=someservice" I can even copy them from developer tools and paste into the browser and it works as expected. So, is this an httpd issue? The browser is not following the parent url "../" and moving back one directory.

I can clearly see what's going on, I just don't know why and it's driving me headsmashingly nuts.
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Re: Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

...and if I edit the url in developer tools to add and additional ../ to the beginning, the links works as expected. so, for some reason on my installation, to work properly it needs to be

Code: Select all

../../trends.html?host=somehost&service=someservice
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Links Broken after EPEL update to 4.2.4

Post by tgriep »

I wonder if one of the CGI scripts didn't get updated, can you check the following folder and see if they were all updated?

Code: Select all

/usr/lib64/nagios/cgi-bin/
Be sure to check out our Knowledgebase for helpful articles and solutions!
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Re: Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

Code: Select all

# ll /usr/lib64/nagios/cgi-bin/
total 5500
-rwxrwxr-x 1 nagios nagios 351840 Feb  7 17:36 archivejson.cgi
-rwxrwxr-x 1 nagios nagios 319824 Feb  7 17:36 avail.cgi
-rwxrwxr-x 1 nagios nagios 313776 Feb  7 17:36 cmd.cgi
-rwxrwxr-x 1 nagios nagios 290840 Feb  7 17:36 config.cgi
-rwxrwxr-x 1 nagios nagios 331768 Feb  7 17:36 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 282600 Feb  7 17:36 histogram.cgi
-rwxrwxr-x 1 nagios nagios 257896 Feb  7 17:36 history.cgi
-rwxrwxr-x 1 nagios nagios 257872 Feb  7 17:36 notifications.cgi
-rwxrwxr-x 1 nagios nagios 353384 Feb  7 17:36 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 249752 Feb  7 17:36 outages.cgi
-rwxrwxr-x 1 nagios nagios 253768 Feb  7 17:36 showlog.cgi
-rwxrwxr-x 1 nagios nagios 336112 Feb  7 17:36 status.cgi
-rwxrwxr-x 1 nagios nagios 351128 Feb  7 17:36 statusjson.cgi
-rwxrwxr-x 1 nagios nagios 278864 Feb  7 17:36 statusmap.cgi
-rwxrwxr-x 1 nagios nagios 274472 Feb  7 17:36 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 258032 Feb  7 17:36 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 278664 Feb  7 17:36 summary.cgi
-rwxrwxr-x 1 nagios nagios 270320 Feb  7 17:36 tac.cgi
-rwxrwxr-x 1 nagios nagios 286792 Feb  7 17:36 trends.cgi
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Links Broken after EPEL update to 4.2.4

Post by tgriep »

I was able to replicate the broken links in the Service Information and the Host Information menus and I filed a bug report at the Redhat Bugzilla site for you.
https://bugzilla.redhat.com/show_bug.cgi?id=1428111
Be sure to check out our Knowledgebase for helpful articles and solutions!
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Re: Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

Awesome, thank you. I will stop pulling my hair out now.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Links Broken after EPEL update to 4.2.4

Post by tgriep »

Your Welcome. Shall I mark this post as solved and lock it up for you?
Be sure to check out our Knowledgebase for helpful articles and solutions!
MKEbrew
Posts: 13
Joined: Mon Apr 07, 2014 10:11 am

Re: Links Broken after EPEL update to 4.2.4

Post by MKEbrew »

Yep. Thanks again.
Locked