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    


I search script & template for weather graph

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sat Mar 29, 2008 6:39 am    Post subject: I search script & template for weather graph Reply with quote

Hi

i just finished to install cacti, the graphs work well (memory,network...), i search a script and a template who can make graphs from a .txt file, the data on the file are simple, for example weather.txt:

52,72,1080,15

52 is for temperature, 72 is for humidity, 1080 is for pressure...

the data are from a weather station, if someone can help me.

thanks
Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Sat Mar 29, 2008 8:36 am    Post subject: Reply with quote

if on a linux box you can use a bash script and awk the file.
This bash script can be used as the data input method on cacti.
It is quite easy to create a data template and graphs from there onwards.

If you are looking into creating weather graphs why dont yu use the following:

I use this and lot of others are successfully using this.



http://forums.cacti.net/viewtopic.php?t=8820&highlight=AccuWeather

u can also modify the whole thing for u liking
Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sat Mar 29, 2008 2:37 pm    Post subject: Reply with quote

Thanks for your answer, but i have my own weather station (Davis Vantage Pro 2) that's why i just need to create graphs from the .txt file.
Another idea ?
Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Sat Mar 29, 2008 11:12 pm    Post subject: Reply with quote

can you post this script, i can then create a template for you and post it back
Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sun Mar 30, 2008 3:53 am    Post subject: Reply with quote

you want the txt file with the weather data inside ?
Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sun Mar 30, 2008 4:10 am    Post subject: Reply with quote

the weather data are in the .txt file, i also create a spread sheet doc who explain what are the data:

http://spreadsheets.google.com/pub?key=pFoEnWn_VMK2bHBITm9h0JQ



weather-data-cacti.txt
 Description:

Download
 Filename:  weather-data-cacti.txt
 Filesize:  28 Bytes
 Downloaded:  26 Time(s)

Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Sun Mar 30, 2008 5:44 am    Post subject: Reply with quote

i had a look at ur data:

"15,10,72,1023,28,36,5,500,14"

do you want all these data to be present on the same graph or seperate ones?

I think you should put them on separate graphs to look it nice, also you can put them on the same graph later on as well.

I can create some templates for this. i am assuming that the data file will be updated via another *external* script.
Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sun Mar 30, 2008 6:01 am    Post subject: Reply with quote

Thanks for your help:

the data should be on separate graphs

the data on the .txt fils are updated every 5 minutes
Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Sun Mar 30, 2008 9:00 am    Post subject: Reply with quote

ok here it is.

I am posting the weather_scripts.rar file.

Import the XML files using the import feature of cacti.

modify the bash script "print.sh" - with the exact path of ur cacti installation.

and put that script into the scripts dir of cacti.

Also i am attaching sample graphs as well .... Enjoy with a glass of champagne



graph_image2.php.png
 Description:
 Filesize:  18.75 KB
 Viewed:  1377 Time(s)

graph_image2.php.png



graph_image.php.png
 Description:
 Filesize:  17.56 KB
 Viewed:  1377 Time(s)

graph_image.php.png



weather_scripts.rar
 Description:

Download
 Filename:  weather_scripts.rar
 Filesize:  26.44 KB
 Downloaded:  42 Time(s)

Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sun Mar 30, 2008 9:10 am    Post subject: Reply with quote

thanks for your work, i imported the templates in cacti, i saw there is a file print.sh how i can configure cacti to call the script and to build the graphs ?
Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Sun Mar 30, 2008 9:17 am    Post subject: Reply with quote

just put that bash script in ur cact's scripts dir provide proper perms.

As per my above post make sure u have the correctly..
Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Sun Mar 30, 2008 11:36 am    Post subject: Reply with quote

Everything seem to working well, but the humidity graph template is mising, it' wasen't in the zip file, can resend it to me ?
Back to top
sigey



Joined: 14 Feb 2005
Posts: 25
Location: MV

PostPosted: Mon Mar 31, 2008 12:05 am    Post subject: Reply with quote

ah!!! .. i almost forgot this part, you need to add the data input methods as follows in the screen shot:

just follow the screen shot and add them as it is exactly and you are good to go.



img1.PNG
 Description:
 Filesize:  39.72 KB
 Viewed:  1303 Time(s)

img1.PNG


Back to top
meteo.quimper



Joined: 29 Mar 2008
Posts: 8

PostPosted: Mon Mar 31, 2008 2:27 pm    Post subject: Reply with quote

hi
everything work well, i have a question, the barometer graph display:

pression: relevé: 1.03k mini: 1.03k maxi: 1.03k

but i need to display for example:

pression: relevé: 1025.58 mini: 1025.58 maxi: 1025.58

how i can do that ?



graph_30_5.png
 Description:
 Filesize:  29.31 KB
 Viewed:  1256 Time(s)

graph_30_5.png


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12604
Location: Muenster, Germany

PostPosted: Tue Apr 01, 2008 12:56 pm    Post subject: Reply with quote

Select a different GPRINT Preset for the GPRINTs of that Graph Template
Reinhard
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group