Ad Widget

Collapse

Dynamic background in maps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lovespider
    Member
    • Sep 2004
    • 99

    #1

    Dynamic background in maps

    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
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    I think that slide shows can be used for the same thing.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Lovespider
      Member
      • Sep 2004
      • 99

      #3
      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.
      Attached Files
      Last edited by Lovespider; 30-05-2007, 10:58.

      Comment

      Working...