my $ERROR;
+my @GRAPH_ARGS = (
+ # Output format
+ "--imgformat", "PNG",
+
+ # No border
+ "--border", "0",
+
+ # For a more 'organic' look
+ "--slope-mode",
+
+ # HxW define the size of the output image
+ "--full-size-mode",
+
+ # Watermark
+ "-W www.ipfire.org",
+
+ # Default size
+ "-w 910",
+ "-h 300",
+
+ # Use alternative grid
+ "--alt-y-grid",
+);
+
# Read the global settings files to get the current theme and after this load
# colors for this theme
# 3 if given is the height of the iframe default if nothing is given
sub makegraphbox {
- my $height = 285;
- my $width = 700;
-
- if ( $_[3] ne "" ){ $height = $_[3]; }
-
print "<center>";
print "<a href='".$_[0]."?".$_[1]."?hour' target='".$_[1]."box'><b>".$Lang::tr{'hour'}."</b></a>";
print " - ";
print " - ";
print "<a href='".$_[0]."?".$_[1]."?year' target='".$_[1]."box'><b>".$Lang::tr{'year'}."</b></a>";
print "<br></center>";
- print "<iframe src='".$_[0]."?".$_[1]."?".$_[2]."' width='".$width."' height='".$height."' scrolling='no' frameborder='no' marginheight='0' name='".$_[1]."box'></iframe>";
+ print "<iframe class='graph' src='".$_[0]."?".$_[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
my $cpucount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/cpu-*/ 2>/dev/null | wc -l`;
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-u 100",
"-r",
sub updateloadgraph {
my $period = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-r",
"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
sub updatememorygraph {
my $period = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-u 100",
"-r",
sub updateswapgraph {
my $period = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-u 100",
"-r",
my $count="0";
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-r",
"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
my $count="0";
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-r",
"-t ".$Lang::tr{'processes'}." ".$Lang::tr{'memory'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
my $disk = $_[0];
my $period = $_[1];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$disk." ".$Lang::tr{'disk access per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
my $interface = $_[0];
my $period = $_[1];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
my $interface = $_[0];
my $period = $_[1];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
my $interface = $_[0];
my $period = $_[1];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
sub updatefwhitsgraph {
my $period = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'firewall hits per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
my $period = $_[1];
my $host = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-l 0",
"-r",
"-t ".$Lang::tr{'linkq'}." ".$host." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
my $period = $_[1];
my $interface = $_[0];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-t Wireless ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v dBm",
"--color=SHADEA".$color{"color19"},
my $disk = $_[0];
my $period = $_[1];
RRDs::graph(
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$disk." ".$Lang::tr{'harddisk temperature'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v Celsius",
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'mbmon temp'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"--color=SHADEA".$color{"color19"},
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'mbmon fan'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"--color=SHADEA".$color{"color19"},
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'mbmon volt'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"--color=SHADEA".$color{"color19"},
my $color="#000000";
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'Utilization on'}." (".$qossettings{'DEV'}.") ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
"-v ".$Lang::tr{'bytes per second'},
my $cpucount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/cpu-*/ 2>/dev/null | wc -l`;
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t ".$Lang::tr{'cpu frequency per'}." ".$Lang::tr{$period."-graph"},
"-v MHz",
my $thermalcount = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/thermal-thermal_zone* 2>/dev/null | wc -l`;
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 125",
"-r",
"-t "."ACPI Thermal-Zone Temperature"." - ".$Lang::tr{$period."-graph"},
"-v Grad Celsius",
sub updateentropygraph {
my $period = $_[0];
my @command = (
+ @GRAPH_ARGS,
"-",
"--start",
"-1".$period,
- "-aPNG",
- "-i",
- "-z",
- "-W www.ipfire.org",
- "--alt-y-grid",
- "-w 600",
- "-h 225",
"-r",
"--lower-limit","0",
"-t $Lang::tr{'entropy'}",
"GPRINT:entrmax:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'maximum'}),
"GPRINT:entrmin:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'minimum'}),
"GPRINT:entravg:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'average'}) . "\\n",
+ "--color=BACK".$color{"color21"},
);
RRDs::graph (@command);
etc/httpd/conf/server-tuning.conf
etc/rc.d/init.d/unbound
etc/sysctl.conf
+srv/web/ipfire/cgi-bin/entropy.cgi
+srv/web/ipfire/cgi-bin/hardwaregraphs.cgi
srv/web/ipfire/cgi-bin/index.cgi
+srv/web/ipfire/cgi-bin/netovpnsrv.cgi
+srv/web/ipfire/cgi-bin/qos.cgi
+srv/web/ipfire/cgi-bin/system.cgi
srv/web/ipfire/cgi-bin/vpnmain.cgi
+srv/web/ipfire/html/themes/darkdos/include/style.css
+srv/web/ipfire/html/themes/ipfire/include/css/style.css
+srv/web/ipfire/html/themes/maniac/include/style.css
usr/lib/libssp.so.0
usr/lib/libssp.so.0.0.0
usr/local/bin/xt_geoip_update
var/ipfire/langs
+var/ipfire/graphs.pl
&Header::openbigbox('100%', 'left');
&Header::openbox('100%', 'center', $Lang::tr{'entropy'});
- &Graphs::makegraphbox("entropy.cgi", "day", '', 350);
+ &Graphs::makegraphbox("entropy.cgi", "day");
&Header::closebox();
# Check for hardware support.
if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/temperature-* 2>/dev/null` ) {
&Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}");
- &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day","375");
+ &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day");
Header::closebox();
}
if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/voltage-* 2>/dev/null` ) {
&Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}");
- &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","435");
+ &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day");
&Header::closebox();
}
if (@vpns){
foreach (@vpns) {
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
- &Graphs::makegraphbox("netovpnsrv.cgi",$_, "day",320);
+ &Graphs::makegraphbox("netovpnsrv.cgi",$_, "day");
&Header::closebox();
}
}else{
}
&Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}, $Lang::tr{'uplink'}");
- &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour","325");
+ &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour");
&Header::closebox();
&Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}, $Lang::tr{'downlink'}");
- &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour","325");
+ &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour");
&Header::closebox();
&showclasses($qossettings{'RED_DEV'});
&Header::openbigbox('100%', 'left');
&Header::openbox('100%', 'center', "CPU $Lang::tr{'graph'}");
- &Graphs::makegraphbox("system.cgi","cpu","day","325");
+ &Graphs::makegraphbox("system.cgi","cpu","day");
&Header::closebox();
if ( -e "$mainsettings{'RRDLOG'}/collectd/localhost/cpufreq/cpufreq-0.rrd"){
&Header::openbox('100%', 'center', "CPU $Lang::tr{'graph'}");
- &Graphs::makegraphbox("system.cgi","cpufreq","day","325");
+ &Graphs::makegraphbox("system.cgi","cpufreq","day");
&Header::closebox();
}
#rx_kbs { color: green; }
#tx_kbs { color: red; }
+
+iframe.graph {
+ width: 100%;
+ min-height: 300px;
+}
table.fw-nat tbody tr td {
height: 2.25em;
}
+
+iframe.graph {
+ width: 100%;
+ min-height: 300px;
+}
#rx_kbs { color: green; }
#tx_kbs { color: red; }
+
+iframe.graph {
+ width: 100%;
+ min-height: 300px;
+}