[10/12] statusmail: Graph infrastructure changes

Message ID 20190405172940.13168-11-ipfr@tfitzgeorge.me.uk
State Dropped
Headers
Series statusmail: Status and Log Summary Emails |

Commit Message

Tim FitzGeorge April 6, 2019, 4:29 a.m. UTC
  Modifies graphs.pl to expect the second parameter to include the number
as well as the unit, that is 1hour instead of hour. makegraphbox is
modified to pass the number.
The change to entropy.cgi as because it passes the period as the
first parameter instead of the second.

Signed-off-by: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
---
 config/cfgroot/graphs.pl | 274 ++++++++++++++++++++++++++++++++++-------------
 html/cgi-bin/entropy.cgi |   2 +-
 langs/de/cgi-bin/de.pl   |   1 +
 langs/es/cgi-bin/es.pl   |   1 +
 langs/it/cgi-bin/it.pl   |   1 +
 langs/nl/cgi-bin/nl.pl   |   1 +
 langs/pl/cgi-bin/pl.pl   |   1 +
 langs/tr/cgi-bin/tr.pl   |   1 +
 8 files changed, 207 insertions(+), 75 deletions(-)
  

Patch

diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
index 1bed49fa3..25e62b4ac 100644
--- a/config/cfgroot/graphs.pl
+++ b/config/cfgroot/graphs.pl
@@ -3,7 +3,6 @@ 
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2005-2010  IPFire Team                                        #
+# Copyright (C) 2005-2019  IPFire Team                                        #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -102,17 +103,17 @@  foreach (@sensorsdir){
 
 sub makegraphbox {
 	print "<center>";
-	print "<a href='".$_[0]."?".$_[1]."?hour' target='".$_[1]."box'><b>".$Lang::tr{'hour'}."</b></a>";
+	print "<a href='".$_[0]."?".$_[1]."?1hour' target='".$_[1]."box'><b>".$Lang::tr{'hour'}."</b></a>";
 	print " - ";
-	print "<a href='".$_[0]."?".$_[1]."?day' target='".$_[1]."box'><b>".$Lang::tr{'day'}."</b></a>";
+	print "<a href='".$_[0]."?".$_[1]."?1day' target='".$_[1]."box'><b>".$Lang::tr{'day'}."</b></a>";
 	print " - ";
-	print "<a href='".$_[0]."?".$_[1]."?week' target='".$_[1]."box'><b>".$Lang::tr{'week'}."</b></a>";
+	print "<a href='".$_[0]."?".$_[1]."?1week' target='".$_[1]."box'><b>".$Lang::tr{'week'}."</b></a>";
 	print " - ";
-	print "<a href='".$_[0]."?".$_[1]."?month' target='".$_[1]."box'><b>".$Lang::tr{'month'}."</b></a>";
+	print "<a href='".$_[0]."?".$_[1]."?1month' target='".$_[1]."box'><b>".$Lang::tr{'month'}."</b></a>";
 	print " - ";
-	print "<a href='".$_[0]."?".$_[1]."?year' target='".$_[1]."box'><b>".$Lang::tr{'year'}."</b></a>";
+	print "<a href='".$_[0]."?".$_[1]."?1year' target='".$_[1]."box'><b>".$Lang::tr{'year'}."</b></a>";
 	print "<br></center>";
-	print "<iframe class='graph' src='".$_[0]."?".$_[1]."?".$_[2]."' scrolling='no' frameborder='no' marginheight='0' name='".$_[1]."box'></iframe>";
+	print "<iframe class='graph' src='".$_[0]."?".$_[1]."?1".$_[2]."' scrolling='no' frameborder='no' marginheight='0' name='".$_[1]."box'></iframe>";
 }
 
 # Generate the CPU Graph for the current period of time for values given by
