- my $period = $_[0];
-
- RRDs::graph ("$graphs/memory-$period.png",
- "--start", "-1$period", "-aPNG", "-i", "-z",
- "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
- "--color", "SHADEA".$color{"color19"},
- "--color", "SHADEB".$color{"color19"},
- "--color", "BACK".$color{"color21"},
- "-t $tr{'memory usage per'} $tr{$period}",
- "DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
- "DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
- "DEF:shared=$rrdlog/mem.rrd:memshared:AVERAGE",
- "DEF:buffer=$rrdlog/mem.rrd:membuffers:AVERAGE",
- "DEF:cache=$rrdlog/mem.rrd:memcache:AVERAGE",
- "CDEF:total=used,free,+",
- "CDEF:used2=used,buffer,cache,shared,+,+,-",
- "CDEF:usedpct=100,used2,total,/,*",
- "CDEF:sharedpct=100,shared,total,/,*",
- "CDEF:bufferpct=100,buffer,total,/,*",
- "CDEF:cachepct=100,cache,total,/,*",
- "CDEF:freepct=100,free,total,/,*",
- "AREA:usedpct".$color{"color11"}.":$tr{'used memory'}",
- "STACK:sharedpct".$color{"color13"}.":$tr{'shared memory'}",
- "STACK:bufferpct".$color{"color23"}.":$tr{'buffered memory'}",
- "STACK:cachepct".$color{"color14"}.":$tr{'cached memory'}",
- "STACK:freepct".$color{"color12"}.":$tr{'free memory'}\\j",
- "COMMENT: \\j",
- "COMMENT:$tr{'maximal'}",
- "COMMENT:$tr{'average'}",
- "COMMENT:$tr{'current'}\\j",
- "GPRINT:usedpct:MAX:$tr{'used memory'}\\:%3.2lf%%",
- "GPRINT:usedpct:AVERAGE:$tr{'used memory'}\\:%3.2lf%%",
- "GPRINT:usedpct:LAST:$tr{'used memory'}\\:%3.2lf%%\\j",
- "GPRINT:sharedpct:MAX:$tr{'shared memory'}\\:%3.2lf%%",
- "GPRINT:sharedpct:AVERAGE:$tr{'shared memory'}\\:%3.2lf%%",
- "GPRINT:sharedpct:LAST:$tr{'shared memory'}\\:%3.2lf%%\\j",
- "GPRINT:bufferpct:MAX:$tr{'buffered memory'}\\:%3.2lf%%",
- "GPRINT:bufferpct:AVERAGE:$tr{'buffered memory'}\\:%3.2lf%%",
- "GPRINT:bufferpct:LAST:$tr{'buffered memory'}\\:%3.2lf%%\\j",
- "GPRINT:cachepct:MAX:$tr{'cached memory'}\\:%3.2lf%%",
- "GPRINT:cachepct:AVERAGE:$tr{'cached memory'}\\:%3.2lf%%",
- "GPRINT:cachepct:LAST:$tr{'cached memory'}\\:%3.2lf%%\\j",
- "GPRINT:freepct:MAX:$tr{'free memory'}\\:%3.2lf%%",
- "GPRINT:freepct:AVERAGE:$tr{'free memory'}\\:%3.2lf%%",
- "GPRINT:freepct:LAST:$tr{'free memory'}\\:%3.2lf%%\\j");
- $ERROR = RRDs::error;
- print "Error in RRD::graph for mem: $ERROR\n" if $ERROR;
-
- RRDs::graph ("$graphs/swap-$period.png",
- "--start", "-1$period", "-aPNG", "-i", "-z",
- "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
- "--color", "SHADEA".$color{"color19"},
- "--color", "SHADEB".$color{"color19"},
- "--color", "BACK".$color{"color21"},
- "-t $tr{'swap usage per'} $tr{$period}",
- "DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
- "DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
- "CDEF:total=used,free,+",
- "CDEF:usedpct=100,used,total,/,*",
- "CDEF:freepct=100,free,total,/,*",
- "AREA:usedpct".$color{"color11"}.":$tr{'used swap'}",
- "STACK:freepct".$color{"color12"}.":$tr{'free swap'}\\j",
- "COMMENT: \\j",
- "COMMENT:$tr{'maximal'}",
- "COMMENT:$tr{'average'}",
- "COMMENT:$tr{'current'}\\j",
- "GPRINT:usedpct:MAX:$tr{'used swap'}\\:%3.2lf%%",
- "GPRINT:usedpct:AVERAGE:$tr{'used swap'}\\:%3.2lf%%",
- "GPRINT:usedpct:LAST:$tr{'used swap'}\\:%3.2lf%%\\j",
- "GPRINT:freepct:MAX:$tr{'free swap'}\\:%3.2lf%%",
- "GPRINT:freepct:AVERAGE:$tr{'free swap'}\\:%3.2lf%%",
- "GPRINT:freepct:LAST:$tr{'free swap'}\\:%3.2lf%%\\j");
- $ERROR = RRDs::error;
- print "Error in RRD::graph for swap: $ERROR\n" if $ERROR;
+ my $period = $_[0];
+
+ RRDs::graph ("$graphs/memory-$period.png",
+ "--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
+ "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
+ "--color", "SHADEA".$color{"color19"},
+ "--color", "SHADEB".$color{"color19"},
+ "--color", "BACK".$color{"color21"},
+ "-t $Lang::tr{'memory usage per'} $Lang::tr{$period}",
+ "DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
+ "DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
+ "DEF:shared=$rrdlog/mem.rrd:memshared:AVERAGE",
+ "DEF:buffer=$rrdlog/mem.rrd:membuffers:AVERAGE",
+ "DEF:cache=$rrdlog/mem.rrd:memcache:AVERAGE",
+ "CDEF:total=used,free,+",
+ "CDEF:used2=used,buffer,cache,shared,+,+,-",
+ "CDEF:usedpct=100,used2,total,/,*",
+ "CDEF:sharedpct=100,shared,total,/,*",
+ "CDEF:bufferpct=100,buffer,total,/,*",
+ "CDEF:cachepct=100,cache,total,/,*",
+ "CDEF:freepct=100,free,total,/,*",
+ "COMMENT:$Lang::tr{'caption'}\\t\\t\\t",
+ "COMMENT:$Lang::tr{'maximal'}",
+ "COMMENT:$Lang::tr{'average'}",
+ "COMMENT:$Lang::tr{'minimal'}",
+ "COMMENT:$Lang::tr{'current'}\\j",
+ "AREA:usedpct".$color{"color11"}.":$Lang::tr{'used memory'}",
+ "GPRINT:usedpct:MAX:%3.2lf%%",
+ "GPRINT:usedpct:AVERAGE:%3.2lf%%",
+ "GPRINT:usedpct:MIN:%3.2lf%%",
+ "GPRINT:usedpct:LAST:%3.2lf%%\\j",
+ "STACK:sharedpct".$color{"color13"}.":$Lang::tr{'shared memory'}",
+ "GPRINT:sharedpct:MAX:%3.2lf%%",
+ "GPRINT:sharedpct:AVERAGE:%3.2lf%%",
+ "GPRINT:sharedpct:MIN:%3.2lf%%",
+ "GPRINT:sharedpct:LAST:%3.2lf%%\\j",
+ "STACK:bufferpct".$color{"color23"}.":$Lang::tr{'buffered memory'}",
+ "GPRINT:bufferpct:MAX:%3.2lf%%",
+ "GPRINT:bufferpct:AVERAGE:%3.2lf%%",
+ "GPRINT:bufferpct:MIN:%3.2lf%%",
+ "GPRINT:bufferpct:LAST:%3.2lf%%\\j",
+ "STACK:cachepct".$color{"color14"}.":$Lang::tr{'cached memory'}",
+ "GPRINT:cachepct:MAX:%3.2lf%%",
+ "GPRINT:cachepct:AVERAGE:%3.2lf%%",
+ "GPRINT:cachepct:MIN:%3.2lf%%",
+ "GPRINT:cachepct:LAST:%3.2lf%%\\j",
+ "STACK:freepct".$color{"color12"}.":$Lang::tr{'free memory'}",
+ "GPRINT:freepct:MAX:%3.2lf%%",
+ "GPRINT:freepct:AVERAGE:%3.2lf%%",
+ "GPRINT:freepct:MIN:%3.2lf%%",
+ "GPRINT:freepct:LAST:%3.2lf%%\\j");
+ $ERROR = RRDs::error;
+ print "Error in RRD::graph for mem: $ERROR\n" if $ERROR;
+
+ RRDs::graph ("$graphs/swap-$period.png",
+ "--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
+ "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
+ "--color", "SHADEA".$color{"color19"},
+ "--color", "SHADEB".$color{"color19"},
+ "--color", "BACK".$color{"color21"},
+ "-t $Lang::tr{'swap usage per'} $Lang::tr{$period}",
+ "DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
+ "DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
+ "CDEF:total=used,free,+",
+ "CDEF:usedpct=100,used,total,/,*",
+ "CDEF:freepct=100,free,total,/,*",
+ "COMMENT:$Lang::tr{'caption'}\\t\\t",
+ "COMMENT:$Lang::tr{'maximal'}",
+ "COMMENT:$Lang::tr{'average'}",
+ "COMMENT:$Lang::tr{'minimal'}",
+ "COMMENT:$Lang::tr{'current'}\\j",
+ "AREA:usedpct".$color{"color11"}.":$Lang::tr{'used swap'}",
+ "GPRINT:usedpct:MAX:%3.2lf%%",
+ "GPRINT:usedpct:AVERAGE:%3.2lf%%",
+ "GPRINT:usedpct:MIN:%3.2lf%%",
+ "GPRINT:usedpct:LAST:%3.2lf%%\\j",
+ "STACK:freepct".$color{"color12"}.":$Lang::tr{'free swap'}",
+ "GPRINT:freepct:MAX:%3.2lf%%",
+ "GPRINT:freepct:AVERAGE:%3.2lf%%",
+ "GPRINT:freepct:MIN:%3.2lf%%",
+ "GPRINT:freepct:LAST:%3.2lf%%\\j");
+ $ERROR = RRDs::error;
+ print "Error in RRD::graph for swap: $ERROR\n" if $ERROR;