First, starting from Howie's page on creating animations of Weathermaps here:
http://www.network-weathermap.com/conte ... eathermaps
I use a very similar script to grab a copy of the new map each time it is generated and store it with the date as part of the file name. I also use a cron entry to prune the saved maps to a number of days. I store the saved maps in cacti/plugins/weathermap/output/history/ for lack of a better location. Make sure that you name the saved map files in this format: map_201010132300.png as the PHP script will look for this format.
To illustrate, here is a bash script to save the map, which you would call from the poller as Howie suggests or from cron in your own fashion if you prefer:
Code: Select all
#!/bin/sh
SRC_MAP="/var/www/html/cacti/plugins/weathermap/output/your-map-here.png"
HISTORY_DIR="/var/www/html/cacti/plugins/weathermap/output/history"
DATE=`date '+%Y%m%d%H%M'`
cp $SRC_MAP $HISTORY_DIR/map_$DATE.png
That's all there is to it. I thought about making this script its own plugin, especially after trying to include some of Cacti's CSS files in order to give it a similar look and feel. But I have been thinking about it for a while and decided to go ahead and post here - maybe there is someone that would like to bundle it up more cleanly.
Let me know if you like it or have any problems!