@@ -120,16 +121,22 @@  sub makegraphbox {
 
 sub updatecpugraph {
 	my $cpucount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/cpu-*/ 2>/dev/null | wc -l`;
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-u 100",
 		"-r",
-		"-t ".$Lang::tr{'cpu usage per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'cpu usage per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'percentage'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -140,7 +147,7 @@  sub updatecpugraph {
 		"COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),
 		"COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j"
 	);
-	
+
 	my $nice = "CDEF:nice=";
 	my $interrupt = "CDEF:interrupt=";
 	my $steal = "CDEF:steal=";
@@ -150,7 +157,7 @@  sub updatecpugraph {
 	my $iowait = "CDEF:iowait=";
 	my $irq = "CDEF:irq=";
 	my $addstring = "";
-	
+
 	for(my $i = 0; $i < $cpucount; $i++) {
 		push(@command,"DEF:iowait".$i."=".$mainsettings{'RRDLOG'}."/collectd/localhost/cpu-".$i."/cpu-wait.rrd:value:AVERAGE"
 				,"DEF:nice".$i."=".$mainsettings{'RRDLOG'}."/collectd/localhost/cpu-".$i."/cpu-nice.rrd:value:AVERAGE"
@@ -170,7 +177,7 @@  sub updatecpugraph {
 		$iowait .= "iowait".$i.",";
 		$irq .= "irq".$i.",";
 	}
-	
+
 	for(my $i = 2; $i < $cpucount; $i++) {
 		$addstring .= "+,";
 	}
@@ -248,15 +255,21 @@  sub updatecpugraph {
 # Generate the Load Graph for the current period of time for values given by collecd
 
 sub updateloadgraph {
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-r",
-		"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t Load Average ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'processes'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -280,16 +293,22 @@  sub updateloadgraph {
 # Generate the Memory Graph for the current period of time for values given by collecd
 
 sub updatememorygraph {
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-u 100",
 		"-r",
-		"-t ".$Lang::tr{'memory usage per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'memory usage per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'percentage'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -336,16 +355,22 @@  sub updatememorygraph {
 # Generate the Swap Graph for the current period of time for values given by collecd
 
 sub updateswapgraph {
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-u 100",
 		"-r",
-		"-t ".$Lang::tr{'swap usage per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'swap usage per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'percentage'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -386,17 +411,23 @@  sub updateswapgraph {
 
 sub updateprocessescpugraph {
 	my @processesgraph = getprocesses();
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my $count="0";
 
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-r",
-		"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
 		"--color=BACK".$color{"color21"}
@@ -433,17 +464,23 @@  sub updateprocessescpugraph {
 
 sub updateprocessesmemorygraph {
 	my @processesgraph = getprocesses();
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my $count="0";
 
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-r",
-		"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'memory'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'memory'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -479,14 +516,20 @@  sub updateprocessesmemorygraph {
 
 sub updatediskgraph {
 	my $disk    = $_[0];
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$disk." ".$Lang::tr{'disk access per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$disk." ".$Lang::tr{'disk access per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -523,14 +566,20 @@  sub updatediskgraph {
 
 sub updateifgraph {
 	my $interface = $_[0];
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -560,14 +609,20 @@  sub updateifgraph {
 
 sub updatevpngraph {
 	my $interface = $_[0];
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -597,14 +652,20 @@  sub updatevpngraph {
 
 sub updatevpnn2ngraph {
 	my $interface = $_[0];
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -661,14 +722,20 @@  sub updatevpnn2ngraph {
 # Generate the Firewall Graph for the current period of time for values given by collecd
 
 sub updatefwhitsgraph {
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'firewall hits per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'firewall hits per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -716,16 +783,22 @@  sub updatefwhitsgraph {
 # Generate the Line Quality Graph for the current period of time for values given by collecd
 
 sub updatepinggraph {
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my $host    = $_[0];
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-l 0",
 		"-r",
-		"-t ".$Lang::tr{'linkq'}." ".$host." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'linkq'}." ".$host." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ms",
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -756,14 +829,20 @@  sub updatepinggraph {
 }
 
 sub updatewirelessgraph {
-	my $period    = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my $interface    = $_[0];
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
-		"-t Wireless ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-".$number.$period,
+		"-t Wireless ".$interface." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v dBm",
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -794,14 +873,20 @@  sub updatewirelessgraph {
 
 sub updatehddgraph {
 	my $disk = $_[0];
-	my $period = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	RRDs::graph(
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$disk." ".$Lang::tr{'harddisk temperature'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$disk." ".$Lang::tr{'harddisk temperature'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v Celsius",
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -827,15 +912,21 @@  sub updatehddgraph {
 # Generate the Temp Graph for the current period of time for values given by collecd and lm_sensors
 
 sub updatehwtempgraph {
-	my $period = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'mbmon temp'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'mbmon temp'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
 		"--color=BACK".$color{"color21"},
@@ -874,15 +965,21 @@  sub updatehwtempgraph {
 # Generate the Fan Graph for the current period of time for values given by collecd and lm_sensors
 
 sub updatehwfangraph {
-	my $period = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'mbmon fan'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'mbmon fan'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
 		"--color=BACK".$color{"color21"},
@@ -921,15 +1018,21 @@  sub updatehwfangraph {
 # Generate the Voltage Graph for the current period of time for values given by collecd and lm_sensors
 
 sub updatehwvoltgraph {
-	my $period = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'mbmon volt'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'mbmon volt'}." ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
 		"--color=BACK".$color{"color21"},
@@ -969,8 +1072,13 @@  sub updatehwvoltgraph {
 # Generate the QoS Graph for the current period of time
 
 sub updateqosgraph {
-
-	my $period = $_[1];
+	my ($number, $period) = $_[1] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my %qossettings = ();
 	&General::readhash("${General::swroot}/qos/settings", \%qossettings);
 
@@ -994,9 +1102,9 @@  sub updateqosgraph {
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'Utilization on'}." (".$qossettings{'DEV'}.") ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'Utilization on'}." (".$qossettings{'DEV'}.") ".$Lang::tr{'graph per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'bytes per second'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -1042,14 +1150,20 @@  sub updateqosgraph {
 
 sub updatecpufreqgraph {
 	my $cpucount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/cpu-*/ 2>/dev/null | wc -l`;
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t ".$Lang::tr{'cpu frequency per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'cpu frequency per'}.$numstr.$Lang::tr{$period."-graph"},
 		"-v MHz",
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -1081,14 +1195,20 @@  sub updatecpufreqgraph {
 
 sub updatethermaltempgraph {
 	my $thermalcount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/thermal-thermal_zone* 2>/dev/null | wc -l`;
-	my $period    = $_[0];
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
 	my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
-		"-t "."ACPI Thermal-Zone Temperature"." - ".$Lang::tr{$period."-graph"},
+		"-t "."ACPI Thermal-Zone Temperature"." -$numstr".$Lang::tr{$period."-graph"},
 		"-v Grad Celsius",
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
@@ -1134,12 +1254,18 @@  sub getprocesses {
 }
 
 sub updateentropygraph {
-	my $period    = $_[0];
-	my @command = (
+	my ($number, $period) = $_[0] =~ m/(\d+)(\D+)s?/;
+	my $numstr = ' ';
+	if ($number > 1)
+	{
+      $period .= 's';
+      $numstr = " $number ";
+    }
+  my @command = (
 		@GRAPH_ARGS,
 		"-",
 		"--start",
-		"-1".$period,
+		"-".$number.$period,
 		"-r",
 		"--lower-limit","0",
 		"-t $Lang::tr{'entropy'}",
diff --git a/html/cgi-bin/entropy.cgi b/html/cgi-bin/entropy.cgi
index d7a9ca5d8..f8045db5a 100644
--- a/html/cgi-bin/entropy.cgi
+++ b/html/cgi-bin/entropy.cgi
@@ -45,7 +45,7 @@  if ( $querry[0] ne~ "") {
 	&Header::openbigbox('100%', 'left');
 
 	&Header::openbox('100%', 'center', $Lang::tr{'entropy'});
-	&Graphs::makegraphbox("entropy.cgi", "day");
+	&Graphs::makegraphbox("entropy.cgi", "entropy", "day");
 	&Header::closebox();
 
 	# Check for hardware support.
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
index 88b34d23b..855d8d33f 100644
--- a/langs/de/cgi-bin/de.pl
+++ b/langs/de/cgi-bin/de.pl
@@ -1320,6 +1320,7 @@ 
 'hosts config changed' => 'Hosts-Konfiguration geändert',
 'hour' => 'Stunde',
 'hour-graph' => 'Stunde',
+'hours-graph' => 'Stunden',
 'hours' => 'Stunden',
 'hours2' => 'Stunden',
 'ibod for dual isdn only' => 'iBOD kann nur bei ISDN-Kanalbündelung genutzt werden.',
diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl
index 23bc20727..cb0471f12 100644
--- a/langs/es/cgi-bin/es.pl
+++ b/langs/es/cgi-bin/es.pl
@@ -915,6 +915,7 @@ 
 'hosts config changed' => 'Configuración de hosts ha cambiado',
 'hour' => 'Hora',
 'hour-graph' => 'Hora',
+'hours-graph' => 'Horas',
 'hours' => 'horas',
 'hours2' => 'Horas',
 'ibod for dual isdn only' => 'iBPD sólo puede usarse con ISDN dual',
diff --git a/langs/it/cgi-bin/it.pl b/langs/it/cgi-bin/it.pl
index 6c9137c28..586ae882c 100644
--- a/langs/it/cgi-bin/it.pl
+++ b/langs/it/cgi-bin/it.pl
@@ -1217,6 +1217,7 @@ 
 'hosts config changed' => 'Hosts config changed',
 'hour' => 'Ora',
 'hour-graph' => 'Ora',
+'hours-graph' => 'Ore',
 'hours' => 'Ore',
 'hours2' => 'Ore',
 'ibod for dual isdn only' => 'iBOD can only be used with Dual ISDN.',
diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl
index 5fa89b1ac..75c2b63f4 100644
--- a/langs/nl/cgi-bin/nl.pl
+++ b/langs/nl/cgi-bin/nl.pl
@@ -1198,6 +1198,7 @@ 
 'hosts config changed' => 'Hosts configuratie gewijzigd',
 'hour' => 'Uur',
 'hour-graph' => 'Uur',
+'hours-graph' => 'Uren',
 'hours' => 'uren',
 'hours2' => 'Uren',
 'ibod for dual isdn only' => 'iBOD kan alleen gebruikt worden met Dual ISDN.',
diff --git a/langs/pl/cgi-bin/pl.pl b/langs/pl/cgi-bin/pl.pl
index 521381af2..8742f0c29 100644
--- a/langs/pl/cgi-bin/pl.pl
+++ b/langs/pl/cgi-bin/pl.pl
@@ -914,6 +914,7 @@ 
 'hosts config changed' => 'Zmieniona konfiguracja hostów',
 'hour' => 'Godzina',
 'hour-graph' => 'Godzina',
+'hours-graph' => 'Godziny',
 'hours' => 'Godziny',
 'hours2' => 'Godziny',
 'ibod for dual isdn only' => 'iBOD can only be used with Dual ISDN.',
diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl
index 1917b8241..0e7bb3219 100644
--- a/langs/tr/cgi-bin/tr.pl
+++ b/langs/tr/cgi-bin/tr.pl
@@ -1341,6 +1341,7 @@ 
 'hosts config changed' => 'Ana bilgisayar yapılandırması değiştirildi',
 'hour' => 'Saat',
 'hour-graph' => 'saat',
+'hours-graph' => 'saat',
 'hours' => 'saat',
 'hours2' => 'saat',
 'ibod for dual isdn only' => 'iBOD yalnızca çift ISDN ile kullanılabilir.',