- You can easily right click - Save As while on the weathermap page. This produces a file called weathermap-cacti-plugin.png.
- No such file is available from the webpage however. Right clicking - view URL gave me this:
http://<mydomain>/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=df9c40dcab42d1fd6867&time=1448863933
I did a quick check in powershell to see if this was downloadable (it was):
$client = new-object System.Net.WebClient
$client.DownloadFile("http://<mydomain>/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=df9c40dcab42d1fd6867&time=1448864049", "C:\data\test.png")
Following a hunch, I refreshed the page and copied a couple more URLs:
<mydomain>/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=df9c40dcab42d1fd6867&time=1448863989
<mydomain>/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=df9c40dcab42d1fd6867&time=1448864049
As I had suspected, the time=
changed every time I refreshed the page.
Following another hunch, I checked the changing digits (1448863989
etc) on epochconverter.com and got a valid system time which matched my own.
I found a powershell command (Keith Hill's answer on this question) to get the current Unix time
[int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds
and added this into the powershell download script
$client = new-object System.Net.WebClient
$time=[int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds
$client.DownloadFile("http://<mydomain>/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=df9c40dcab42d1fd6867&time=$time", "C:\data\test.png")
This seems to work - the file test.png modified timestamp was updated every time I ran the code, and it opened showing a valid picture of the weathermap.
All that's required now is to put this in a proper script and schedule it to run every X minutes and save to a folder. I am sure scheduling powershell scripts in Task Scheduler is covered elsewhere so I will not repeat it here.
If anyone knows an easier way of doing this, please let me know. Otherwise, vote up my answer - I have searched a lot and cannot find any other results on the net that let you do this using only Windows. The Cacti forums have a couple of solutions, but they require you to do stuff on the Linux server which is hard for a Linux noob like me.