|  | Skript temptag.phpDieses Skript hat folgende Aufgaben:
 
Erstellen der 2-Tages-ÜbersichtHochladen aller Dateien auf den Server im www 
#!/usr/bin/perl -w
# -*- Perl -*-
# V 1.2
# Skript über 2 Stunden, mit automatischer Randbegrenzung
#
use GD;
use Time::Local;
use Net::FTP;
# Grundeinstellungen
# ******************
# Welcher Zeitrahmen?
$hours = 48;
# Größe des Graphens
$xmax=1000;
$ymax=500;
# Wohin das Bild 
$ablage = "/www/htdocs/w0127972/zobelei.de/temper/temptag.gif";
# Wohin das Wetterbild, wird auch hochgeladen
$ablage1 = "/www/htdocs/w0127972/zobelei.de/temper/klimatag.gif";
# 2. Datei zum Hochladen...
$ablage2 = "/www/htdocs/w0127972/zobelei.de/temper/aktuell.inc";
# Werte, die außerhalb dieses Wertes liegen, werden nicht berücksichtigt
# (Abstand zum vorherigen Wert)
$maxtempsprung = 30;
# Entsprechend der Logdatei (via Digitemp erstellt, mit Jahresangabe)
$samples_per_hour = 60;
# Ränder - sollten so bleiben
$hmargin = 40;
$vmargin = 50;
# Monate zum Umrechnen
my %monat       = qw{Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5
                     Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11};
# Anzahl der Dateneinträge in der Graphik
$samples =  $hours * $samples_per_hour;
# Startzeit im Linux-Timeformat
my ($d, $minute, $hour, $day, $month,
    $year, $d, $d, $d) = localtime(time());
