Weathermap Editor 0.9 Problem

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

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

Post by Howie »

iharvey wrote:Yes - that is what I meant to

I put a # before ImageAlphaBlending($image, true);

to make it read:

#ImageAlphaBlending($image, true);

and the problem remained. (I did not restart any services or reboot)
Sounds like it's something else then. What happens if you run the command-line weathermap? (php weathermap --config yourconfigfile.conf)

Do you get any more useful error message?

Basically PHP (or any script interpreter) should never ever segfault, so one way or another this is PHP. The two ways I know that weathermap behaves this way are memory_limit (so php deliberately dies) and this gd issue (so it's a bug outside of weathermap). Maybe there's something else going on.

If you try one of the example configs (either weathermap.conf or example.conf), do you get any further?
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!)
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

Hi again. I have tried a few upgrades (PHP from 4.3.10-19 to 5.2.0-8+etch1 and Apache from 1.3.33 to 2.2.3), my setup is now:
Cacti Version - 0.8.6i
Plugin Architecture - 1.1
Poller Type - CMD.php
Server Info - Linux 2.6.8-3-386
Web Server - Apache/2.2.3 (Debian) PHP/5.2.0-8+etch1
PHP - 5.2.0-8+etch1
PHP Extensions - zip, xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, SimpleXML, sockets, soap, SPL, shmop, standard, Reflection, posix, mime_magic, mbstring, json, iconv, hash, gettext, ftp, filter, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, mysql, gd, mysqli, PDO, pdo_mysql, snmp
MySQL - 4.0.24_Debian-10sarge2-log
RRDTool - 1.2.12
SNMP - 5.1.2
Plugins
  • Update Checker (update - v0.3)
    Host Info (hostinfo - v0.1)
    PHP Network Weathermap (weathermap - v0.9)
However the problems remain (e.g. adding a node using the editor, and maps not apearing under the Weathermap tab in Cacti)

(/var/log/apache2/error.log reports: ...........Segmentation Fault (11))

I have tried the test you suggested previously for my file called 'wan.conf' :

TESTNMS:/var/www/cacti/plugins/weathermap# php weathermap --config wan.conf


Warning: require_once(Console/Getopt.php): failed to open stream: No such file or directory in /var/www/cacti/plugins/weathermap/weathermap on line 9

Fatal error: require_once(): Failed opening required 'Console/Getopt.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/cacti/plugins/weathermap/weathermap on line 9
TESTNMS:/var/www/cacti/plugins/weathermap#
TESTNMS:/var/www/cacti/plugins/weathermap#
TESTNMS:/var/www/cacti/plugins/weathermap#

I had a quick look, but thought it would make more sense to you?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

iharvey wrote: TESTNMS:/var/www/cacti/plugins/weathermap# php weathermap --config wan.conf


Warning: require_once(Console/Getopt.php): failed to open stream: No such file or directory in /var/www/cacti/plugins/weathermap/weathermap on line 9

Fatal error: require_once(): Failed opening required 'Console/Getopt.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/cacti/plugins/weathermap/weathermap on line 9
TESTNMS:/var/www/cacti/plugins/weathermap#
TESTNMS:/var/www/cacti/plugins/weathermap#
TESTNMS:/var/www/cacti/plugins/weathermap#

I had a quick look, but thought it would make more sense to you?
Oh... the command-line version requires a PEAR module called Console_Getopt. It comes with the default PEAR install, as far as I recall, so it should just be a case of installing PEAR. I would guess the package is called php5-pear on debian. If for some wierd debianish reason, it still doesn't work after that, you would run pear install Console_Getopt to install that module.

PEAR modules are the PHP standard libraries, a bit like CPAN for perl or Gems for ruby, if you are familiar with any of those.
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!)
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

php-pear installed - looks like it fixed that particular problem.

I have extracted a fresh ver0.90 weathermap into the plugins directory - changed permissions to 777 and tried the php weathermap --config test again on simple.conf:

TESTNMS:/var/www/cacti/plugins/weathermap# php weathermap --config ./configs/simple.conf

Unrecognised config on line 8: KEYPOS DEFAULT -1 -1 Traffic Load
Segmentation fault

I copied example.conf to the configs directory and tried the test
TESTNMS:/var/www/cacti/plugins/weathermap# php weathermap --config ./configs/example.conf

Failed to load ttf font VeraIt - at config line 19
Segmentation fault
TESTNMS:/var/www/cacti/plugins/weathermap#

(example.conf did open a new web page with the edit options: Change File, Add node, etc, but no diagram to edit
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

...but if I click on Change File - it does not do anything
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Segmentation fault problem

Post by submarine »

Hi all. I've tried to replace the faulty function in Weathermap.class.php :

$nothing=imagecolorallocatealpha($node_im,128,0,0,127);

by this one :

$nothing=imagecolorallocate($node_im, 255, 0, 0);

And it works : no more segmentation fault ! :D
I Hope this help. Hi to ZeBoy if he's reading this. ;-)
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

Cor! - That looks good......I'll check some more
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

That is working, many thanks all for your help. :D
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

iharvey wrote:That is working, many thanks all for your help. :D
Ah cool. Thanks submarine... :-)

Does it still work OK with transparent PNG icons and the like?
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!)
iharvey
Posts: 42
Joined: Wed Nov 01, 2006 6:10 am

Post by iharvey »

Does it still work OK with transparent PNG icons and the like?

No - I get a RED background to the icon, is it fixable?

(besides that it is BRILLIANT!)
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Segmentation fault

Post by submarine »

The function imagecolorallocatealpha behaves identically to imagecolorallocate() with the addition of the transparency parameter alpha.
So, once you use the imagecolorallocate function, there's no more transparency, sorry. :(
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

iharvey wrote:Does it still work OK with transparent PNG icons and the like?

No - I get a RED background to the icon, is it fixable?
Yes, by using the alpha channel, which is borken in your GD library :roll:

Ah, never mind.
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!)
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Sementation fault and transparency

Post by submarine »

It seems I've resolved the problem here. I've replaced the following lines (in the original source code) in Weathermap.class.php :

Code: Select all

$nothing=imagecolorallocatealpha($node_im, 128, 0, 0,127);
imagefill($node_im, 0, 0, $nothing);
by this one to enable transparency :

Code: Select all

$nothing=imagecolorallocate($node_im, 128, 0, 0);
imagefill($node_im, 0, 0, $nothing);
imagecolortransparent($node_im, $nothing);
It works for me ! :D
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Sementation fault and transparency

Post by Howie »

submarine wrote:It seems I've resolved the problem here. I've replaced the following lines (in the original source code) in Weathermap.class.php :

Code: Select all

$nothing=imagecolorallocatealpha($node_im, 128, 0, 0,127);
imagefill($node_im, 0, 0, $nothing);
by this one to enable transparency :

Code: Select all

$nothing=imagecolorallocate($node_im, 128, 0, 0);
imagefill($node_im, 0, 0, $nothing);
imagecolortransparent($node_im, $nothing);
It works for me ! :D
So that will work unless that half-red appears in your icon or scale, I guess. maybe some kind of switch is in order here... SET gd_workaround 1 kind of thing.
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!)
submarine
Posts: 6
Joined: Wed May 02, 2007 9:42 am

Post by submarine »

One could replace the half-red color by magenta :

Code: Select all

$nothing=imagecolorallocate($node_im, 255, 0, 255); 
I doubt there are a lot of images/icons using that one. :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests