View previous topic :: View next topic |
Author |
Message |
ad-hoc
Joined: 15 Feb 2006 Posts: 8
|
Posted: Fri Feb 17, 2006 3:34 am Post subject: Question: Vantage Pro2 + serial + script + MRTG |
|
|
Does anyone know any script in c/c++ or perl or something else (in a Linux/Unix system) that can retrieve data from a Vantage Pro2 console and then using MRTG represents data graphically in a web site?
Thank you |
|
Back to top |
|
|
bhnb
Joined: 28 Nov 2005 Posts: 127
|
Posted: Fri Feb 17, 2006 6:29 am Post subject: |
|
|
You can feed the data gathered by wview into MRTG quite easily. Presumably you'd be using rrdtool as rateup only deals with integers?
This example assume wview files are in the default location and uses MRTG's external monitoring scripts:
1) First define an htx file for generation - cut and paste the following code into /etc/wview/html/outsideTemp.htx
Code: | <!--outsideTemp-->
0
<!--wviewUpTime-->
outsideTemp |
Then add outsideTemp.htx to /etc/wview/html-templates.conf and start/restart/send a HUP to htmlgend.
The corresponding MRTG cfg (outsideTemp.cfg) file is:
Code: | Workdir: /data/mrtg/work
Logformat: rrdtool
Title[^]: Outside Temperature
PageTop[^]: <H1>Stats for
MaxBytes[_]: 8000
Options[_]: growright, gauge , nopercent , pngdate, noo
Title[outsideTemp]: Outside Temperature
PageTop[outsideTemp]: Outside Temperature</H1>
Target[outsideTemp]: `cat /var/wview/img/outsideTemp.htm`
|
Then just run 'mrtg outsideTemp.cfg' and that should be it. |
|
Back to top |
|
|
bhnb
Joined: 28 Nov 2005 Posts: 127
|
|
Back to top |
|
|
ad-hoc
Joined: 15 Feb 2006 Posts: 8
|
Posted: Fri Feb 17, 2006 6:57 am Post subject: |
|
|
Thanks a lot Bhnb |
|
Back to top |
|
|
bhnb
Joined: 28 Nov 2005 Posts: 127
|
Posted: Fri Feb 17, 2006 7:00 am Post subject: |
|
|
No worries.
If necessary it should be fairly easy to generate a load of targets and htx files - let me know.
Cheers
Jon |
|
Back to top |
|
|
bhnb
Joined: 28 Nov 2005 Posts: 127
|
Posted: Fri Feb 17, 2006 9:31 am Post subject: |
|
|
Just had a thought. If you're using MRTG what would happen if the data gathering system stopped at any time? Would you be able to backfill the MRTG data once you got it going again? |
|
Back to top |
|
|
mteel
Joined: 30 Jun 2005 Posts: 435 Location: Collinsville, TX
|
Posted: Fri Feb 17, 2006 11:35 am Post subject: |
|
|
I am not familiar with MRTG, but this might be most easily implemented by using one or more alarm scripts to invoke MRTG when new data is received. If we are going to start creating intermediate html files, I would prefer we actually need them to be html. If weather data and a notification scheme are all that is needed, the wview alarms provide several ways to skin that cat.
Mark |
|
Back to top |
|
|
ad-hoc
Joined: 15 Feb 2006 Posts: 8
|
Posted: Thu Apr 27, 2006 4:48 am Post subject: |
|
|
Hello... I am back after some long time ago
Bhnb, MRTG seems to work great...
Have you tried to merge 2 values in 1 graph (with different colors)? For example Outside Temp + DewPoint ?
If you have or you know, please let me know
Thanks.... |
|
Back to top |
|
|
bhnb
Joined: 28 Nov 2005 Posts: 127
|
Posted: Tue May 30, 2006 1:58 pm Post subject: |
|
|
Yes - a graph with two values works. Changing the example given above to this:
Code: | <!--outsideTemp-->
<!--outsideDewPt-->
<!--wviewUpTime-->
targetname |
Will give what you need. |
|
Back to top |
|
|
|