network map

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Guest

Post by Guest »

The arrows are showing "1%" all the time!
What am I doing wrong?
madjeff
Posts: 11
Joined: Mon Feb 09, 2004 2:19 pm

Post by madjeff »

Anonymous wrote:The arrows are showing "1%" all the time!
What am I doing wrong?
Are your wea*.html files getting updated?
madjeff
Posts: 11
Joined: Mon Feb 09, 2004 2:19 pm

Post by madjeff »

So, is anyone else having trouble getting the script to run in cron, or is it just me? :lol:
Guest

Post by Guest »

madjeff wrote:
Anonymous wrote:The arrows are showing "1%" all the time!
What am I doing wrong?
Are your wea*.html files getting updated?
Well, no, but I changed the values in the html file 'by hand', so this shouldnt be the problem..
Guest

Post by Guest »

I got 104 rrd-files in my /rra dir, but the script posted by David R. only makes 57 .html files. Anyone know why?
Rossco
Cacti User
Posts: 76
Joined: Sat Jan 15, 2005 4:52 pm
Location: London, England

Post by Rossco »

Hi

I've tried running cacti2weathermap.pl and the weathermap.pl scripts and have the html files generated, however my .png file appears broken. I cant open it.

I'm running windows 2000 and cacti 0.8.6c No perl errors, so I'm a little confused. Is this a basic windows/linux compatibility thing? Do I need to do something imaginative with GD?

Any thoughts greatfully received.

Cheers

Ross
jas0420
Cacti User
Posts: 91
Joined: Thu Jan 13, 2005 3:58 pm
Location: College Station, TX - USA

Post by jas0420 »

I'm in the exact same boat as Rossco... Win2K, 0.8.6c, HTML's generated fine, no Perl errors... It creates a .png output file that won't open. The output file is oddly 11k smaller than the original, so it's evidently not completing the file.

Can't seem to get the -v debug switch to display anything more than "Network Wearthermap v1.1.1 - http://netmon.grnet.gr/weathermap/"

Was just trying to start simple with two sites and one link. I can paste the HTTP TARGET link to the data file into a browser and it comes up fine (and has in & out data like it should).

My weathermap.conf file:
BACKGROUND us.png

KEYPOS 1 520

# low high red green blue
SCALE 1 10 140 0 255
SCALE 10 25 32 32 255
SCALE 25 40 0 192 255
SCALE 40 55 0 240 0
SCALE 55 70 240 240 0
SCALE 70 85 255 192 0
SCALE 85 100 255 0 0


NODE CollegeStation
POSITION 320 365
LABEL CLL

NODE Raleigh
POSITION 400 365
LABEL RAL


LINK CLL-RAL
NODES CollegeStation Raleigh
TARGET http://10.80.100.102/graphs/weatherm/we ... in_26.html
BANDWIDTH 70656

...and the config section of the weathermap file:

################################################################
#
# Configuration parameters
#
$WGET = "../wget/wget -qO -";
$CONFIG = "weathermap.conf";
$OUTPUT = "weathermap.png";
$DEBUG = 0;
$WIDTH = 900;
$HEIGHT = 700;
#
################################################################
If I had to guess, I would say that I screwed up the in GD Graphics Library since I wasn't quiiiiiiite sure exactly what to do with it on a Windows system.

Anyone got this to run from a Windows box yet?

Thanks,
Jason

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

Post by Howie »

jas0420 wrote:The output file is oddly 11k smaller than the original, so it's evidently not completing the file.
Try adding

Code: Select all

binmode(PNG);
directly after the

Code: Select all

open(PNG,">$OUTPUT")||die("$OUTPUT: $!\n");
line.

Windows Perl opens files in ascii mode by default, if I remember correctly, which will silently break any binary file saved (like a PNG).
David R.

Check output

Post by David R. »

Anonymous wrote:I got 104 rrd-files in my /rra dir, but the script posted by David R. only makes 57 .html files. Anyone know why?
Hi,

what do you get when you run the script by hand in debug mod (removing the comment line in the script to see the output when a rrd file is not treated.

Regarding the cron proble I had an issue also on RH ES, when I did try to get the script run evry 5 minutes, don't know why, putting it to 3, worked.... weird.
Heres' my cron (located in cron.d directory):

Code: Select all

[admin@webutil admin]$ cat /etc/cron.d/weathermap

*/3 * * * * apache ( /usr/local/bin/c2weather 2>&1 && /usr/local/bin/weathermap -c /usr/local/etc/weathermap.conf &>/dev/null )
(c2weather is the script)

David.

ps: first remove all the wea_* files
Rossco
Cacti User
Posts: 76
Joined: Sat Jan 15, 2005 4:52 pm
Location: London, England

PNG's now working :-)

Post by Rossco »

Howie, you da man! :D

Graphics now outputting correctly - links dont work, but I'm certain thats my mistake.

Thanks for your help.

Kind Regards

Rossco
Guest

Post by Guest »

Hi,
Could you help me i'm a bit confused!!

I'm running the cacti2weatermap.pl
with no errors
but i'm not getting anything in my graphs directory!
Any suggestions??

thanks in advance
jas0420
Cacti User
Posts: 91
Joined: Thu Jan 13, 2005 3:58 pm
Location: College Station, TX - USA

Post by jas0420 »

Woo hoo!!! Howie, that did it! Thank you!!!
Jason

Howie wrote:
jas0420 wrote:The output file is oddly 11k smaller than the original, so it's evidently not completing the file.
Try adding

Code: Select all

binmode(PNG);
directly after the

Code: Select all

open(PNG,">$OUTPUT")||die("$OUTPUT: $!\n");
line.

Windows Perl opens files in ascii mode by default, if I remember correctly, which will silently break any binary file saved (like a PNG).
jas0420
Cacti User
Posts: 91
Joined: Thu Jan 13, 2005 3:58 pm
Location: College Station, TX - USA

Post by jas0420 »

Anonymous wrote:Hi,
Could you help me i'm a bit confused!!

I'm running the cacti2weatermap.pl
with no errors
but i'm not getting anything in my graphs directory!
Any suggestions??

thanks in advance
Make sure you have a directory inside your graphs directory called "weatherm". Create it if not. By default, graphs go to wherever/cacti/graphs/weatherm/

Good luck!
madjeff
Posts: 11
Joined: Mon Feb 09, 2004 2:19 pm

Re: Works... confirmed!

Post by madjeff »

madjeff wrote: I can run cacti2weathermap.pl from the command line and it creates the files perfectly. But when I run it via cron, it doesn't create/update the files. Any idea what might be causing this?
Sorry, another "bump" for help. I'm just getting back to this after the long weekend, and I'm still having trouble getting this to run in cron. :oops:
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Works... confirmed!

Post by Howie »

madjeff wrote:
madjeff wrote: I can run cacti2weathermap.pl from the command line and it creates the files perfectly. But when I run it via cron, it doesn't create/update the files. Any idea what might be causing this?
Sorry, another "bump" for help. I'm just getting back to this after the long weekend, and I'm still having trouble getting this to run in cron. :oops:
What use do you run the cron job as? Is it the same use that owns the directory and the files that you are trying to create?

If you tested it as root, then added a cron job for your cactiuser for example, then it will indeed fail. In that case:

Code: Select all

chown -R cactiuser /var/www/directory_with_weathermap_data

ought to fix it for you.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest