I search script & template for weather graph

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

Moderators: Developers, Moderators

Post Reply
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

I search script & template for weather graph

Post by meteo.quimper »

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
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

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 ... ccuWeather

u can also modify the whole thing for u liking
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

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 ?
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

can you post this script, i can then create a template for you and post it back
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

you want the txt file with the weather data inside ?
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

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= ... HBITm9h0JQ
Attachments
weather-data-cacti.txt
(28 Bytes) Downloaded 147 times
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

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.
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

Thanks for your help:

the data should be on separate graphs

the data on the .txt fils are updated every 5 minutes
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

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 :)
Attachments
weather_scripts.rar
(26.44 KiB) Downloaded 164 times
graph_image.php.png
graph_image.php.png (17.56 KiB) Viewed 4838 times
graph_image2.php.png
graph_image2.php.png (18.75 KiB) Viewed 4838 times
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

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 ?
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

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..
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

Everything seem to working well, but the humidity graph template is mising, it' wasen't in the zip file, can resend it to me ?
sigey
Posts: 25
Joined: Mon Feb 14, 2005 9:17 am
Location: MV
Contact:

Post by sigey »

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.
Attachments
img1.PNG
img1.PNG (39.72 KiB) Viewed 4764 times
meteo.quimper
Posts: 8
Joined: Sat Mar 29, 2008 6:34 am
Contact:

Post by meteo.quimper »

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 ?
Attachments
graph_30_5.png
graph_30_5.png (29.31 KiB) Viewed 4717 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Select a different GPRINT Preset for the GPRINTs of that Graph Template
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest