Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Weathermap upgrade to 095b - no maps visible anymore
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2167
Location: United Kingdom

PostPosted: Thu Sep 04, 2008 7:10 am    Post subject: Reply with quote

OK, that could be something weird like ASCII-conversion moving from windows->unix or unix->windows adding in some extra line-endings somewhere. Maybe.

Or possibly some leading or trailing spaces in Weathermap.class.php?

It would be worth checking if the editor html page has two blanks at the top, too, which would point to Weathermap.class.php, as that's included very early in both those situations.
Back to top
just-me



Joined: 15 Nov 2008
Posts: 3

PostPosted: Sat Nov 15, 2008 11:14 am    Post subject: Reply with quote

I think I have same problem!

cacti-0.8.7b.2_2 from FreeBSD ports
Weather map plugin 0.95b

I tried install weather map over existing installation. There was no previous version of weather map before (so no previous files etc)

I do not see images if I click on weather map tab. I see red X if I enter in browser path (I ommit server name in example) to
/cacti/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=ef87df206741ed91254b&time=1226760447

but if I enter path /cacti/plugins/weathermap/output/ef87df206741ed91254b.png I can see the picture.
I entered some debugging into weathermap-cacti-plugin.php and check which file It tried to open and read. The path is correct, exist and readable by web user (also it same file as in second link).

if I do a tcpdump of traffic I got from web server I see a small differences (first example from php script, second called file directly):
Code:

        0x0210:  6e6e 6563 7469 6f6e 3a20 4b65 6570 2d41  nnection:.Keep-A
        0x0220:  6c69 7665 0d0a 5472 616e 7366 6572 2d45  live..Transfer-E
        0x0230:  6e63 6f64 696e 673a 2063 6875 6e6b 6564  ncoding:.chunked
        0x0240:  0d0a 436f 6e74 656e 742d 5479 7065 3a20  ..Content-Type:.
        0x0250:  696d 6167 652f 706e 670d 0a0d 0a36 3634  image/png....664
        0x0260:  6439 0d0a 0a89 504e 470d 0a1a 0a00 0000  d9....PNG.......
        0x0270:  0d49 4844 5200 0003 b600 0002 7108 0200  .IHDR.......q...


Code:

        0x01a0:  6976 653a 2074 696d 656f 7574 3d31 352c  ive:.timeout=15,
        0x01b0:  206d 6178 3d31 3030 0d0a 436f 6e6e 6563  .max=100..Connec
        0x01c0:  7469 6f6e 3a20 4b65 6570 2d41 6c69 7665  tion:.Keep-Alive
        0x01d0:  0d0a 436f 6e74 656e 742d 5479 7065 3a20  ..Content-Type:.
        0x01e0:  696d 6167 652f 706e 670d 0a0d 0a89 504e  image/png.....PN
        0x01f0:  470d 0a1a 0a00 0000 0d49 4844 5200 0003  G........IHDR...
        0x0200:  b600 0002 7108 0200 0000 f902 b977 0000  ....q........w..
        0x0210:  2000 4944 4154 789c ecbd 5dac 6dc7 552e  ..IDATx...].m.U.


I see extra extra bytes before actual PNG header sent
36 3634 6439 0d0a 0a
No ideas where the are come from do not see any problem at read file code....
Back to top
just-me



Joined: 15 Nov 2008
Posts: 3

PostPosted: Mon Nov 24, 2008 10:37 am    Post subject: Reply with quote

I just add
Code:

                        ob_end_clean ();


after

Code:

                        header('Content-type: image/png');


in the cacti/plugins/weathermap/weathermap-cacti-plugin.php



and now it works fine!
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2167
Location: United Kingdom

PostPosted: Mon Nov 24, 2008 10:46 am    Post subject: Reply with quote

That's weird... I don't even use output buffering! I'll try the same on my test servers, and see if there are any ill effects.
Back to top
just-me



Joined: 15 Nov 2008
Posts: 3

PostPosted: Mon Nov 24, 2008 11:31 am    Post subject: Reply with quote

and same for cacti/plugins/weathermap/editor.php

I get it from cacti/graph_image.php
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group