[racktables-users] Re: Regenerate thumbnail images

  • From: "Aaron Blanton" <alblanton@xxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Thu, 29 Mar 2012 14:54:31 -0500

This works for me.. (runs as a cron job/scheduled task)
I run whatsup gold, and poll its DB for any servers w/ problems, and
set the 'has_problems' field to Yes for those w/ problems and re-render
the racks so the 'red' shows up..
----code----
<?php
require_once 'inc/init2.php';
require_once 'inc/solutions.php';
connectDB();
 
$db = mysql_connect("localhost", "username","password",true);
mysql_select_db("racktables_db_name",$db);
$sql = "select * from Rack";
$result = mysql_query($sql,$db);
if ($row = mysql_fetch_array($result))
{
        do {
                $rackid = $row['id'];
                ob_start();
                generateMiniRack($rackid);
                $capture = ob_get_clean();
                $capture64 = base64_encode ($capture);
                $sql2 = "update Rack set thumb_data = '$capture64'
where id = $rackid";
                $result2 = mysql_query($sql2,$db);
        } while ($row = mysql_fetch_array($result));
}
mysql_close($db);
?>
----end code----

>>> "Alexey Andriyanov" <alan@xxxxxxxxxx> 3/29/2012 2:48 PM >>>
Ctrl+F5 ?

29.03.2012 17:21, Atwater, Jesse *******:
> I*ve updated my Racktables 0.19.10 installation to use custom colors
by
> updating the config table color_% values. It*s working quite nicely,
> however, the thumbnail images on the main Rackspace gallery (Main à
> Rackspace) still show up as the old colors. If I go into a rack and
> modify something on it (for example, add a new piece of equipment)
the
> thumbnail is regenerated to the correct colors. How can I force
**all**
> thumbnails to be automatically regenerated?
>
> Thanks!
>
> Jesse
>


-- 
Best regards,
Alexey



===========================================================
This message is confidential, intended only
for the named recipient(s) and may contain
information that is privileged or exempt from
disclosure under applicable law. If you are
not the intended recipient(s), you are notified
that the dissemination, distribution or copying
of this message is strictly prohibited. If you
received this message in error, or are not the
named recipient(s), please notify the sender
and delete this e-mail from your computer.

ETMC has implemented secure messaging for
certain types of messages. For more information
about our secure messaging system, go to: 

  http://www.etmc.org/mail/

Thank you.
===========================================================

Other related posts: