]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/scripts/makegraphs
3 ############################################################################
5 # This file is part of the IPCop Firewall. #
7 # IPCop is free software; you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation; either version 2 of the License, or #
10 # (at your option) any later version. #
12 # IPCop is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with IPCop; if not, write to the Free Software #
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21 # Copyright (C) 2004-01-19 Mark Wormgoor <mark@wormgoor.com>. #
23 ############################################################################
29 require "/var/ipfire/general-functions.pl";
30 require "${General::swroot}/lang.pl";
32 my (%settings, @ipacsum, $iface, $ERROR);
33 &General
::readhash
("${General::swroot}/ethernet/settings", \
%settings);
34 my %mbmon_settings = ();
35 &General
::readhash
("${General::swroot}/mbmon/settings", \
%mbmon_settings);
37 # Added for conversion of utf-8 characters
41 # Force language back to English (ugly hack!)
42 # Modified to only force if we are unable to convert charset
44 if ((${Lang
::language
} eq 'el') ||
45 (${Lang
::language
} eq 'fa') ||
46 (${Lang
::language
} eq 'ru') ||
47 (${Lang
::language
} eq 'th') ||
48 (${Lang
::language
} eq 'vi') ||
49 (${Lang
::language
} eq 'zh') ||
50 (${Lang
::language
} eq 'zt')) {
51 eval `/bin/cat "${General::swroot}/langs/en.pl"`;
53 %tr=%Lang::tr
; # use translated version for other languages
57 my $rrdlog = "/var/log/rrd";
58 my $graphs = "/home/httpd/html/graphs";
59 $ENV{PATH
}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
60 my $hdd_device = "/dev/harddisk";
62 my %mbmon_values = ();
69 my $path_smartctl = "/usr/sbin/smartctl";
70 my $path_hddtemp = "/usr/sbin/hddtemp";
73 $colors{"1"} = "#0000FF";
74 $colors{"2"} = "#00FF00";
75 $colors{"3"} = "#FF0000";
76 $colors{"4"} = "#FFD700";
77 $colors{"5"} = "#CCCCCC";
78 $colors{"6"} = "#40E0D0";
79 $colors{"7"} = "#90EE90";
80 $colors{"8"} = "#F4A460";
82 open(MBMON_OUT
, ">/var/log/mbmon-values");
83 open(FD
, "/usr/bin/mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ;
87 next unless( /^([A-Za-z][^:\s]+)\s*:\s*([+\-]{0,1}[\d\.]+)/ ) ;
91 $mbmon_values{$key} = $value;
92 print(MBMON_OUT
"$key=$value\n");
98 my $interface = $_[0];
106 $bytesin += $1 if (/^[\* ]\s+incoming\s+${interface}.+\:\s+(\d+)/);
108 # Forwarded Incoming...
109 $bytesin += $1 if (/^[\* ]\s+forwarded\s+incoming\s+${interface}.+\:\s+(\d+)/);
112 $bytesout += $1 if (/^[* ]\s+outgoing\s+${interface}.+\:\s+(\d+)/);
114 # Forwarded Outgoing...
115 $bytesout += $1 if (/^[* ]\s+forwarded\s+outgoing\s+${interface}.+\:\s+(\d+)/);
117 return "$bytesin:$bytesout";
123 RRDs
::graph
("$graphs/cpu-$period.png",
124 "--start", "-1$period", "-aPNG", "-i", "-z",
125 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
126 "--color", "SHADEA#EAE9EE",
127 "--color", "SHADEB#EAE9EE",
128 "--color", "BACK#FFFFFF",
129 "-t $tr{'cpu usage per'} $tr{$period}",
130 "DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
131 "DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
132 "DEF:idle=$rrdlog/cpu.rrd:idle:AVERAGE",
133 "CDEF:total=user,system,idle,+,+",
134 "CDEF:userpct=100,user,total,/,*",
135 "CDEF:systempct=100,system,total,/,*",
136 "CDEF:idlepct=100,idle,total,/,*",
137 "AREA:userpct#0000FF:$tr{'user cpu usage'}\\j",
138 "STACK:systempct#FF0000:$tr{'system cpu usage'}\\j",
139 "STACK:idlepct#00FF00:$tr{'idle cpu usage'}\\j",
140 "GPRINT:userpct:MAX:$tr{'maximal'} $tr{'user cpu'}\\:%3.2lf%%",
141 "GPRINT:userpct:AVERAGE:$tr{'average'} $tr{'user cpu'}\\:%3.2lf%%",
142 "GPRINT:userpct:LAST:$tr{'current'} $tr{'user cpu'}\\:%3.2lf%%\\j",
143 "GPRINT:systempct:MAX:$tr{'maximal'} $tr{'system cpu'}\\:%3.2lf%%",
144 "GPRINT:systempct:AVERAGE:$tr{'average'} $tr{'system cpu'}\\:%3.2lf%%",
145 "GPRINT:systempct:LAST:$tr{'current'} $tr{'system cpu'}\\:%3.2lf%%\\j",
146 "GPRINT:idlepct:MAX:$tr{'maximal'} $tr{'idle cpu'}\\:%3.2lf%%",
147 "GPRINT:idlepct:AVERAGE:$tr{'average'} $tr{'idle cpu'}\\:%3.2lf%%",
148 "GPRINT:idlepct:LAST:$tr{'current'} $tr{'idle cpu'}\\:%3.2lf%%\\j");
149 $ERROR = RRDs
::error
;
150 print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
154 if ( ! -e
"$rrdlog/cpu.rrd") {
155 RRDs
::create
("$rrdlog/cpu.rrd", "--step=300",
156 "DS:user:COUNTER:600:0:500000000",
157 "DS:system:COUNTER:600:0:500000000",
158 "DS:idle:COUNTER:600:0:500000000",
159 "RRA:AVERAGE:0.5:1:576",
160 "RRA:AVERAGE:0.5:6:672",
161 "RRA:AVERAGE:0.5:24:732",
162 "RRA:AVERAGE:0.5:144:1460");
163 $ERROR = RRDs
::error
;
164 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
167 my ($cpu, $user, $nice, $system, $idle);
169 open STAT
, "/proc/stat";
173 ($cpu, $user, $nice, $system, $idle) = split /\s+/;
179 RRDs
::update
("$rrdlog/cpu.rrd",
180 "-t", "user:system:idle",
181 "N:$user:$system:$idle");
182 $ERROR = RRDs
::error
;
183 print "Error in RRD::update for cpu: $ERROR\n" if $ERROR;
190 RRDs
::graph
("$graphs/memory-$period.png",
191 "--start", "-1$period", "-aPNG", "-i", "-z",
192 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
193 "--color", "SHADEA#EAE9EE",
194 "--color", "SHADEB#EAE9EE",
195 "--color", "BACK#FFFFFF",
196 "-t $tr{'memory usage per'} $tr{$period}",
197 "DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
198 "DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
199 "DEF:shared=$rrdlog/mem.rrd:memshared:AVERAGE",
200 "DEF:buffer=$rrdlog/mem.rrd:membuffers:AVERAGE",
201 "DEF:cache=$rrdlog/mem.rrd:memcache:AVERAGE",
202 "CDEF:total=used,free,+",
203 "CDEF:used2=used,buffer,cache,shared,+,+,-",
204 "CDEF:usedpct=100,used2,total,/,*",
205 "CDEF:sharedpct=100,shared,total,/,*",
206 "CDEF:bufferpct=100,buffer,total,/,*",
207 "CDEF:cachepct=100,cache,total,/,*",
208 "CDEF:freepct=100,free,total,/,*",
209 "AREA:usedpct#0000FF:$tr{'used memory'}\\j",
210 "STACK:sharedpct#FF0000:$tr{'shared memory'}\\j",
211 "STACK:bufferpct#FF00FF:$tr{'buffered memory'}\\j",
212 "STACK:cachepct#FFFF00:$tr{'cached memory'}\\j",
213 "STACK:freepct#00FF00:$tr{'free memory'}\\j",
214 "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used memory'}\\:%3.2lf%%",
215 "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used memory'}\\:%3.2lf%%",
216 "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used memory'}\\:%3.2lf%%\\j",
217 "GPRINT:sharedpct:MAX:$tr{'maximal'} $tr{'shared memory'}\\:%3.2lf%%",
218 "GPRINT:sharedpct:AVERAGE:$tr{'average'} $tr{'shared memory'}\\:%3.2lf%%",
219 "GPRINT:sharedpct:LAST:$tr{'current'} $tr{'shared memory'}\\:%3.2lf%%\\j",
220 "GPRINT:bufferpct:MAX:$tr{'maximal'} $tr{'buffered memory'}\\:%3.2lf%%",
221 "GPRINT:bufferpct:AVERAGE:$tr{'average'} $tr{'buffered memory'}\\:%3.2lf%%",
222 "GPRINT:bufferpct:LAST:$tr{'current'} $tr{'buffered memory'}\\:%3.2lf%%\\j",
223 "GPRINT:cachepct:MAX:$tr{'maximal'} $tr{'cached memory'}\\:%3.2lf%%",
224 "GPRINT:cachepct:AVERAGE:$tr{'average'} $tr{'cached memory'}\\:%3.2lf%%",
225 "GPRINT:cachepct:LAST:$tr{'current'} $tr{'cached memory'}\\:%3.2lf%%\\j",
226 "GPRINT:freepct:MAX:$tr{'maximal'} $tr{'free memory'}\\:%3.2lf%%",
227 "GPRINT:freepct:AVERAGE:$tr{'average'} $tr{'free memory'}\\:%3.2lf%%",
228 "GPRINT:freepct:LAST:$tr{'current'} $tr{'free memory'}\\:%3.2lf%%\\j");
229 $ERROR = RRDs
::error
;
230 print "Error in RRD::graph for mem: $ERROR\n" if $ERROR;
232 RRDs
::graph
("$graphs/swap-$period.png",
233 "--start", "-1$period", "-aPNG", "-i", "-z",
234 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
235 "--color", "SHADEA#EAE9EE",
236 "--color", "SHADEB#EAE9EE",
237 "--color", "BACK#FFFFFF",
238 "-t $tr{'swap usage per'} $tr{$period}",
239 "DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
240 "DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
241 "CDEF:total=used,free,+",
242 "CDEF:usedpct=100,used,total,/,*",
243 "CDEF:freepct=100,free,total,/,*",
244 "AREA:usedpct#0000FF:$tr{'used swap'}\\j",
245 "STACK:freepct#00FF00:$tr{'free swap'}\\j",
246 "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used swap'}\\:%3.2lf%%",
247 "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used swap'}\\:%3.2lf%%",
248 "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used swap'}\\:%3.2lf%%\\j",
249 "GPRINT:freepct:MAX:$tr{'maximal'} $tr{'free swap'}\\:%3.2lf%%",
250 "GPRINT:freepct:AVERAGE:$tr{'average'} $tr{'free swap'}\\:%3.2lf%%",
251 "GPRINT:freepct:LAST:$tr{'current'} $tr{'free swap'}\\:%3.2lf%%\\j");
252 $ERROR = RRDs
::error
;
253 print "Error in RRD::graph for swap: $ERROR\n" if $ERROR;
257 my ($memused, $memfree, $memshared, $membuffers, $memcache, $swapused, $swapfree);
258 if ( ! -e
"$rrdlog/mem.rrd") {
259 RRDs
::create
("$rrdlog/mem.rrd", "--step=300",
260 "DS:memused:ABSOLUTE:600:0:5000000000",
261 "DS:memfree:ABSOLUTE:600:0:5000000000",
262 "DS:memshared:ABSOLUTE:600:0:5000000000",
263 "DS:membuffers:ABSOLUTE:600:0:5000000000",
264 "DS:memcache:ABSOLUTE:600:0:5000000000",
265 "DS:swapused:ABSOLUTE:600:0:5000000000",
266 "DS:swapfree:ABSOLUTE:600:0:5000000000",
267 "RRA:AVERAGE:0.5:1:576",
268 "RRA:AVERAGE:0.5:6:672",
269 "RRA:AVERAGE:0.5:24:732",
270 "RRA:AVERAGE:0.5:144:1460");
271 $ERROR = RRDs
::error
;
272 print "Error in RRD::create for mem: $ERROR\n" if $ERROR;
275 open MEM
, "/proc/meminfo";
279 my @temp = split (/\s+/, $_);
282 $memshared = $temp[4];
283 $membuffers = $temp[5];
284 $memcache = $temp[6];
285 } elsif ($_ =~ /^Swap:/) {
286 my @temp = split (/\s+/, $_);
287 $swapused = $temp[2];
288 $swapfree = $temp[3];
293 RRDs
::update
("$rrdlog/mem.rrd",
294 "-t", "memused:memfree:memshared:membuffers:memcache:swapused:swapfree",
295 "N:$memused:$memfree:$memshared:$membuffers:$memcache:$swapused:$swapfree");
296 $ERROR = RRDs
::error
;
297 print "Error in RRD::update for mem: $ERROR\n" if $ERROR;
300 sub updatediskgraph
{
303 RRDs
::graph
("$graphs/disk-$period.png",
304 "--start", "-1$period", "-aPNG", "-i", "-z",
305 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
306 "--color", "SHADEA#EAE9EE",
307 "--color", "SHADEB#EAE9EE",
308 "--color", "BACK#FFFFFF",
309 "-t $tr{'disk access per'} $tr{$period}",
310 "DEF:read=$rrdlog/disk.rrd:readsect:AVERAGE",
311 "DEF:write=$rrdlog/disk.rrd:writesect:AVERAGE",
312 "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
313 "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
314 "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
315 "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
316 "GPRINT:read:LAST:$tr{'current'} $tr{'read sectors'}\\:%8.0lf\\j",
317 "GPRINT:write:MAX:$tr{'maximal'} $tr{'written sectors'}\\:%8.0lf",
318 "GPRINT:write:AVERAGE:$tr{'average'} $tr{'written sectors'}\\:%8.0lf",
319 "GPRINT:write:LAST:$tr{'current'} $tr{'written sectors'}\\:%8.0lf\\j");
320 $ERROR = RRDs
::error
;
321 print "Error in RRD::graph for disk: $ERROR\n" if $ERROR;
325 my ($readwritereq, $readreq, $readsect, $writereq, $writesect);
326 if ( ! -e
"$rrdlog/disk.rrd") {
327 RRDs
::create
("$rrdlog/disk.rrd", "--step=300",
328 "DS:readsect:COUNTER:600:0:5000000000",
329 "DS:writesect:COUNTER:600:0:5000000000",
330 "RRA:AVERAGE:0.5:1:576",
331 "RRA:AVERAGE:0.5:6:672",
332 "RRA:AVERAGE:0.5:24:732",
333 "RRA:AVERAGE:0.5:144:1460");
334 $ERROR = RRDs
::error
;
335 print "Error in RRD::create for disk: $ERROR\n" if $ERROR;
338 my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
339 $atime, $mtime, $ctime, $blksize, $blocks) = stat("/dev/harddisk");
341 my $major = $rdev >> 8;
342 my $minor = $rdev & 0xFF;
344 open STAT
, "/proc/stat";
345 my @diskstat = <STAT
>;
347 foreach my $line (@diskstat)
350 my @temp = split(/\:\ /,$line);
352 my @devicestat = split(/\ /,$temp[1]);
353 foreach my $stats (@devicestat)
356 my @fields = split(/\((\d+),(\d+)\):\((\d+),(\d+),(\d+),(\d+),(\d+)/,$stats);
357 if ($major eq $fields[1] and $minor eq $fields[2])
359 $readwritereq = $fields[3];
360 $readreq = $fields[4];
361 $readsect = $fields[5];
362 $writereq = $fields[6];
363 $writesect = $fields[7];
369 if ($readsect && $writesect) {
370 RRDs
::update
("$rrdlog/disk.rrd",
371 "-t", "readsect:writesect",
372 "N:$readsect:$writesect");
373 $ERROR = RRDs
::error
;
374 print "Error in RRD::update for disk: $ERROR\n" if $ERROR;
376 print "Error in RRD::update for disk: no data available\n";
380 sub updatediskgraphnew
{
384 RRDs
::graph
("$graphs/disk-$disk-$period.png",
385 "--start", "-1$period", "-aPNG", "-i", "-z",
386 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
387 "--color", "SHADEA#EAE9EE",
388 "--color", "SHADEB#EAE9EE",
389 "--color", "BACK#FFFFFF",
390 "-t $tr{'disk access per'} $tr{$period}",
391 "DEF:read=$rrdlog/disk-$disk.rrd:readsect:AVERAGE",
392 "DEF:write=$rrdlog/disk-$disk.rrd:writesect:AVERAGE",
393 "DEF:sleep=$rrdlog/disk-$disk.rrd:sleeping:AVERAGE",
394 "CDEF:sl_state=sleep,INF,*",
396 "AREA:sl_state#a0a0a0:disk standby\\j",
397 "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
398 "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
400 "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
401 "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
402 "GPRINT:read:LAST:$tr{'current'} $tr{'read sectors'}\\:%8.0lf\\j",
403 "GPRINT:write:MAX:$tr{'maximal'} $tr{'written sectors'}\\:%8.0lf",
404 "GPRINT:write:AVERAGE:$tr{'average'} $tr{'written sectors'}\\:%8.0lf",
405 "GPRINT:write:LAST:$tr{'current'} $tr{'written sectors'}\\:%8.0lf\\j");
406 $ERROR = RRDs
::error
;
407 print "Error in RRD::graph for disk-$disk: $ERROR\n" if $ERROR;
410 sub updatediskdatanew
{
413 my ($readwritereq, $readreq, $readsect, $writereq, $writesect);
414 if ( ! -e
"$rrdlog/disk-$disk.rrd") {
415 RRDs
::create
("$rrdlog/disk-$disk.rrd", "--step=300",
416 "DS:readsect:COUNTER:600:0:5000000000",
417 "DS:writesect:COUNTER:600:0:5000000000",
418 "DS:sleeping:GAUGE:600:0:1",
419 "RRA:AVERAGE:0.5:1:576",
420 "RRA:AVERAGE:0.5:6:672",
421 "RRA:AVERAGE:0.5:24:732",
422 "RRA:AVERAGE:0.5:144:1460");
423 $ERROR = RRDs
::error
;
424 print "Error in RRD::create for disk-$disk: $ERROR\n" if $ERROR;
427 my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
428 $atime, $mtime, $ctime, $blksize, $blocks) = stat("/dev/$disk");
430 my $major = $rdev >> 8;
431 my $minor = ($rdev & 0xFF) >>6;
433 open STAT
, "/proc/stat";
434 my @diskstat = <STAT
>;
436 foreach my $line (@diskstat)
439 my @temp = split(/\:\ /,$line);
441 my @devicestat = split(/\ /,$temp[1]);
442 foreach my $stats (@devicestat)
445 my @fields = split(/\((\d+),(\d+)\):\((\d+),(\d+),(\d+),(\d+),(\d+)/,$stats);
446 if ($major eq $fields[1] and $minor eq $fields[2])
448 $readwritereq = $fields[3];
449 $readreq = $fields[4];
450 $readsect = $fields[5];
451 $writereq = $fields[6];
452 $writesect = $fields[7];
459 my $lastsleepstate=0;
461 if ( -e
"/tmp/hddshutdown-$disk" ) {
462 open STAT
,"/tmp/hddshutdown-$disk";
463 $lastsleepstate = <STAT
>;
465 if ($lastsleepstate==$readwritereq) {
470 if ($readsect && $writesect) {
471 RRDs
::update
("$rrdlog/disk-$disk.rrd",
472 "-t", "readsect:writesect:sleeping",
473 "N:$readsect:$writesect:$sleeping");
474 $ERROR = RRDs
::error
;
475 print "Error in RRD::update for disk-$disk: $ERROR\n" if $ERROR;
477 print "Error in RRD::update for disk-$disk: no data available\n";
482 my $interface = $_[0];
485 RRDs
::graph
("$graphs/$interface-$period.png",
486 "--start", "-1$period", "-aPNG", "-i", "-z",
487 "--alt-y-grid", "-w 600", "-h 100",
488 "--color", "SHADEA#EAE9EE",
489 "--color", "SHADEB#EAE9EE",
490 "--color", "BACK#FFFFFF",
491 "-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
492 "-v$tr{'bytes per second'}",
493 "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
494 "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
495 "AREA:incoming#00FF00:$tr{'incoming traffic in bytes per second'}\\j",
496 "LINE1:outgoing#0000FF:$tr{'outgoing traffic in bytes per second'}\\j",
497 "GPRINT:incoming:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sBps",
498 "GPRINT:incoming:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sBps",
499 "GPRINT:incoming:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sBps\\j",
500 "GPRINT:outgoing:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sBps",
501 "GPRINT:outgoing:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sBps",
502 "GPRINT:outgoing:LAST:$tr{'current'} $tr{'out'}\\:%8.3lf %sBps\\j");
503 $ERROR = RRDs
::error
;
504 print "Error in RRD::graph for $interface: $ERROR\n" if $ERROR;
508 my $interface = $_[0];
510 if ( ! -e
"$rrdlog/$interface.rrd") {
511 RRDs
::create
("$rrdlog/$interface.rrd", "--step=300",
512 "DS:incoming:ABSOLUTE:600:0:12500000",
513 "DS:outgoing:ABSOLUTE:600:0:12500000",
514 "RRA:AVERAGE:0.5:1:576",
515 "RRA:AVERAGE:0.5:6:672",
516 "RRA:AVERAGE:0.5:24:732",
517 "RRA:AVERAGE:0.5:144:1460");
518 $ERROR = RRDs
::error
;
519 print "Error in RRD::create for $interface: $ERROR\n" if $ERROR;
522 my $traffic = gettraffic
($interface);
523 RRDs
::update
("$rrdlog/$interface.rrd",
524 "-t", "incoming:outgoing",
526 $ERROR = RRDs
::error
;
527 print "Error in RRD::update for $interface: $ERROR\n" if $ERROR;
530 sub updatefwhitsgraph
{
531 my $interval = $_[0];
533 RRDs
::graph
("$graphs/firewallhits-$interval-area.png",
534 "--start", "-1$interval", "-aPNG", "-i", "-z",
535 "--alt-y-grid", "-w 600", "-h 200",
536 "--color", "SHADEA#EAE9EE",
537 "--color", "SHADEB#EAE9EE",
538 "--color", "BACK#FFFFFF",
539 "-t firewall hits over the last $interval",
540 "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
541 "AREA:amount#6464FF:firewallhits",
542 "GPRINT:amount:MAX: $tr{'maximal'}\\: %2.2lf %S",
543 "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
544 "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
545 "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
546 "AREA:portamount#FF6464:portscans",
547 "GPRINT:portamount:MAX: $tr{'maximal'}\\: %2.2lf %S",
548 "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
549 "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
550 $ERROR = RRDs
::error
;
551 print "Error in RRD::graph for Firewallhits: $ERROR\n" if $ERROR;
553 RRDs
::graph
("$graphs/firewallhits-$interval-line.png",
554 "--start", "-1$interval", "-aPNG", "-i", "-z",
555 "--alt-y-grid", "-w 600", "-h 200",
556 "--color", "SHADEA#EAE9EE",
557 "--color", "SHADEB#EAE9EE",
558 "--color", "BACK#FFFFFF",
559 "-t firewall hits over the last $interval",
560 "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
561 "LINE2:amount#6464FF:firewallhits",
562 "GPRINT:amount:MAX: $tr{'maximal'}\\: %2.2lf %S",
563 "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
564 "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
565 "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
566 "LINE2:portamount#FF6464:portscans",
567 "GPRINT:portamount:MAX: $tr{'maximal'}\\: %2.2lf %S",
568 "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
569 "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
570 $ERROR = RRDs
::error
;
571 print "Error in RRD::graph for Firewallhits: $ERROR\n" if $ERROR;
574 sub updatefwhitsdata
{
581 if (! -e
"$rrdlog/firewallhits.rrd")
583 RRDs
::create
("$rrdlog/firewallhits.rrd", "--step=300",
584 "DS:amount:GAUGE:600:0:U",
585 "DS:portamount:GAUGE:600:0:U",
586 "RRA:AVERAGE:0.5:1:576",
587 "RRA:AVERAGE:0.5:6:672",
588 "RRA:AVERAGE:0.5:24:732",
589 "RRA:AVERAGE:0.5:144:1460");
590 $ERROR = RRDs
::error
;
591 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
594 system("logtailfwhits /var/log/messages /var/log/fwhits.messages.offset >/tmp/messages.fwhits");
595 if (!(open (FILE
,'/tmp/messages.fwhits'))) {
601 if (/kernel:.*(IN=.*)$/) {
608 system("logtailfwhits /var/log/snort/alert /var/log/snort/fwhits.alert.offset >/tmp/snort.fwhits");
609 if (!(open (FILE
,'/tmp/snort.fwhits'))) {
622 if (!(open (FILE
,'/tmp/messages.fwhits'))) {
628 if (/kernel:.*(Scan.*)$/) {
635 system("rm /tmp/messages.fwhits");
636 system("rm /tmp/snort.fwhits");
638 $portamount = $portaktuell + $alertaktuell;
640 RRDs
::update
("$rrdlog/firewallhits.rrd",
641 "N:$aktuell:$portamount");
642 $ERROR = RRDs
::error
;
643 print "Error in RRD::update for Firewallhits: $ERROR\n" if $ERROR;
646 # Creates and updates a link quality database
647 # -------------------------------------------
649 if ( ! -e
"$rrdlog/lq.rrd") {
650 RRDs
::create
("$rrdlog/lq.rrd", "--step=300",
651 "DS:loss:GAUGE:600:0:100",
652 "DS:roundtrip:GAUGE:600:0:10000",
653 "RRA:AVERAGE:0.5:1:576",
654 "RRA:AVERAGE:0.5:6:672",
655 "RRA:AVERAGE:0.5:24:732",
656 "RRA:AVERAGE:0.5:144:1460");
657 $ERROR = RRDs
::error
;
658 print "Error in RRD::create for link: $ERROR\n" if $ERROR;
663 # LQ_GATEWAY is the ip of your isp's public ip facing you
664 my $LQ_GATEWAY='www.heise.de';
666 my $pingoutput = `ping -c $NUMPINGS -q $LQ_GATEWAY`;
668 my @temp = split (/\/|\
%|\s
/, $pingoutput);
669 $packetloss = $temp[17];
670 $roundtrip = $temp[28];
671 RRDs
::update
("$rrdlog/lq.rrd", "N:$packetloss:$roundtrip");
672 $ERROR = RRDs
::error
;
673 print "Error in RRD::update for line quality: $ERROR\n" if $ERROR;
678 RRDs
::graph
("$graphs/lq-$period.png",
679 "--start", "-1$period", "-aPNG", "-i", "-z",
680 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
681 "-t $tr{'linkq'} ($tr{'graph per'} $tr{$period})",
683 "--color", "SHADEA#EAE9EE",
684 "--color", "SHADEB#EAE9EE",
685 "--color", "BACK#FFFFFF",
686 "-v ms / pkts (% x10)",
687 "DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE",
688 "DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE",
689 "CDEF:roundavg=roundtrip,PREV(roundtrip),+,2,/",
690 "CDEF:loss10=loss,10,*",
691 "CDEF:r0=roundtrip,30,MIN",
692 "CDEF:r1=roundtrip,70,MIN",
693 "CDEF:r2=roundtrip,150,MIN",
694 "CDEF:r3=roundtrip,300,MIN",
695 "AREA:roundtrip#EE7000:>300 ms",
696 "AREA:r3#D88E1B:150-300 ms",
697 "AREA:r2#B9B63F:70-150 ms",
698 "AREA:r1#99E064:30-70 ms",
699 "AREA:r0#80FF80:<30 ms",
700 "AREA:loss10#800000:Packet loss (x10)",
701 "LINE1:roundtrip#707070:",
702 "GPRINT:roundtrip:MAX:$tr{'maximal'}\\:%3.2lf ms",
703 "GPRINT:roundtrip:AVERAGE:$tr{'average'}\\:%3.2lf ms",
704 "GPRINT:roundtrip:LAST:$tr{'current'}\\:%3.2lf ms\\j",
705 "GPRINT:loss:MAX:$tr{'maximal'} Loss\\:%3.2lf%%",
706 "GPRINT:loss:AVERAGE:$tr{'average'} Loss\\:%3.2lf%%",
707 "GPRINT:loss:LAST:$tr{'current'} Loss\\:%3.2lf%%\\j"
709 $ERROR = RRDs
::error
;
710 print "Error in RRD::graph for Link Quality: $ERROR\n" if $ERROR;
715 if ( ! -e
"$rrdlog/hddtemp.rrd")
717 # database did not exist -> create
718 RRDs
::create
("$rrdlog/hddtemp.rrd", "--step=300",
719 "DS:temperature:GAUGE:600:0:100",
720 "RRA:AVERAGE:0.5:1:576",
721 "RRA:AVERAGE:0.5:6:672",
722 "RRA:AVERAGE:0.5:24:732",
723 "RRA:AVERAGE:0.5:144:1460");
724 $ERROR = RRDs
::error
;
725 print "Error in RRD::create for hdd: $ERROR\n" if $ERROR;
730 my $smart_output = '';
732 if ( -e
"$path_smartctl" )
734 system("$path_smartctl -iHA $hdd_device > /var/log/hddgraph_smartctl_out");
737 if ( -e
"$path_hddtemp" )
739 $hdd_output = `$path_hddtemp -qn $hdd_device`;
741 # I know 4 response possible responses:
743 # /dev/harddisk: harddisk type: S.M.A.R.T. not available
744 # /dev/harddisk: harddisk type: no sensor
745 # /dev/harddisk: harddisk type: 37°C or °F
748 if ( index($hdd_output, "S.M.A.R.T.") != -1 )
752 elsif ( index($hdd_output, "no sensor") != -1 )
756 elsif ( index($hdd_output, "$hdd_device") != -1 )
758 $hdd_output =~ /.*:.*:\s*(\d+).*\s/;
763 $hdd_output =~ /(\d+)\s/;
767 elsif ( -e
"/var/log/hddgraph_smartctl_out" )
769 $hdd_output = `cat /var/log/hddgraph_smartctl_out | grep Temperature_`;
770 my @t = split(/\s+/,$hdd_output);
778 # print "hdd $hdd_output \n";
779 # print "temp $temp \n";
781 RRDs
::update
("$rrdlog/hddtemp.rrd", "-t", "temperature", "N:$temp");
783 $ERROR = RRDs
::error
;
784 print "Error in RRD::update for hdd: $ERROR\n" if $ERROR;
790 RRDs
::graph
("$graphs/hddtemp-$period.png",
791 "--start", "-1$period", "-aPNG", "-i", "-z",
792 "--alt-y-grid", "-w 600", "-h 100",
793 "--color", "SHADEA#EAE9EE",
794 "--color", "SHADEB#EAE9EE",
795 "--color", "BACK#FFFFFF",
796 "-t $tr{'harddisk temperature'} ($tr{'graph per'} $tr{$period})",
797 "DEF:temperature=$rrdlog/hddtemp.rrd:temperature:AVERAGE",
798 "LINE2:temperature#0000FF:$tr{'hdd temperature in'} °C",
799 "GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf °C",
800 "GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf °C",
801 "GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf °C",
803 $ERROR = RRDs
::error
;
804 print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
809 if ( ! -e
"$rrdlog/mbmon.rrd" )
811 # database did not exist -> create
813 @args = ("$rrdlog/mbmon.rrd");
815 push(@args, "--step=300");
816 foreach $key ( sort(keys %mbmon_values) )
818 push(@args, "DS:$key:GAUGE:600:U:U");
820 push(@args, "RRA:AVERAGE:0.5:1:576");
821 push(@args, "RRA:AVERAGE:0.5:6:672");
822 push(@args, "RRA:AVERAGE:0.5:24:732");
823 push(@args, "RRA:AVERAGE:0.5:144:1460");
825 print("create ". join( ", ", @args)) if ( $dbg );
827 RRDs
::create
(@args);
828 $ERROR = RRDs
::error
;
829 print("Error in RRD::create for mbmon: $ERROR\n") if $ERROR;
836 foreach $key ( sort(keys %mbmon_values) )
839 push(@val, $mbmon_values{$key});
842 $template = join(':', @ds);
843 $value = "N:".join(':', @val);
845 print("update template = '$template'\n") if ( $dbg );
846 print("update value = '$value'\n") if ( $dbg );
848 RRDs
::update
("$rrdlog/mbmon.rrd", "-t", $template, $value);
849 $ERROR = RRDs
::error
;
850 print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR;
858 @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
859 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
860 "--color", "SHADEA#EAE9EE",
861 "--color", "SHADEB#EAE9EE",
862 "--color", "BACK#EAE9EE",
863 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
866 foreach $key ( sort(keys %mbmon_values) )
868 if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
870 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
872 $mbmon_settings{'LABEL-'.$key} = $key;
875 push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
876 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon temp in'} °C");
877 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.1lf °C");
878 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.1lf °C");
879 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.1lf °C\\j");
887 RRDs
::graph
( @args );
888 $ERROR = RRDs
::error
;
889 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
898 @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
899 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
900 "--color", "SHADEA#EAE9EE",
901 "--color", "SHADEB#EAE9EE",
902 "--color", "BACK#EAE9EE",
903 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
906 foreach $key ( sort(keys %mbmon_values) )
908 if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
910 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
912 $mbmon_settings{'LABEL-'.$key} = $key;
915 push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
916 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon fan in'} rpm");
917 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.0lf rpm");
918 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.0lf rpm");
919 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.0lf rpm\\j");
927 RRDs
::graph
( @args );
928 $ERROR = RRDs
::error
;
929 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
938 @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
939 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
940 "--color", "SHADEA#EAE9EE",
941 "--color", "SHADEB#EAE9EE",
942 "--color", "BACK#EAE9EE",
943 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
946 foreach $key ( sort(keys %mbmon_values) )
948 my $v = substr($key,0,1);
949 if ( ($v eq 'v') && ($mbmon_settings{'LINE-'.$key} eq 'on') )
951 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
953 $mbmon_settings{'LABEL-'.$key} = $key;
956 push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
957 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} V");
958 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.2lf V");
959 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.2lf V");
960 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.2lf V\\j");
968 RRDs
::graph
( @args );
969 $ERROR = RRDs
::error
;
970 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
975 system ('/usr/sbin/fetchipac');
981 if ( -e
"/var/log/squid/access.log") {
982 system ("/usr/bin/squid-graph -o=/home/httpd/html/sgraph --tcp-only < /var/log/squid/access.log >/dev/null 2>&1");
988 if ((${Lang
::language
} eq 'cs') ||
989 (${Lang
::language
} eq 'hu') ||
990 (${Lang
::language
} eq 'pl') ||
991 (${Lang
::language
} eq 'sk')) {
992 # Czech, Hungarian, Polish and Slovak character set
993 foreach my $key(keys %Lang::tr
) {
994 from_to
($tr{$key}, "utf-8", "iso-8859-2");
996 } elsif (${Lang
::language
} eq 'tr') {
998 foreach my $key(keys %Lang::tr
) {
999 from_to
($tr{$key}, "utf-8", "iso-8859-9");
1002 foreach my $key(keys %Lang::tr
) {
1003 from_to
($tr{$key}, "utf-8", "iso-8859-1");
1011 updatecpugraph
("day");
1012 updatecpugraph
("week");
1013 updatecpugraph
("month");
1014 updatecpugraph
("year");
1017 updatememgraph
("day");
1018 updatememgraph
("week");
1019 updatememgraph
("month");
1020 updatememgraph
("year");
1023 updatediskgraph
("day");
1024 updatediskgraph
("week");
1025 updatediskgraph
("month");
1026 updatediskgraph
("year");
1028 if (open STAT
,"/dev/hda") {
1030 updatediskdatanew
("hda");
1031 updatediskgraphnew
("hda","day");
1032 updatediskgraphnew
("hda","week");
1033 updatediskgraphnew
("hda","month");
1034 updatediskgraphnew
("hda","year");
1036 if (-e
"$graphs/disk-hda-day.png") {
1037 system("rm $graphs/disk-hda-day.png");
1041 if (open STAT
,"/dev/hdb") {
1043 updatediskdatanew
("hdb");
1044 updatediskgraphnew
("hdb","day");
1045 updatediskgraphnew
("hdb","week");
1046 updatediskgraphnew
("hdb","month");
1047 updatediskgraphnew
("hdb","year");
1049 if (-e
"$graphs/disk-hdb-day.png") {
1050 system("rm $graphs/disk-hdb-day.png");
1054 if (open STAT
,"/dev/hdc") {
1056 updatediskdatanew
("hdc");
1057 updatediskgraphnew
("hdc","day");
1058 updatediskgraphnew
("hdc","week");
1059 updatediskgraphnew
("hdc","month");
1060 updatediskgraphnew
("hdc","year");
1062 if (-e
"$graphs/disk-hdc-day.png") {
1063 system("rm $graphs/disk-hdc-day.png");
1067 if (open STAT
,"/dev/hdd") {
1069 updatediskdatanew
("hdd");
1070 updatediskgraphnew
("hdd","day");
1071 updatediskgraphnew
("hdd","week");
1072 updatediskgraphnew
("hdd","month");
1073 updatediskgraphnew
("hdd","year");
1075 if (-e
"$graphs/disk-hdd-day.png") {
1076 system("rm $graphs/disk-hdd-day.png");
1080 if (open STAT
,"/dev/hde") {
1082 updatediskdatanew
("hde");
1083 updatediskgraphnew
("hde","day");
1084 updatediskgraphnew
("hde","week");
1085 updatediskgraphnew
("hde","month");
1086 updatediskgraphnew
("hde","year");
1088 if (-e
"$graphs/disk-hde-day.png") {
1089 system("rm $graphs/disk-hde-day.png");
1093 if (open STAT
,"/dev/hdf") {
1095 updatediskdatanew
("hdf");
1096 updatediskgraphnew
("hdf","day");
1097 updatediskgraphnew
("hdf","week");
1098 updatediskgraphnew
("hdf","month");
1099 updatediskgraphnew
("hdf","year");
1101 if (-e
"$graphs/disk-hdf-day.png") {
1102 system("rm $graphs/disk-hdf-day.png");
1106 if (open STAT
,"/dev/hdg") {
1108 updatediskdatanew
("hdg");
1109 updatediskgraphnew
("hdg","day");
1110 updatediskgraphnew
("hdg","week");
1111 updatediskgraphnew
("hdg","month");
1112 updatediskgraphnew
("hdg","year");
1114 if (-e
"$graphs/disk-hdg-day.png") {
1115 system("rm $graphs/disk-hdg-day.png");
1119 if (open STAT
,"/dev/hdh") {
1121 updatediskdatanew
("hdh");
1122 updatediskgraphnew
("hdh","day");
1123 updatediskgraphnew
("hdh","week");
1124 updatediskgraphnew
("hdh","month");
1125 updatediskgraphnew
("hdh","year");
1127 if (-e
"$graphs/disk-hdh-day.png") {
1128 system("rm $graphs/disk-hdh-day.png");
1136 updatefwhitsgraph
("day");
1137 updatefwhitsgraph
("week");
1138 updatefwhitsgraph
("month");
1139 updatefwhitsgraph
("year");
1146 updatelqgraph
("day");
1147 updatelqgraph
("week");
1148 updatelqgraph
("month");
1149 updatelqgraph
("year");
1152 ### HDDTEMP-Graphs for /dev/harddisk
1155 updatehddgraph
("day");
1156 updatehddgraph
("week");
1157 updatehddgraph
("month");
1158 updatehddgraph
("year");
1162 if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
1164 updatetempgraph
("day");
1165 updatetempgraph
("week");
1166 updatetempgraph
("month");
1167 updatetempgraph
("year");
1169 if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
1171 updatefangraph
("day");
1172 updatefangraph
("week");
1173 updatefangraph
("month");
1174 updatefangraph
("year");
1176 if ( $mbmon_settings{'GRAPH_VOLT'} == 1 )
1178 updatevoltgraph
("day");
1179 updatevoltgraph
("week");
1180 updatevoltgraph
("month");
1181 updatevoltgraph
("year");
1187 @ipacsum = `/usr/sbin/ipacsum --exact -s 5m 2>/dev/null`;
1189 updateifdata
("GREEN");
1190 updateifdata
("RED");
1191 if ($settings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/ ) {
1192 updateifdata
("ORANGE");
1194 if ($settings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/ ) {
1195 updateifdata
("BLUE");
1198 if ( -e
"$rrdlog/GREEN.rrd") {
1199 updateifgraph
("GREEN", "day");
1200 updateifgraph
("GREEN", "week");
1201 updateifgraph
("GREEN", "month");
1202 updateifgraph
("GREEN", "year");
1205 if ( -e
"$rrdlog/RED.rrd") {
1206 updateifgraph
("RED", "day");
1207 updateifgraph
("RED", "week");
1208 updateifgraph
("RED", "month");
1209 updateifgraph
("RED", "year");
1212 if ($settings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/ && -e
"$rrdlog/ORANGE.rrd") {
1213 updateifgraph
("ORANGE", "day");
1214 updateifgraph
("ORANGE", "week");
1215 updateifgraph
("ORANGE", "month");
1216 updateifgraph
("ORANGE", "year");
1219 if ($settings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/ && -e
"$rrdlog/BLUE.rrd") {
1220 updateifgraph
("BLUE", "day");
1221 updateifgraph
("BLUE", "week");
1222 updateifgraph
("BLUE", "month");
1223 updateifgraph
("BLUE", "year");
1226 system("chmod -R 0777 /home/httpd/html/graphs");
1227 system("chmod -R 0777 /home/httpd/html/sgraph");