PDA

View Full Version : Dynamic background in maps


Lovespider
29-05-2007, 17:05
Hello,
my idea was to change the background of a map dynamically so I can display any picture without dealing with php or whatever.
In my example I have a map with the europe background to see the status of variuos links. I want to change it with the satellite images so I can check the weather at the same time ;-)

Let's assume we have a map in table 'graphs' having id 21.

I have first created a batch file that get the picture I want by using wget, then I call a perl script to update the table.

The perl script is this:

#!/usr/bin/perl
use DBI;
our $dbh = DBI->connect('DBI:mysql:zabbix:localhost',
'zabbix', #user name
'yourpassword', #password
{ RaiseError => 1 });

my $sth= $dbh->prepare("UPDATE images SET image = ? WHERE imageid = 21");

open(my $fh, '/root/grande.gif' ) or die $!;
read( $fh, $var, -s $fh );
$sth->execute($var);

$sth->finish;
$dbh->disconnect;


Please note the '21' for the id and substitute the /root/grande.gif with the path of the 'wgetted' image.
Just cron the batch and you can see the picture changing every time you want.

Alexei
29-05-2007, 18:17
I think that slide shows can be used for the same thing.

Lovespider
30-05-2007, 10:02
Well,
quoting your description:

:: Support of slide show

Several screens can be grouped into a slide show for better
presentation.
I did not tested it but if I understand right, this means I create screens and then Zabbix shows them like a slideshow. Everything manually though.

My script change the background of a single map so, like in my example, I download the latest IR image from satellite and put on the background of a map. Too bad that the animated gif doesn't work....

See attached jpg file.