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    


[SOLVED] Sparklines.pl issue

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
MU-IT
Cacti User


Joined: 06 Nov 2007
Posts: 55

PostPosted: Wed Sep 03, 2008 10:40 am    Post subject: [SOLVED] Sparklines.pl issue Reply with quote

In trying to add a sparkline to my map, per http://wotsit.thingy.com/haj/cacti/rrd-stripgraph.html ...

I believe i've added the imager perl module correctly, I've compiled an executable (I'm using win2k3 server) to run and generate the sparkline using rrdtool, but the perl program fails on me, on line 100:

Code:
$font = Imager::Font->new(file => $tfont, size => $fontsize) || die($!);


I get

Quote:
no such file or directory at sparkline.pl line 100


I've done a bit of very primitive perl coding (normally just for the regular expressions), so I'm struggling with what this line of code is trying to do. I'd be happy feeding $font a static value just to get this going.... but I don't understand what's going on here.

Thanks for all your help, and a great product!


Last edited by MU-IT on Thu Sep 04, 2008 2:44 pm; edited 1 time in total
Back to top
Howie
Cacti Guru User


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

PostPosted: Wed Sep 03, 2008 11:10 am    Post subject: Reply with quote

It can't find your font file.

I think Imager deals with fonts differently onWindows to unix (I use this script on FreeBSD). From memory, you need to change the $ftont right up at the top to just be the font name (e.g. "Arial") and Imager uses the Windows GDI font loader instead of freetype to load fonts. Here's the docs for that. I never got a version of Imager for Windows with sensible format support (PNG, JPEG), so I haven't tried this myself.
Back to top
MU-IT
Cacti User


Joined: 06 Nov 2007
Posts: 55

PostPosted: Wed Sep 03, 2008 12:31 pm    Post subject: Reply with quote

Thanks Howie, that did it.


changed code to:
Code:
$font = Imager::Font->new(face=>"$tfont", size => $fontsize);


and I can spit out a nice little sparkline. pretty sweet.

Thanks again.
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
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group