munin-monitoring / munin

Main repository for munin master / node / plugins
http://munin-monitoring.org
Other
2k stars 474 forks source link

Comparison-{day|week|month|year}.html broken png link #901

Closed flob82 closed 5 years ago

flob82 commented 6 years ago

Hi

I'm using debian's stretch package (2.0.33-1), all works fine except the link in the subject when i'm using category like this [groupname1;groupname2;node] The png isn't showing because the generated link is /munin/groupname1/groupname1/groupname2/node/

When i'm using [groupname;node] all is ok.

Did i'm missing something or it's just a bug ?

Thanks

MKabe commented 6 years ago

Look like it's related to #524 I resolved my problem by changing templates for comparison of day/week/month/year with a different way to make the image path..

flob82 commented 6 years ago

thanks for this answer, on my side I just added a rule in nginx like

location ~ ^/munin/groupname1(/groupname1/.*.png)$ { try_files $uri /munin/$1; }

but your solution seems better ;)

sumpfralle commented 6 years ago

I just tried to reproduce this with v2.0.33 (Debian Stretch).

I defined multi-layered grouping for a host:

[level1;level2;foo]
    address foo
    use_node_name yes

When visiting the generated html page of this node (https://example.org/munin/level1/level2/foo/), I can see all graphs of the different plugins and I can click on each graph (leading to the day/week/month/year graphs). Clicking again on a graph properly shows the dynamic zoom interface.

I assume, that one of the things above fails for you? If yes: where exactly?

MKabe commented 6 years ago

In my case I have something like this configuration : [L1;L2;L3;L3.L2.L1.node1]

Where I have some nodes directly in level1, no nodes in level 2 and some nodes in level 3. Don't know if the problem is that I have no nodes in level 2 or that the name is constructed with group names. (Look like, but not sure, that the problem come when ../ are added to go up a few level)

I tried to check the code but I have some difficulty with Perl or how works the project

sumpfralle commented 6 years ago

Interesting!

I tried it now with the structure you proposed ([L1;L2;L3;L3.L2.L1.node]) on my Debian Stretch host (munin v2.0.33). I visited the following pages:

The graphs and links on all pages looked good to me.

Maybe you are missing slashes at the end of the URLs? Or maybe you are using an interesting webserver configuration? Or do you have other ideas what could cause the difference?

flob82 commented 6 years ago

Hello

To reproduce, just check munin/ and click on the link day, week, month or year near L2 or L3.

MKabe commented 6 years ago

Yeah, it's only concern day/week/.. pages

On level1 = All is ok, CIMGDAY var is like that "../L1/nodeA.L1/df-day.png" and the result path of image is ok (host/munin/L1/nodeA.L1/df-day.png). (Also R_PATH is ".." 1 level up that looks good)

On level 2, there is no day/week pages as I have no nodes in it

On level 3, it's here I have problem (=No images), CIMGDAY var is like that "../../L1/L2/L3/nodeB.L3.L2.L1/df.png" but I'm currently in this url : host/munin/L1/L2/L3/comparison-day.html, so CIMGDAY is missing a "../" to have a correct path. (Also R_PATH is "../../.." so 3 level up which is right but different of CIMGDAY)

The src of image is wrong (but the link based on r_path is good) and nginx say there is an error because xxx/munin/L1/L1/L2/L3/nodeB.L3.L2.L1/df.png doesn't exist. That's why I reconstructed the corrected path in templates using others variables instead of CIMGDAY

For information to know what's in variables, I simply add in templates some "debug info" like that

CImgDay :

Where name were found randomly in source (mostly HTMLConfig) as I didn't found a list of variable available for template.

And I use munin 2.0.33-1 from debian spackages with nginx

lemmy04 commented 5 years ago

I'm having a similar problem, munin is in /munin/ on my webserver, and all comparison pages omit the /munin/ part on urls for graph images.

Running 2.0.48 here.

sumpfralle commented 5 years ago

Could anyone share a link to a public munin instance with such a behavior? I would like to take a look at it ...

lemmy04 commented 5 years ago

here's mine: https://eregion.kicks-ass.net/munin/raspis/comparison-day.html

sumpfralle commented 5 years ago

@lemmy04: thank you!

I am quite sure, that this was introduced just in 2.0.48 - thus it is not the same issue, as the one described in this bug report. See #1187 for a few details.

sumpfralle commented 5 years ago

I am quite confident, that the problem is fixed in 633de82386f67c8108362a5bd2fc6331b402f1b1.

lemmy04 commented 5 years ago

I confirm fixed: https://eregion.kicks-ass.net/munin/raspis/comparison-day.html

by the way, just for fun: on https://eregion.kicks-ass.net/munin/raspis/flightpi.eregion.home/fr24.html you can see the effects of the "no commercial flights between 10pm and 6am in euope.