Cannot show map image under WeatherMap plugin or Editor

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
langnao
Posts: 3
Joined: Tue Mar 16, 2010 7:49 am

Cannot show map image under WeatherMap plugin or Editor

Post by langnao »

Hi,

I have weathermap 0.97a plugin installed on cacti 0.87e.

Followed the installation steps as per instructed. Run check.php both on cli and using webbrower and everything returned fine.

The polling works fine and the png and html were created successfully. However, the image is not accessible under weathermap plugin. Even the editor is not showing any image. Direct access of the png image works (as shown by the attached image).
Attachments
error01.jpg
error01.jpg (38.44 KiB) Viewed 7864 times
error02.jpg
error02.jpg (45.18 KiB) Viewed 7864 times
image_link.jpg
image_link.jpg (35.86 KiB) Viewed 7864 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

What does the httpd error_log say?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
langnao
Posts: 3
Joined: Tue Mar 16, 2010 7:49 am

Post by langnao »

Howie wrote:What does the httpd error_log say?
Nothing, no error.

For the 'Map Style' tab under Editor, the Sample of defined fonts not drawn too. Suspected the 'GD' thingy but double check that it is fine (support all features).

Running on RHEL5.4
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

OK, every now and then I get a bug report from someone about loading images from php. So the files are written OK, but the code that loads the images and streams them to the browser isn't right.

However, it doesn't seem to be universal - I use CentOS 5.4 here, and have no problem, for example, so you should be OK.

Look for the lines in editor.php that say:
header("Content-type: image/png");
and replace with:
header('Content-type: image/png');
ob_clean();
flush();
and see if that helps.

If it does, there are two similar places in weathermap-cacti-plugin.php that need the same change.

The odd part is that sometimes this change *causes* the problem... :roll:
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
langnao
Posts: 3
Joined: Tue Mar 16, 2010 7:49 am

Post by langnao »

Howie wrote:OK, every now and then I get a bug report from someone about loading images from php. So the files are written OK, but the code that loads the images and streams them to the browser isn't right.

However, it doesn't seem to be universal - I use CentOS 5.4 here, and have no problem, for example, so you should be OK.

Look for the lines in editor.php that say:
header("Content-type: image/png");
and replace with:
header('Content-type: image/png');
ob_clean();
flush();
and see if that helps.

If it does, there are two similar places in weathermap-cacti-plugin.php that need the same change.

The odd part is that sometimes this change *causes* the problem... :roll:
Yes, it works!

Thanks. You save me from many more days of frustration ... :P
gjames
Posts: 17
Joined: Fri Aug 24, 2007 1:10 pm

Fix didnt work for me.

Post by gjames »

I tried the above fix and it didnt work for me.
I still get the same screens as the others.

Any help would be appreciated.
Also using
Cacti Version 0.8.7e
Cacti OS unix
Weathermap 0.97a editor
RHEL

Thanks
gjames
Posts: 17
Joined: Fri Aug 24, 2007 1:10 pm

Works with .87e

Post by gjames »

I went back to weathermap .87e and the above fix worked.

Thanks
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

There isn't a 0.87e... which version are you using now?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
gjames
Posts: 17
Joined: Fri Aug 24, 2007 1:10 pm

Still have a problem

Post by gjames »

Actually it only partially fixed the problem.
The editor worked but I still get the broken image icon when I try to view the weathermaps. The png files are fine but the html in the output directory wont display.
No error in httpd.log or cacti.log.

Thanks

Cacti Version 0.8.7e
Cacti OS unix RHEL
SNMP Version NET-SNMP version: 5.3.2.2
RRDTool Version RRDTool 1.2.x

PHP Weathermap version 0.97a
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

The HTML in the output folder won't work if you just open it in a browser, that is correct. It's intended to be included from within the Cacti plugin, so the path to the image would be wrong if you just open that html file in a browser.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
gjames
Posts: 17
Joined: Fri Aug 24, 2007 1:10 pm

My Mistake

Post by gjames »

I dint realize there were 2 places to make the change above.
It appears the editors works now.
I'll see about the broken link icons.

THANKS :D
martinhem
Posts: 7
Joined: Wed Apr 20, 2011 10:08 am

Re: Cannot show map image under WeatherMap plugin or Editor

Post by martinhem »

Hello, I did changes on editor.php and weathermap-cacti-plugin.php but im still getting the same error.
Only solved "Font Samples" with this fix.

I tried 096a and 097 with cacti 0.8.7g.

2.6.32-23-server #37-Ubuntu SMP Fri Jun 11 09:11:11 UTC 2010 x86_64 GNU/Linux

Thanks
Leddy
Cacti User
Posts: 93
Joined: Sun May 15, 2005 6:55 pm

Re:

Post by Leddy »

Howie wrote:OK, every now and then I get a bug report from someone about loading images from php. So the files are written OK, but the code that loads the images and streams them to the browser isn't right.

However, it doesn't seem to be universal - I use CentOS 5.4 here, and have no problem, for example, so you should be OK.

Look for the lines in editor.php that say:
header("Content-type: image/png");
and replace with:
header('Content-type: image/png');
ob_clean();
flush();
and see if that helps.

If it does, there are two similar places in weathermap-cacti-plugin.php that need the same change.

The odd part is that sometimes this change *causes* the problem... :roll:
This resolved our problem on Server 2008 R2.

FYI you need to edit editor.php and weathermap-cacti-plugin.php
Each file has 2 entries that need to be modified.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests