Bad Stylesheet Links
Laack,Jacob C
JLaack at alegent.org
Mon Mar 17 19:02:34 CET 2008
I've found what might be the area of intrigue. This code is in the cgi/cgiutils.c file of the 3.0 source:
else if(!strcmp(var,"url_html_path")){
strncpy(url_html_path,val,sizeof(url_html_path));
url_html_path[sizeof(url_html_path)-1]='\x0';
strip(url_html_path);
if(url_html_path[strlen(url_html_path)-1]!='/' && (strlen(url_html_path) < sizeof(url_html_path)-1))
strcat(url_html_path,"/");
...
snprintf(url_stylesheets_path,sizeof(url_stylesheets_path),"%sstylesheets/",url_html_path);
url_stylesheets_path[sizeof(url_stylesheets_path)-1]='\x0';
I believe this is where the path to the stylesheets and images originates. Here's the same area in the 2.9 source:
else if(strstr(input,"url_html_path=")==input){
temp_buffer=strtok(input,"=");
temp_buffer=strtok(NULL,"\n");
strncpy(url_html_path,(temp_buffer==NULL)?"":temp_buffer,sizeof(url_html_path));
url_html_path[sizeof(url_html_path)-1]='\x0';
strip(url_html_path);
if(url_html_path[strlen(url_html_path)-1]!='/' && (strlen(url_html_path) < sizeof(url_html_path)-1))
strcat(url_html_path,"/");
...
snprintf(url_stylesheets_path,sizeof(url_stylesheets_path),"%sstylesheets/",url_html_path);
url_stylesheets_path[sizeof(url_stylesheets_path)-1]='\x0';
It would seem the steps to determine the url_html_path have changed. I've found that this post...
http://article.gmane.org/gmane.network.nagios.user/48457/
...which suggests this has been a problem for others (should have looked before I posted...for shame). Any idea why the first doesn't work and the second does?
From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Laack,Jacob C
Sent: Monday, March 17, 2008 12:25 PM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Bad Stylesheet Links
I've noticed that several other paths are "bad" as well. The img tags on the Service Detail page are written with 'up.gif' rather than '/images/up.gif'.
From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Laack,Jacob C
Sent: Monday, March 17, 2008 12:11 PM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Bad Stylesheet Links
I did the same compile and setup on my Fedora laptop and the stylesheet links on this machine do this...
<LINK REL='stylesheet' TYPE='text/css' HREF='/nagios/stylesheets/common.css'>
<LINK REL='stylesheet' TYPE='text/css' HREF='/nagios/stylesheets/tac.css'>
...How does the configure/make/install/config determine the stylesheet directory (url_stylesheets_path)? How can I get it to work properly/better again?
From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Laack,Jacob C
Sent: Monday, March 17, 2008 10:51 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] (no subject)
All-
I've compiled nagios 3.0 on my RHEL 5 64-bit machine. I have the daemon compiled...
./configure \
--prefix=/usr/local/nagios \
--with-cgiurl=/cgi-bin \
--with-htmurl= \
--with-nagios-user=nagios \
--with-nagios-group=nagios \
--with-command-group=nagioscmd \
--enable-embedded-perl \
--with-perlcache
...and running with the sample configs. I have configured my apache Virtual Server myself like so...
<Directory "/usr/local/nagios/share">
RewriteEngine off
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin root at nagios.alegent.org
DocumentRoot /usr/local/nagios/share
ServerName nagiosnew.alegent.org
ErrorLog logs/nagios_log
CustomLog logs/nagios_log common
ScriptAlias /cgi-bin/ "/usr/local/nagios/sbin/"
</VirtualHost>
...I can access the page fine and the CGIs work as well. However, all the pages generated by the CGIs have this in their head...
<LINK REL='stylesheet' TYPE='text/css' HREF='common.css'>
<LINK REL='stylesheet' TYPE='text/css' HREF='tac.css'>
..which is making them all appear rather ugly. Is there an option to specify the stylesheet URL? Did I do something else wrong? Thanks.
Jake Laack
Alegent Health, Open Systems Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080317/608e0e47/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list