$ssek = timelocal(0, 0, 0, $day, $month, $year);
$ssek = $ssek - (24*3600);
# Datei einlesen
open(DOTTEMP, ";
close(DOTTEMP);
# Max- und Minimalwerte bestimmen, um die Dimension der Graphik festzulegen.# Randwerte zurücksetzen
for ($zaehler=0 ; $zaehler < 14 ; $zaehler++)
{
   $lastx[$zaehler] = $hmargin;
   $lasty[$zaehler] = 0;
   $max[$zaehler] = -50;
   $min[$zaehler] = 100;
   $maxc[$zaehler] = 100;
   $minc[$zaehler] = -50;
   $summe[$zaehler] = 0;
   $anz[$zaehler] = 0;
};
# Ränder finden: Max, Min, Letzte Stunde und Minute
$tag = 0;
$aktday = -1;
foreach $zeile (@dottemp)
{
  ($year,$month,$day,$time,$d1,$sensor,$d1,$centigrade,$fahrenheight) = split(" ", $zeile, 9);
  ($hour,$minute,$sec) = split(":", $time);
  if ($aktday < 0) {
                           $aktmonth = $monat{$month} +1;
                        $label = "";
                        if ($aktmonth<10) {$label = "0"};
                        $starttag = "$day.$label$aktmonth.20$year";
                        $aktday = $day;
                        };
  if ($aktday != $day)
     {
             $tag=7;
             $aktday = $day;
    };
  # Ausschluß von fehlerhaften Werten
  if ($centigrade ne '85.00' && $centigrade > $minc[$sensor] && $centigrade < $maxc[$sensor])
     {
             $sensor2 = $sensor + $tag;
             if ($centigrade > $max[$sensor2]) {
                                               $max[$sensor2] = $centigrade;
                                               if ($anz[$sensor2]<1)
                                                         {$maxt[$sensor2] = "Start"}
                                                else
                                                         {$maxt[$sensor2] = $time};
                                               };
             if ($min[$sensor2] > $centigrade) {
                                              $min[$sensor2] = $centigrade;
                                               if ($anz[$sensor2]<1)
                                                         {$mint[$sensor2] = "Start"}
                                                else
                                                         {$mint[$sensor2] = $time};
                                              };
     $summe[$sensor2] = $summe[$sensor2]+$centigrade;
     $anz[$sensor2] = $anz[$sensor2]+1;
     $minc[$sensor] = $centigrade-$maxtempsprung;
     $maxc[$sensor] = $centigrade+$maxtempsprung;
     $time[$sensor2] = $time;
     }
}
# Gesamtwerte (Min/Max) suchen
$max = -50;
$min = 100;
$aktmonth = $monat{$month} +1;
$label = "";
if ($aktmonth<10) {$label = "0"};
$endtag = "$day.$label$aktmonth.20$year";
for ($zaehler=0 ; $zaehler < 14 ; $zaehler++)
{
     if ( $max[$zaehler] > $max ) {$max = $max[$zaehler]};
     if ( $min[$zaehler] < $min ) {$min = $min[$zaehler]};
     if ( $mint[$zaehler] eq $time[$zaehler] ) {$mint[$zaehler] = "Ende" };
     if ( $maxt[$zaehler] eq $time[$zaehler] ) {$maxt[$zaehler] = "Ende" };
};
# Bild 1: Alle Werte
$tempmax = int(($max+10)/10)*10;
$tempstart = int(($min-10)/10)*10;
$dy = ($ymax/($tempmax-$tempstart));
$dx = ($xmax/$samples);
# Bild 2: Nur Außentemperaturen
$zaehler = 2;
if ($max[2] < $max[9]) {$zaehler = 9};
$tempmax2 = int(($max[$zaehler]+10)/10)*10;
$zaehler = 2;
if ($min[2] > $min[9]) {$zaehler = 9};
$tempstart2 = int(($min[$zaehler]-10)/10)*10;
$dy2 = ($ymax/($tempmax2-$tempstart2));# Graphen Grundgerüst erstellen# Temperatur in Graphkoordinaten umwandeln
# Für Graph 1
sub ytransform {
    $temp = shift;
    return int($vmargin+(($tempmax-$temp)*$dy));
}
# Für Graph 2
sub ytransform2 {
    $temp = shift;
    return int($vmargin+(($tempmax2-$temp)*$dy2));
}
# Nun kann das Bild erstellt werden
$width = $hmargin + ($samples * $dx) + $hmargin;
$height = &ytransform($tempstart)+$vmargin*3;
$height2 = &ytransform2($tempstart2)+$vmargin*3;
$im = new GD::Image( $width, $height );
$im2 = new GD::Image( $width, $height2 );
# Farben festlegen
($white,$black,$gelb, $dbraun,$mbraun,$hbraun,$red,$hred,$green,$hgreen,$blue,$skyblue) =
    (
     $im->colorAllocate(255, 255, 255),
     $im->colorAllocate(0, 0, 0),
     $im->colorAllocate(183, 183, 0),
     # braun: Klima
     $im->colorAllocate(192, 64, 0),
     $im->colorAllocate(255, 128, 0),
     $im->colorAllocate(255, 0, 0),
     # rot: Server
     $im->colorAllocate(236, 0, 255),
     $im->colorAllocate(165, 0, 179),
     # Grün: Client
     $im->colorAllocate(0,185,0),
     $im->colorAllocate(0,128,0),
     # Blau: Gitter
     $im->colorAllocate(0,255,255),
     $im->colorAllocate(100,100,255)
     );
# Farben festlegen Graph 2 - es werden nicht alle gebraucht, aber wer weiß...
($white2,$black2,$gelb2,$dbraun2,$mbraun2,$hbraun2,$red2,$hred2,$green2,$hgreen2,$blue2,$skyblue2) =
    (
     $im2->colorAllocate(255, 255, 255),
     $im2->colorAllocate(0, 0, 0),
     $im2->colorAllocate(183, 183, 0),
     # braun: Klima
     $im2->colorAllocate(192, 64, 0),
     $im2->colorAllocate(255, 128, 0),
     $im2->colorAllocate(255, 0, 0),
     # rot: Server
     $im2->colorAllocate(236, 0, 255),
     $im2->colorAllocate(165, 0, 179),
     # Grün: Client
     $im2->colorAllocate(0,185,0),
     $im2->colorAllocate(0,128,0),
     # Blau: Gitter
     $im2->colorAllocate(0,255,255),
     $im2->colorAllocate(100,100,255)
     );
# Horizontale Linien für Temperaturhöhe
sub hline {
    ($y,$color,$art) = @_;
    $yname = $y;
    if ($art eq 1) {$y = &ytransform($y);}
       else {$y = &ytransform2($y);}
    $ychar = $y-6;
    $numleft = 10;
    $lineleft = 26;
    $lineright = $width - 24;
    $numright = $width - 20;
    if ($art eq 1)
    {
               $im->string(gdSmallFont,$numleft,$ychar,$yname,$color);
               $im->line($lineleft,$y,$lineright,$y,$color);
               $im->string(gdSmallFont,$numright,$ychar,$yname,$color);
    }
    else
    {
               $im2->string(gdSmallFont,$numleft,$ychar,$yname,$color);
               $im2->line($lineleft,$y,$lineright,$y,$color);
               $im2->string(gdSmallFont,$numright,$ychar,$yname,$color);
    }
}
# Temperaturlinien bei Bild 1
$stepw = int(($tempmax-$tempstart)/$ymax*50);
if        ($stepw < 2 ) {$stepw =  1}
    elsif ($stepw < 5 ) {$stepw =  2}
    elsif ($stepw < 10) {$stepw =  5}
    else                        {$stepw = 10};
for ($t=$tempstart; $t <= $tempmax; $t=$t+$stepw)
 {
 $color = $skyblue;
 if ($t eq 0) {$color = $blue};
 &hline($t,$color,1);
 }
# Temperaturlinien bei Bild 2
$stepw = int(($tempmax2-$tempstart2)/$ymax*50);
if        ($stepw < 2 ) {$stepw =  1}
    elsif ($stepw < 5 ) {$stepw =  2}
    elsif ($stepw < 10) {$stepw =  5}
    else                        {$stepw = 10};
for ($t=$tempstart2; $t <= $tempmax2; $t=$t+$stepw)
 {
 $color = $skyblue2;
 if ($t eq 0) {$color = $blue2};
 &hline($t,$color,2);
 }
# Zeit in Graphenkoordinaten verwandeln
sub xtransform {
    return int($hmargin + $dx * shift);
}
# Vertikale Linien malen
sub vline {
    ($x,$label,$label2,$color,$color2) = @_;
    $x = &xtransform($x);
    $linetop = &ytransform($tempmax);
    $linebot = &ytransform($tempstart);
    $ychar = &ytransform($tempmax)-20;
    $linetop2 = &ytransform2($tempmax2);
    $linebot2 = &ytransform2($tempstart2);
    $ychar2 = &ytransform2($tempmax2)-20;
    if ($label ne '')
        {
               $im->string(gdSmallFont,$x-3,$ychar,$label,$color);
            $im2->string(gdSmallFont,$x-3,$ychar2,$label,$color2);
        };
    if ($label2 ne "")
        {
               $im->string(gdLargeFont,$x-3,5,$label2,$color);
            $im2->string(gdLargeFont,$x-3,5,$label2,$color2);
        };
    $im->line($x,$linetop,$x,$linebot,$color);
    $im2->line($x,$linetop2,$x,$linebot2,$color2);
}
# Vertikale Linien erstellen, gilt für beide Bilder
# $flagge wechselt zwischen Tag 1 und Tag 2
$flagge = "0";
for ($t = 0 ; $t <= 48 ; $t++)
 {
 $color = $skyblue;
 $color2 = $skyblue2;
 $zeit = $t;
 if ($zeit > 23){$zeit-=24};
 if ($zeit == 24){$zeit=0};
 $angabe = "$zeit";
 if ($zeit == 0)
    {
    $color = $blue;
    $color2 = $blue2;
    };
 $angabe2 = "";
 if ($zeit == 11)
    {
    $angabe2 = $endtag;
    if ($flagge eq "0")
      {
        $angabe2= $starttag;
              $flagge = "1";
      }
    };
 &vline(($t*60),$angabe,$angabe2,$color, $color2);
 }
# Toleranzbreite für sichtbar ausgefallene Werte: 3
$toleranzbreite = int($dx*3);
if ($toleranzbreite < 3) {$toleranzbreite = 3};
$tag = 0;
$aktday = -1;# Datenpunkte eintragenforeach $zeile (@dottemp)
{
  # Jeden Wert aus der Datei auflösen
  ($year,$month,$day,$time,$d1,$sensor,$d1,$centigrade,$fahrenheight) = split(" ", $zeile, 9);
  ($hour,$minute,$sec) = split(":", $time);
# 0 - Raum
# 1 - Fenster
# 2 - Außen
# 3 - Servergehäuse
# 4 - Serverprozessor
# 5 - Clientgehäuse
# 6 - Clientprozessor
  $jsek = timelocal($sec, $minute, $hour, $day, $monat{$month}, $year);
  # Nur wenn der Wert innerhalb der Zeit liegt
  if ($jsek >= $ssek)
  {
     # Zeitpunkt festlegen
     $x = ($jsek-$ssek)/60;
     $x = int($x * $dx);
     $x = $x + $hmargin;
     # Tag aussuchen (für Min- und Maxwerte)?
     if ($aktday < 0) {$aktday = $day};
     if ($aktday != $day)
     {
             $tag=7;
             $aktday = $day;
     };
     $sensor2 = $sensor + $tag;
     # Und innerhalb Minimum und Maximum (sonst Ausreißer)
     if($centigrade >= $min[$sensor2] && $centigrade <= $max[$sensor2])
       {
         if( $sensor eq '0' ) {$color = $hbraun};
         if( $sensor eq '1' ) {$color = $mbraun};
         if( $sensor eq '2' ) {$color = $dbraun};
         if( $sensor eq '3' ) {$color = $red};
         if( $sensor eq '4' ) {$color = $hred};
         if( $sensor eq '5' ) {$color = $green};
         if( $sensor eq '6' ) {$color = $hgreen};
         $y = &ytransform($centigrade);
         $y2 = &ytransform2($centigrade);
         # Fehlte der vorherige Wert?
         $toleranz = $lastx[$sensor]+$toleranzbreite;
         if ($toleranz < $x)
                                        {
                             $color = $gelb;
                             };
         # Linie malen - wenn es vorher einen Wert gab
         if ( $lasty[$sensor] gt 0 )
            {
               $im->line(int($lastx[$sensor]),$lasty[$sensor],int($x),$y,$color);
               # Graph 2 kriegt nur die Wettertemperatur
               if( $sensor eq '2' )
                    {
                     if( $sensor eq '2' ) {$color2 = $dbraun2};
                    if( $color eq $gelb ) {$color2 = $gelb2};
                    $im2->line(int($lastx[$sensor]),$lasty2[$sensor],int($x),$y2,$color2);
                    };
            };
         # Letzten Wert merken
         $lasty2[$sensor] = $y2;
         $lasty[$sensor] = $y;
             $lastx[$sensor] = $x;
         $lastc[$sensor] = $centigrade;
         $lastt[$sensor] = $time;
       }
  }
}
# Erstellungsdatum hinzufügen
$date = `date "+Erstellt um %H:%M Uhr am %a, %d. %b %Y"`;
chop $date;
# Ausgefallene Werte sinnvoll setzten sowie Durchschnitt berechnen
for ($zaehler=0 ; $zaehler < 14 ; $zaehler++)
{
   if ($anz[$zaehler] eq 0)
      {
              $min[$zaehler] = "---";
              $max[$zaehler] = "---";
              $mint[$zaehler] = "";
              $maxt[$zaehler] = "";
              $summe[$zaehler] = "Ausgefallen";
        $lastc[$zaehler] = "---";
        $lastt[$zaehler] = "";
      }
   else
      {
              $summe[$zaehler] = int($summe[$zaehler]/$anz[$zaehler]*100)/100;
      };
};
# Wertangabe für dx
$text = int(100/$dx)/100;
$text = "$text Minuten pro Pixel";
# Textangaben erstellen
$spalte1 = 100;
$spalte2 = 350;
$spalte3 = 500;
$spalte4 = 750;
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+8,"Bezeichnung",$black);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+20,"Raumtemperatur",$hbraun);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+32,"Fenster",$mbraun);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+44,"Außentemperatur",$dbraun);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+62,"Servergehäuse",$red);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+74,"ServerCPU",$hred);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+92,"Clientgehäuse",$green);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+104,"ClientCPU",$hgreen);
$im2->string(gdSmallFont,$hmargin,&ytransform2($tempstart2)+8,"Bezeichnung",$black2);
$im2->string(gdSmallFont,$hmargin,&ytransform2($tempstart2)+20,"Außentemperatur",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+8,"Minimal ( $starttag / $endtag )",$black);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+20,"$min[0]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+32,"$min[1]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+44,"$min[2]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+62,"$min[3]",$red);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+74,"$min[4]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+92,"$min[5]",$green);
$im->string(gdSmallFont,$hmargin+$spalte1,&ytransform($tempstart)+104,"$min[6]",$hgreen);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+20,"($mint[0])",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+32,"($mint[1])",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+44,"($mint[2])",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+62,"($mint[3])",$red);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+74,"($mint[4])",$hred);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+92,"($mint[5])",$green);
$im->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform($tempstart)+104,"($mint[6])",$hgreen);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+20,"/ $min[7]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+32,"/ $min[8]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+44,"/ $min[9]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+62,"/ $min[10]",$red);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+74,"/ $min[11]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+92,"/ $min[12]",$green);
$im->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform($tempstart)+104,"/ $min[13]",$hgreen);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+20,"($mint[7])",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+32,"($mint[8])",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+44,"($mint[9])",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+62,"($mint[10])",$red);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+74,"($mint[11])",$hred);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+92,"($mint[12])",$green);
$im->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform($tempstart)+104,"($mint[13])",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte1,&ytransform2($tempstart2)+8,"Minimal ( $starttag / $endtag )",$black2);
$im2->string(gdSmallFont,$hmargin+$spalte1,&ytransform2($tempstart2)+20,"$min[2]",$dbraun2);
$im2->string(gdSmallFont,$hmargin+$spalte1+110,&ytransform2($tempstart2)+20,"/ $min[9]",$dbraun2);
$im2->string(gdSmallFont,$hmargin+$spalte1+40,&ytransform2($tempstart2)+20,"($mint[2])",$dbraun2);
$im2->string(gdSmallFont,$hmargin+$spalte1+160,&ytransform2($tempstart2)+20,"($mint[9])",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+8,"Durchschnitt",$black);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+20,"$summe[0]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+32,"$summe[1]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+44,"$summe[2]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+62,"$summe[3]",$red);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+74,"$summe[4]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+92,"$summe[5]",$green);
$im->string(gdSmallFont,$hmargin+$spalte2,&ytransform($tempstart)+104,"$summe[6]",$hgreen);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+20,"/ $summe[7]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+32,"/ $summe[8]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+44,"/ $summe[9]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+62,"/ $summe[10]",$red);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+74,"/ $summe[11]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+92,"/ $summe[12]",$green);
$im->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform($tempstart)+104,"/ $summe[13]",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte2,&ytransform2($tempstart2)+8,"Durchschnitt",$black2);
$im2->string(gdSmallFont,$hmargin+$spalte2,&ytransform2($tempstart2)+20,"$summe[2]",$dbraun2);
$im2->string(gdSmallFont,$hmargin+$spalte2+40,&ytransform2($tempstart2)+20,"/ $summe[9]",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+8,"Maximal ( $starttag / $endtag )",$black);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+20,"$max[0]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+32,"$max[1]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+44,"$max[2]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+62,"$max[3]",$red);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+74,"$max[4]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+92,"$max[5]",$green);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+104,"$max[6]",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte3,&ytransform2($tempstart2)+8,"Maximal ( $starttag / $endtag )",$black2);
$im2->string(gdSmallFont,$hmargin+$spalte3,&ytransform2($tempstart2)+20,"$max[2]",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+20,"/ $max[7]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+32,"/ $max[8]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+44,"/ $max[9]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+62,"/ $max[10]",$red);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+74,"/ $max[11]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+92,"/ $max[12]",$green);
$im->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform($tempstart)+104,"/ $max[13]",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte3+110,&ytransform2($tempstart2)+20,"/ $max[9]",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+20,"($maxt[0])",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+32,"($maxt[1])",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+44,"($maxt[2])",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+62,"($maxt[3])",$red);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+74,"($maxt[4])",$hred);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+92,"($maxt[5])",$green);
$im->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform($tempstart)+104,"($maxt[6])",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte3+40,&ytransform2($tempstart2)+20,"($maxt[2])",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+20,"($maxt[7])",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+32,"($maxt[8])",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+44,"($maxt[9])",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+62,"($maxt[10])",$red);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+74,"($maxt[11])",$hred);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+92,"($maxt[12])",$green);
$im->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform($tempstart)+104,"($maxt[13])",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte3+160,&ytransform2($tempstart2)+20,"($maxt[9])",$dbraun2);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+8,"Letzter Wert",$black);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+20,"$lastc[0]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+32,"$lastc[1]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+44,"$lastc[2]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+62,"$lastc[3]",$red);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+74,"$lastc[4]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+92,"$lastc[5]",$green);
$im->string(gdSmallFont,$hmargin+$spalte4,&ytransform($tempstart)+104,"$lastc[6]",$hgreen);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+20,"$lastt[0]",$hbraun);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+32,"$lastt[1]",$mbraun);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+44,"$lastt[2]",$dbraun);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+62,"$lastt[3]",$red);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+74,"$lastt[4]",$hred);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+92,"$lastt[5]",$green);
$im->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform($tempstart)+104,"$lastt[6]",$hgreen);
$im2->string(gdSmallFont,$hmargin+$spalte4,&ytransform2($tempstart2)+8,"Letzter Wert",$black2);
$im2->string(gdSmallFont,$hmargin+$spalte4,&ytransform2($tempstart2)+20,"$lastc[2]",$dbraun2);
$im2->string(gdSmallFont,$hmargin+$spalte4+40,&ytransform2($tempstart2)+20,"$lastt[2]",$dbraun2);
$im->string(gdSmallFont,$hmargin,&ytransform($tempstart)+120,$date,$black);
$im->string(gdSmallFont,$hmargin+$spalte3,&ytransform($tempstart)+120,"Gelbe Werte:",$gelb);
$im->string(gdSmallFont,$hmargin+$spalte3+80,&ytransform($tempstart)+120,"Sensor ausgefallen",$black);
$im->string(gdSmallFont,$hmargin+$spalte4+150,&ytransform($tempstart)+120,"$text",$black);
$im2->string(gdSmallFont,$hmargin,&ytransform2($tempstart2)+120,$date,$black2);
$im2->string(gdSmallFont,$hmargin+$spalte3,&ytransform2($tempstart2)+120,"Gelbe Werte:",$gelb2);
$im2->string(gdSmallFont,$hmargin+$spalte3+80,&ytransform2($tempstart2)+120,"Sensor ausgefallen",$black2);
# Graphiken abspeichern
open( PLOT, ">$ablage");
print PLOT $im->gif;
close(PLOT);
open( PLOT, ">$ablage1");
print PLOT $im2->gif;
close(PLOT);
# und hochladen
$ftp = Net::FTP->new("212.223.70.187");
$ftp->login("mein Benutzername","Mein Passwort");
$ftp->cwd("/temper");
$ftp->binary();
$ftp->put("$ablage2");
$ftp->put("$ablage1");
# sowie upload.log abarbeiten
open(UPLOAD, ";
close(UPLOAD);
open(UPLOADN, ">/var/log/digitemp/upload.neu");
$ftp->ascii();
foreach $zeile (@upload)
 {
 ($verz,$datei) = split(" ", $zeile);
 $ftp->mkdir("/temper/$verz");
 $ftp->cwd("/temper/$verz");
 $ftp->put("$datei")|| print UPLOADN "$verz $datei\n";
 };
close(UPLOADN);
# Nicht hochgeladene Dateien merken
system "mv -f /var/log/digitemp/upload.neu /var/log/digitemp/upload.log";
# und ende!
$ftp->quit; |