]>
git.ipfire.org Git - people/pmueller/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);
39 # Added for conversion of utf-8 characters
43 # Force language back to English (ugly hack!)
44 # Modified to only force if we are unable to convert charset
46 if ((${Lang
::language
} eq 'el') ||
47 (${Lang
::language
} eq 'fa') ||
48 (${Lang
::language
} eq 'ru') ||
49 (${Lang
::language
} eq 'th') ||
50 (${Lang
::language
} eq 'vi') ||
51 (${Lang
::language
} eq 'zh') ||
52 (${Lang
::language
} eq 'zt')) {
53 eval `/bin/cat "${General::swroot}/langs/en.pl"`;
55 %tr=%Lang::tr
; # use translated version for other languages
59 my $rrdlog = "/var/log/rrd";
60 my $graphs = "/home/httpd/html/graphs";
61 $ENV{PATH
}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
62 my $hdd_device = "/dev/harddisk";
64 my %mbmon_values = ();
71 my $path_rrd = "/var/log/rrd";
72 my $path_graphs = "/home/httpd/html/graphs";
73 my $path_smartctl = "/usr/sbin/smartctl";
76 $colors{"1"} = "#0000FF";
77 $colors{"2"} = "#00FF00";
78 $colors{"3"} = "#FF0000";
79 $colors{"4"} = "#FFD700";
80 $colors{"5"} = "#CCCCCC";
81 $colors{"6"} = "#40E0D0";
82 $colors{"7"} = "#90EE90";
83 $colors{"8"} = "#F4A460";
85 open(MBMON_OUT
, ">/var/log/mbmon-values");
86 open(FD
, "/usr/bin/mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ;
90 next unless( /^([A-Za-z][^:\s]+)\s*:\s*([+\-]{0,1}[\d\.]+)/ ) ;
94 $mbmon_values{$key} = $value;
95 print(MBMON_OUT
"$key=$value\n");
101 my $interface = $_[0];
109 $bytesin += $1 if (/^[\* ]\s+incoming\s+${interface}.+\:\s+(\d+)/);
111 # Forwarded Incoming...
112 $bytesin += $1 if (/^[\* ]\s+forwarded\s+incoming\s+${interface}.+\:\s+(\d+)/);
115 $bytesout += $1 if (/^[* ]\s+outgoing\s+${interface}.+\:\s+(\d+)/);
117 # Forwarded Outgoing...
118 $bytesout += $1 if (/^[* ]\s+forwarded\s+outgoing\s+${interface}.+\:\s+(\d+)/);
120 return "$bytesin:$bytesout";
126 RRDs
::graph
("$graphs/cpu-$period.png",
127 "--start", "-1$period", "-aPNG", "-i", "-z",
128 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
129 "--color", "SHADEA#EAE9EE",
130 "--color", "SHADEB#EAE9EE",
131 "--color", "BACK#FFFFFF",
132 "-t $tr{'cpu usage per'} $tr{$period}",
133 "DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
134 "DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
135 "DEF:idle=$rrdlog/cpu.rrd:idle:AVERAGE",
136 "CDEF:total=user,system,idle,+,+",
137 "CDEF:userpct=100,user,total,/,*",
138 "CDEF:systempct=100,system,total,/,*",
139 "CDEF:idlepct=100,idle,total,/,*",
140 "AREA:userpct#0000FF:$tr{'user cpu usage'}\\j",
141 "STACK:systempct#FF0000:$tr{'system cpu usage'}\\j",
142 "STACK:idlepct#00FF00:$tr{'idle cpu usage'}\\j",
143 "GPRINT:userpct:MAX:$tr{'maximal'} $tr{'user cpu'}\\:%3.2lf%%",
144 "GPRINT:userpct:AVERAGE:$tr{'average'} $tr{'user cpu'}\\:%3.2lf%%",
145 "GPRINT:userpct:LAST:$tr{'current'} $tr{'user cpu'}\\:%3.2lf%%\\j",
146 "GPRINT:systempct:MAX:$tr{'maximal'} $tr{'system cpu'}\\:%3.2lf%%",
147 "GPRINT:systempct:AVERAGE:$tr{'average'} $tr{'system cpu'}\\:%3.2lf%%",
148 "GPRINT:systempct:LAST:$tr{'current'} $tr{'system cpu'}\\:%3.2lf%%\\j",
149 "GPRINT:idlepct:MAX:$tr{'maximal'} $tr{'idle cpu'}\\:%3.2lf%%",
150 "GPRINT:idlepct:AVERAGE:$tr{'average'} $tr{'idle cpu'}\\:%3.2lf%%",
151 "GPRINT:idlepct:LAST:$tr{'current'} $tr{'idle cpu'}\\:%3.2lf%%\\j");
152 $ERROR = RRDs
::error
;
153 print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
157 if ( ! -e
"$rrdlog/cpu.rrd") {
158 RRDs
::create
("$rrdlog/cpu.rrd", "--step=300",
159 "DS:user:COUNTER:600:0:500000000",
160 "DS:system:COUNTER:600:0:500000000",
161 "DS:idle:COUNTER:600:0:500000000",
162 "RRA:AVERAGE:0.5:1:576",
163 "RRA:AVERAGE:0.5:6:672",
164 "RRA:AVERAGE:0.5:24:732",
165 "RRA:AVERAGE:0.5:144:1460");
166 $ERROR = RRDs
::error
;
167 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
170 my ($cpu, $user, $nice, $system, $idle);
172 open STAT
, "/proc/stat";
176 ($cpu, $user, $nice, $system, $idle) = split /\s+/;
182 RRDs
::update
("$rrdlog/cpu.rrd",
183 "-t", "user:system:idle",
184 "N:$user:$system:$idle");
185 $ERROR = RRDs
::error
;
186 print "Error in RRD::update for cpu: $ERROR\n" if $ERROR;
193 RRDs
::graph
("$graphs/memory-$period.png",
194 "--start", "-1$period", "-aPNG", "-i", "-z",
195 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
196 "--color", "SHADEA#EAE9EE",
197 "--color", "SHADEB#EAE9EE",
198 "--color", "BACK#FFFFFF",
199 "-t $tr{'memory usage per'} $tr{$period}",
200 "DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
201 "DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
202 "DEF:shared=$rrdlog/mem.rrd:memshared:AVERAGE",
203 "DEF:buffer=$rrdlog/mem.rrd:membuffers:AVERAGE",
204 "DEF:cache=$rrdlog/mem.rrd:memcache:AVERAGE",
205 "CDEF:total=used,free,+",
206 "CDEF:used2=used,buffer,cache,shared,+,+,-",
207 "CDEF:usedpct=100,used2,total,/,*",
208 "CDEF:sharedpct=100,shared,total,/,*",
209 "CDEF:bufferpct=100,buffer,total,/,*",
210 "CDEF:cachepct=100,cache,total,/,*",
211 "CDEF:freepct=100,free,total,/,*",
212 "AREA:usedpct#0000FF:$tr{'used memory'}\\j",
213 "STACK:sharedpct#FF0000:$tr{'shared memory'}\\j",
214 "STACK:bufferpct#FF00FF:$tr{'buffered memory'}\\j",
215 "STACK:cachepct#FFFF00:$tr{'cached memory'}\\j",
216 "STACK:freepct#00FF00:$tr{'free memory'}\\j",
217 "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used memory'}\\:%3.2lf%%",
218 "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used memory'}\\:%3.2lf%%",
219 "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used memory'}\\:%3.2lf%%\\j",
220 "GPRINT:sharedpct:MAX:$tr{'maximal'} $tr{'shared memory'}\\:%3.2lf%%",
221 "GPRINT:sharedpct:AVERAGE:$tr{'average'} $tr{'shared memory'}\\:%3.2lf%%",
222 "GPRINT:sharedpct:LAST:$tr{'current'} $tr{'shared memory'}\\:%3.2lf%%\\j",
223 "GPRINT:bufferpct:MAX:$tr{'maximal'} $tr{'buffered memory'}\\:%3.2lf%%",
224 "GPRINT:bufferpct:AVERAGE:$tr{'average'} $tr{'buffered memory'}\\:%3.2lf%%",
225 "GPRINT:bufferpct:LAST:$tr{'current'} $tr{'buffered memory'}\\:%3.2lf%%\\j",
226 "GPRINT:cachepct:MAX:$tr{'maximal'} $tr{'cached memory'}\\:%3.2lf%%",
227 "GPRINT:cachepct:AVERAGE:$tr{'average'} $tr{'cached memory'}\\:%3.2lf%%",
228 "GPRINT:cachepct:LAST:$tr{'current'} $tr{'cached memory'}\\:%3.2lf%%\\j",
229 "GPRINT:freepct:MAX:$tr{'maximal'} $tr{'free memory'}\\:%3.2lf%%",
230 "GPRINT:freepct:AVERAGE:$tr{'average'} $tr{'free memory'}\\:%3.2lf%%",
231 "GPRINT:freepct:LAST:$tr{'current'} $tr{'free memory'}\\:%3.2lf%%\\j");
232 $ERROR = RRDs
::error
;
233 print "Error in RRD::graph for mem: $ERROR\n" if $ERROR;
235 RRDs
::graph
("$graphs/swap-$period.png",
236 "--start", "-1$period", "-aPNG", "-i", "-z",
237 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
238 "--color", "SHADEA#EAE9EE",
239 "--color", "SHADEB#EAE9EE",
240 "--color", "BACK#FFFFFF",
241 "-t $tr{'swap usage per'} $tr{$period}",
242 "DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
243 "DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
244 "CDEF:total=used,free,+",
245 "CDEF:usedpct=100,used,total,/,*",
246 "CDEF:freepct=100,free,total,/,*",
247 "AREA:usedpct#0000FF:$tr{'used swap'}\\j",
248 "STACK:freepct#00FF00:$tr{'free swap'}\\j",
249 "GPRINT:usedpct:MAX:$tr{'maximal'} $tr{'used swap'}\\:%3.2lf%%",
250 "GPRINT:usedpct:AVERAGE:$tr{'average'} $tr{'used swap'}\\:%3.2lf%%",
251 "GPRINT:usedpct:LAST:$tr{'current'} $tr{'used swap'}\\:%3.2lf%%\\j",
252 "GPRINT:freepct:MAX:$tr{'maximal'} $tr{'free swap'}\\:%3.2lf%%",
253 "GPRINT:freepct:AVERAGE:$tr{'average'} $tr{'free swap'}\\:%3.2lf%%",
254 "GPRINT:freepct:LAST:$tr{'current'} $tr{'free swap'}\\:%3.2lf%%\\j");
255 $ERROR = RRDs
::error
;
256 print "Error in RRD::graph for swap: $ERROR\n" if $ERROR;
260 my ($memused, $memfree, $memshared, $membuffers, $memcache, $swapused, $swapfree);
261 if ( ! -e
"$rrdlog/mem.rrd") {
262 RRDs
::create
("$rrdlog/mem.rrd", "--step=300",
263 "DS:memused:ABSOLUTE:600:0:5000000000",
264 "DS:memfree:ABSOLUTE:600:0:5000000000",
265 "DS:memshared:ABSOLUTE:600:0:5000000000",
266 "DS:membuffers:ABSOLUTE:600:0:5000000000",
267 "DS:memcache:ABSOLUTE:600:0:5000000000",
268 "DS:swapused:ABSOLUTE:600:0:5000000000",
269 "DS:swapfree:ABSOLUTE:600:0:5000000000",
270 "RRA:AVERAGE:0.5:1:576",
271 "RRA:AVERAGE:0.5:6:672",
272 "RRA:AVERAGE:0.5:24:732",
273 "RRA:AVERAGE:0.5:144:1460");
274 $ERROR = RRDs
::error
;
275 print "Error in RRD::create for mem: $ERROR\n" if $ERROR;
278 open MEM
, "/proc/meminfo";
282 my @temp = split (/\s+/, $_);
285 $memshared = $temp[4];
286 $membuffers = $temp[5];
287 $memcache = $temp[6];
288 } elsif ($_ =~ /^Swap:/) {
289 my @temp = split (/\s+/, $_);
290 $swapused = $temp[2];
291 $swapfree = $temp[3];
296 RRDs
::update
("$rrdlog/mem.rrd",
297 "-t", "memused:memfree:memshared:membuffers:memcache:swapused:swapfree",
298 "N:$memused:$memfree:$memshared:$membuffers:$memcache:$swapused:$swapfree");
299 $ERROR = RRDs
::error
;
300 print "Error in RRD::update for mem: $ERROR\n" if $ERROR;
303 sub updatediskgraph
{
306 RRDs
::graph
("$graphs/disk-$period.png",
307 "--start", "-1$period", "-aPNG", "-i", "-z",
308 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
309 "--color", "SHADEA#EAE9EE",
310 "--color", "SHADEB#EAE9EE",
311 "--color", "BACK#FFFFFF",
312 "-t $tr{'disk access per'} $tr{$period}",
313 "DEF:read=$rrdlog/disk.rrd:readsect:AVERAGE",
314 "DEF:write=$rrdlog/disk.rrd:writesect:AVERAGE",
315 "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
316 "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
317 "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
318 "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
319 "GPRINT:read:LAST:$tr{'current'} $tr{'read sectors'}\\:%8.0lf\\j",
320 "GPRINT:write:MAX:$tr{'maximal'} $tr{'written sectors'}\\:%8.0lf",
321 "GPRINT:write:AVERAGE:$tr{'average'} $tr{'written sectors'}\\:%8.0lf",
322 "GPRINT:write:LAST:$tr{'current'} $tr{'written sectors'}\\:%8.0lf\\j");
323 $ERROR = RRDs
::error
;
324 print "Error in RRD::graph for disk: $ERROR\n" if $ERROR;
328 my ($readwritereq, $readreq, $readsect, $writereq, $writesect);
329 if ( ! -e
"$rrdlog/disk.rrd") {
330 RRDs
::create
("$rrdlog/disk.rrd", "--step=300",
331 "DS:readsect:COUNTER:600:0:5000000000",
332 "DS:writesect:COUNTER:600:0:5000000000",
333 "RRA:AVERAGE:0.5:1:576",
334 "RRA:AVERAGE:0.5:6:672",
335 "RRA:AVERAGE:0.5:24:732",
336 "RRA:AVERAGE:0.5:144:1460");
337 $ERROR = RRDs
::error
;
338 print "Error in RRD::create for disk: $ERROR\n" if $ERROR;
341 my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
342 $atime, $mtime, $ctime, $blksize, $blocks) = stat("/dev/harddisk");
344 my $major = $rdev >> 8;
345 my $minor = $rdev & 0xFF;
347 open STAT
, "/proc/stat";
348 my @diskstat = <STAT
>;
350 foreach my $line (@diskstat)
353 my @temp = split(/\:\ /,$line);
355 my @devicestat = split(/\ /,$temp[1]);
356 foreach my $stats (@devicestat)
359 my @fields = split(/\((\d+),(\d+)\):\((\d+),(\d+),(\d+),(\d+),(\d+)/,$stats);
360 if ($major eq $fields[1] and $minor eq $fields[2])
362 $readwritereq = $fields[3];
363 $readreq = $fields[4];
364 $readsect = $fields[5];
365 $writereq = $fields[6];
366 $writesect = $fields[7];
372 if ($readsect && $writesect) {
373 RRDs
::update
("$rrdlog/disk.rrd",
374 "-t", "readsect:writesect",
375 "N:$readsect:$writesect");
376 $ERROR = RRDs
::error
;
377 print "Error in RRD::update for disk: $ERROR\n" if $ERROR;
379 print "Error in RRD::update for disk: no data available\n";
383 sub updatediskgraphnew
{
387 RRDs
::graph
("$graphs/disk-$disk-$period.png",
388 "--start", "-1$period", "-aPNG", "-i", "-z",
389 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
390 "--color", "SHADEA#EAE9EE",
391 "--color", "SHADEB#EAE9EE",
392 "--color", "BACK#FFFFFF",
393 "-t $tr{'disk access per'} $tr{$period}",
394 "DEF:read=$rrdlog/disk-$disk.rrd:readsect:AVERAGE",
395 "DEF:write=$rrdlog/disk-$disk.rrd:writesect:AVERAGE",
396 "DEF:sleep=$rrdlog/disk-$disk.rrd:sleeping:AVERAGE",
397 "CDEF:sl_state=sleep,INF,*",
399 "AREA:sl_state#a0a0a0:disk standby\\j",
400 "AREA:read#0000FF:$tr{'sectors read from disk per second'}\\j",
401 "STACK:write#00FF00:$tr{'sectors written to disk per second'}\\j",
403 "GPRINT:read:MAX:$tr{'maximal'} $tr{'read sectors'}\\:%8.0lf",
404 "GPRINT:read:AVERAGE:$tr{'average'} $tr{'read sectors'}\\:%8.0lf",
405 "GPRINT:read:LAST:$tr{'current'} $tr{'read sectors'}\\:%8.0lf\\j",
406 "GPRINT:write:MAX:$tr{'maximal'} $tr{'written sectors'}\\:%8.0lf",
407 "GPRINT:write:AVERAGE:$tr{'average'} $tr{'written sectors'}\\:%8.0lf",
408 "GPRINT:write:LAST:$tr{'current'} $tr{'written sectors'}\\:%8.0lf\\j");
409 $ERROR = RRDs
::error
;
410 print "Error in RRD::graph for disk-$disk: $ERROR\n" if $ERROR;
413 sub updatediskdatanew
{
416 my ($readwritereq, $readreq, $readsect, $writereq, $writesect);
417 if ( ! -e
"$rrdlog/disk-$disk.rrd") {
418 RRDs
::create
("$rrdlog/disk-$disk.rrd", "--step=300",
419 "DS:readsect:COUNTER:600:0:5000000000",
420 "DS:writesect:COUNTER:600:0:5000000000",
421 "DS:sleeping:GAUGE:600:0:1",
422 "RRA:AVERAGE:0.5:1:576",
423 "RRA:AVERAGE:0.5:6:672",
424 "RRA:AVERAGE:0.5:24:732",
425 "RRA:AVERAGE:0.5:144:1460");
426 $ERROR = RRDs
::error
;
427 print "Error in RRD::create for disk-$disk: $ERROR\n" if $ERROR;
430 my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
431 $atime, $mtime, $ctime, $blksize, $blocks) = stat("/dev/$disk");
433 my $major = $rdev >> 8;
434 my $minor = ($rdev & 0xFF) >>6;
436 open STAT
, "/proc/stat";
437 my @diskstat = <STAT
>;
439 foreach my $line (@diskstat)
442 my @temp = split(/\:\ /,$line);
444 my @devicestat = split(/\ /,$temp[1]);
445 foreach my $stats (@devicestat)
448 my @fields = split(/\((\d+),(\d+)\):\((\d+),(\d+),(\d+),(\d+),(\d+)/,$stats);
449 if ($major eq $fields[1] and $minor eq $fields[2])
451 $readwritereq = $fields[3];
452 $readreq = $fields[4];
453 $readsect = $fields[5];
454 $writereq = $fields[6];
455 $writesect = $fields[7];
462 my $lastsleepstate=0;
464 if ( -e
"/tmp/hddshutdown-$disk" ) {
465 open STAT
,"/tmp/hddshutdown-$disk";
466 $lastsleepstate = <STAT
>;
468 if ($lastsleepstate==$readwritereq) {
473 if ($readsect && $writesect) {
474 RRDs
::update
("$rrdlog/disk-$disk.rrd",
475 "-t", "readsect:writesect:sleeping",
476 "N:$readsect:$writesect:$sleeping");
477 $ERROR = RRDs
::error
;
478 print "Error in RRD::update for disk-$disk: $ERROR\n" if $ERROR;
480 print "Error in RRD::update for disk-$disk: no data available\n";
485 my $interface = $_[0];
488 RRDs
::graph
("$graphs/$interface-$period.png",
489 "--start", "-1$period", "-aPNG", "-i", "-z",
490 "--alt-y-grid", "-w 600", "-h 100",
491 "--color", "SHADEA#EAE9EE",
492 "--color", "SHADEB#EAE9EE",
493 "--color", "BACK#FFFFFF",
494 "-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
495 "-v$tr{'bytes per second'}",
496 "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
497 "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
498 "AREA:incoming#00FF00:$tr{'incoming traffic in bytes per second'}\\j",
499 "LINE1:outgoing#0000FF:$tr{'outgoing traffic in bytes per second'}\\j",
500 "GPRINT:incoming:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sBps",
501 "GPRINT:incoming:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sBps",
502 "GPRINT:incoming:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sBps\\j",
503 "GPRINT:outgoing:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sBps",
504 "GPRINT:outgoing:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sBps",
505 "GPRINT:outgoing:LAST:$tr{'current'} $tr{'out'}\\:%8.3lf %sBps\\j");
506 $ERROR = RRDs
::error
;
507 print "Error in RRD::graph for $interface: $ERROR\n" if $ERROR;
511 my $interface = $_[0];
513 if ( ! -e
"$rrdlog/$interface.rrd") {
514 RRDs
::create
("$rrdlog/$interface.rrd", "--step=300",
515 "DS:incoming:ABSOLUTE:600:0:12500000",
516 "DS:outgoing:ABSOLUTE:600:0:12500000",
517 "RRA:AVERAGE:0.5:1:576",
518 "RRA:AVERAGE:0.5:6:672",
519 "RRA:AVERAGE:0.5:24:732",
520 "RRA:AVERAGE:0.5:144:1460");
521 $ERROR = RRDs
::error
;
522 print "Error in RRD::create for $interface: $ERROR\n" if $ERROR;
525 my $traffic = gettraffic
($interface);
526 RRDs
::update
("$rrdlog/$interface.rrd",
527 "-t", "incoming:outgoing",
529 $ERROR = RRDs
::error
;
530 print "Error in RRD::update for $interface: $ERROR\n" if $ERROR;
533 sub updatefwhitsgraph
{
534 my $interval = $_[0];
536 RRDs
::graph
("$graphs/firewallhits-$interval-area.png",
537 "--start", "-1$interval", "-aPNG", "-i", "-z",
538 "--alt-y-grid", "-w 600", "-h 200",
539 "--color", "SHADEA#EAE9EE",
540 "--color", "SHADEB#EAE9EE",
541 "--color", "BACK#FFFFFF",
542 "-t firewall hits over the last $interval",
543 "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
544 "AREA:amount#6464FF:firewallhits",
545 "GPRINT:amount:MAX: $tr{'maximal'}\\: %2.2lf %S",
546 "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
547 "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
548 "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
549 "AREA:portamount#FF6464:portscans",
550 "GPRINT:portamount:MAX: $tr{'maximal'}\\: %2.2lf %S",
551 "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
552 "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
553 $ERROR = RRDs
::error
;
554 print "Error in RRD::graph for Firewallhits: $ERROR\n" if $ERROR;
556 RRDs
::graph
("$graphs/firewallhits-$interval-line.png",
557 "--start", "-1$interval", "-aPNG", "-i", "-z",
558 "--alt-y-grid", "-w 600", "-h 200",
559 "--color", "SHADEA#EAE9EE",
560 "--color", "SHADEB#EAE9EE",
561 "--color", "BACK#FFFFFF",
562 "-t firewall hits over the last $interval",
563 "DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
564 "LINE2:amount#6464FF:firewallhits",
565 "GPRINT:amount:MAX: $tr{'maximal'}\\: %2.2lf %S",
566 "GPRINT:amount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
567 "GPRINT:amount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min\\n",
568 "DEF:portamount=$rrdlog/firewallhits.rrd:portamount:AVERAGE",
569 "LINE2:portamount#FF6464:portscans",
570 "GPRINT:portamount:MAX: $tr{'maximal'}\\: %2.2lf %S",
571 "GPRINT:portamount:AVERAGE: $tr{'average'}\\: %2.2lf %S",
572 "GPRINT:portamount:LAST: $tr{'current'}\\: %2.2lf %Shits/5 min");
573 $ERROR = RRDs
::error
;
574 print "Error in RRD::graph for Firewallhits: $ERROR\n" if $ERROR;
577 sub updatefwhitsdata
{
584 if (! -e
"$rrdlog/firewallhits.rrd")
586 RRDs
::create
("$rrdlog/firewallhits.rrd", "--step=300",
587 "DS:amount:GAUGE:600:0:U",
588 "DS:portamount:GAUGE:600:0:U",
589 "RRA:AVERAGE:0.5:1:576",
590 "RRA:AVERAGE:0.5:6:672",
591 "RRA:AVERAGE:0.5:24:732",
592 "RRA:AVERAGE:0.5:144:1460");
593 $ERROR = RRDs
::error
;
594 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
597 system("logtailfwhits /var/log/messages /var/log/fwhits.messages.offset >/tmp/messages.fwhits");
598 if (!(open (FILE
,'/tmp/messages.fwhits'))) {
604 if (/kernel:.*(IN=.*)$/) {
611 system("logtailfwhits /var/log/snort/alert /var/log/snort/fwhits.alert.offset >/tmp/snort.fwhits");
612 if (!(open (FILE
,'/tmp/snort.fwhits'))) {
625 if (!(open (FILE
,'/tmp/messages.fwhits'))) {
631 if (/kernel:.*(Scan.*)$/) {
638 system("rm /tmp/messages.fwhits");
639 system("rm /tmp/snort.fwhits");
641 $portamount = $portaktuell + $alertaktuell;
643 RRDs
::update
("$rrdlog/firewallhits.rrd",
644 "N:$aktuell:$portamount");
645 $ERROR = RRDs
::error
;
646 print "Error in RRD::update for Firewallhits: $ERROR\n" if $ERROR;
649 # Creates and updates a link quality database
650 # -------------------------------------------
652 if ( ! -e
"$rrdlog/lq.rrd") {
653 RRDs
::create
("$rrdlog/lq.rrd", "--step=300",
654 "DS:loss:GAUGE:600:0:100",
655 "DS:roundtrip:GAUGE:600:0:10000",
656 "RRA:AVERAGE:0.5:1:576",
657 "RRA:AVERAGE:0.5:6:672",
658 "RRA:AVERAGE:0.5:24:732",
659 "RRA:AVERAGE:0.5:144:1460");
660 $ERROR = RRDs
::error
;
661 print "Error in RRD::create for link: $ERROR\n" if $ERROR;
666 # LQ_GATEWAY is the ip of your isp's public ip facing you
667 my $LQ_GATEWAY='www.heise.de';
669 my $pingoutput = `ping -c $NUMPINGS -q $LQ_GATEWAY`;
671 my @temp = split (/\/|\
%|\s
/, $pingoutput);
672 $packetloss = $temp[17];
673 $roundtrip = $temp[28];
674 RRDs
::update
("$rrdlog/lq.rrd", "N:$packetloss:$roundtrip");
675 $ERROR = RRDs
::error
;
676 print "Error in RRD::update for line quality: $ERROR\n" if $ERROR;
681 RRDs
::graph
("$graphs/lq-$period.png",
682 "--start", "-1$period", "-aPNG", "-i", "-z",
683 "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
684 "-t $tr{'linkq'} ($tr{'graph per'} $tr{$period})",
686 "--color", "SHADEA#EAE9EE",
687 "--color", "SHADEB#EAE9EE",
688 "--color", "BACK#FFFFFF",
689 "-v ms / pkts (% x10)",
690 "DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE",
691 "DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE",
692 "CDEF:roundavg=roundtrip,PREV(roundtrip),+,2,/",
693 "CDEF:loss10=loss,10,*",
694 "CDEF:r0=roundtrip,30,MIN",
695 "CDEF:r1=roundtrip,70,MIN",
696 "CDEF:r2=roundtrip,150,MIN",
697 "CDEF:r3=roundtrip,300,MIN",
698 "AREA:roundtrip#EE7000:>300 ms",
699 "AREA:r3#D88E1B:150-300 ms",
700 "AREA:r2#B9B63F:70-150 ms",
701 "AREA:r1#99E064:30-70 ms",
702 "AREA:r0#80FF80:<30 ms",
703 "AREA:loss10#800000:Packet loss (x10)",
704 "LINE1:roundtrip#707070:",
705 "GPRINT:roundtrip:MAX:$tr{'maximal'}\\:%3.2lf ms",
706 "GPRINT:roundtrip:AVERAGE:$tr{'average'}\\:%3.2lf ms",
707 "GPRINT:roundtrip:LAST:$tr{'current'}\\:%3.2lf ms\\j",
708 "GPRINT:loss:MAX:$tr{'maximal'} Loss\\:%3.2lf%%",
709 "GPRINT:loss:AVERAGE:$tr{'average'} Loss\\:%3.2lf%%",
710 "GPRINT:loss:LAST:$tr{'current'} Loss\\:%3.2lf%%\\j"
712 $ERROR = RRDs
::error
;
713 print "Error in RRD::graph for Link Quality: $ERROR\n" if $ERROR;
718 if ( ! -e
"$path_rrd/hddtemp.rrd")
720 # database did not exist -> create
721 RRDs
::create
("$path_rrd/hddtemp.rrd", "--step=300",
722 "DS:temperature:GAUGE:600:0:100",
723 "RRA:AVERAGE:0.5:1:576",
724 "RRA:AVERAGE:0.5:6:672",
725 "RRA:AVERAGE:0.5:24:732",
726 "RRA:AVERAGE:0.5:144:1460");
727 $ERROR = RRDs
::error
;
728 print "Error in RRD::create for hdd: $ERROR\n" if $ERROR;
733 my $smart_output = '';
735 if ( -e
"$path_smartctl" )
737 system("$path_smartctl -iHA $hdd_device > /var/log/hddgraph_smartctl_out");
740 if ( -e
"$path_hddtemp" )
742 $hdd_output = `$path_hddtemp -qn $hdd_device`;
744 # I know 4 response possible responses:
746 # /dev/harddisk: harddisk type: S.M.A.R.T. not available
747 # /dev/harddisk: harddisk type: no sensor
748 # /dev/harddisk: harddisk type: 37Ā°C or Ā°F
751 if ( index($hdd_output, "S.M.A.R.T.") != -1 )
755 elsif ( index($hdd_output, "no sensor") != -1 )
759 elsif ( index($hdd_output, "$hdd_device") != -1 )
761 $hdd_output =~ /.*:.*:\s*(\d+).*\s/;
766 $hdd_output =~ /(\d+)\s/;
770 elsif ( -e
"/var/log/hddgraph_smartctl_out" )
772 $hdd_output = `cat /var/log/hddgraph_smartctl_out | grep Temperature_`;
773 my @t = split(/\s+/,$hdd_output);
781 # print "hdd $hdd_output \n";
782 # print "temp $temp \n";
784 RRDs
::update
("$path_rrd/hddtemp.rrd", "-t", "temperature", "N:$temp");
786 $ERROR = RRDs
::error
;
787 print "Error in RRD::update for hdd: $ERROR\n" if $ERROR;
793 RRDs
::graph
("$graphs/hddtemp-$period.png",
794 "--start", "-1$period", "-aPNG", "-i", "-z",
795 "--alt-y-grid", "-w 600", "-h 100",
796 "--color", "SHADEA#EAE9EE",
797 "--color", "SHADEB#EAE9EE",
798 "--color", "BACK#FFFFFF",
799 "-t $tr{'harddisk temperature'} ($tr{'graph per'} $tr{$period})",
800 "DEF:temperature=$rrdlog/hddtemp.rrd:temperature:AVERAGE",
801 "LINE2:temperature#0000FF:$tr{'hdd temperature in'} Ā°C",
802 "GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf Ā°C",
803 "GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf Ā°C",
804 "GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf Ā°C",
806 $ERROR = RRDs
::error
;
807 print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
812 if ( ! -e
"$path_rrd/mbmon.rrd" )
814 # database did not exist -> create
816 @args = ("$path_rrd/mbmon.rrd");
818 push(@args, "--step=300");
819 foreach $key ( sort(keys %mbmon_values) )
821 push(@args, "DS:$key:GAUGE:600:U:U");
823 push(@args, "RRA:AVERAGE:0.5:1:576");
824 push(@args, "RRA:AVERAGE:0.5:6:672");
825 push(@args, "RRA:AVERAGE:0.5:24:732");
826 push(@args, "RRA:AVERAGE:0.5:144:1460");
828 print("create ". join( ", ", @args)) if ( $dbg );
830 RRDs
::create
(@args);
831 $ERROR = RRDs
::error
;
832 print("Error in RRD::create for mbmon: $ERROR\n") if $ERROR;
839 foreach $key ( sort(keys %mbmon_values) )
842 push(@val, $mbmon_values{$key});
845 $template = join(':', @ds);
846 $value = "N:".join(':', @val);
848 print("update template = '$template'\n") if ( $dbg );
849 print("update value = '$value'\n") if ( $dbg );
851 RRDs
::update
("$path_rrd/mbmon.rrd", "-t", $template, $value);
852 $ERROR = RRDs
::error
;
853 print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR;
861 @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
862 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
863 "--color", "SHADEA#EAE9EE",
864 "--color", "SHADEB#EAE9EE",
865 "--color", "BACK#EAE9EE",
866 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
869 foreach $key ( sort(keys %mbmon_values) )
871 if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
873 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
875 $mbmon_settings{'LABEL-'.$key} = $key;
878 push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE");
879 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon temp in'} Ā°C");
880 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.1lf Ā°C");
881 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.1lf Ā°C");
882 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.1lf Ā°C\\j");
890 RRDs
::graph
( @args );
891 $ERROR = RRDs
::error
;
892 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
901 @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
902 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
903 "--color", "SHADEA#EAE9EE",
904 "--color", "SHADEB#EAE9EE",
905 "--color", "BACK#EAE9EE",
906 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
909 foreach $key ( sort(keys %mbmon_values) )
911 if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
913 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
915 $mbmon_settings{'LABEL-'.$key} = $key;
918 push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE");
919 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon fan in'} rpm");
920 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.0lf rpm");
921 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.0lf rpm");
922 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.0lf rpm\\j");
930 RRDs
::graph
( @args );
931 $ERROR = RRDs
::error
;
932 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
941 @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z",
942 "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale",
943 "--color", "SHADEA#EAE9EE",
944 "--color", "SHADEB#EAE9EE",
945 "--color", "BACK#EAE9EE",
946 "-t $tr{'mbmon temp'} ($tr{'graph per'} $tr{$period})" );
949 foreach $key ( sort(keys %mbmon_values) )
951 my $v = substr($key,0,1);
952 if ( ($v eq 'v') && ($mbmon_settings{'LINE-'.$key} eq 'on') )
954 if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
956 $mbmon_settings{'LABEL-'.$key} = $key;
959 push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE");
960 push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} V");
961 push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.2lf V");
962 push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.2lf V");
963 push(@args, "GPRINT:$key:LAST:$tr{'current'}\\:%5.2lf V\\j");
971 RRDs
::graph
( @args );
972 $ERROR = RRDs
::error
;
973 print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
978 system ('/usr/sbin/fetchipac');
984 if ( -e
"/var/log/squid/access.log") {
985 system ("/usr/bin/squid-graph -o=/home/httpd/html/sgraph --tcp-only < /var/log/squid/access.log >/dev/null 2>&1");
991 if ((${Lang
::language
} eq 'cs') ||
992 (${Lang
::language
} eq 'hu') ||
993 (${Lang
::language
} eq 'pl') ||
994 (${Lang
::language
} eq 'sk')) {
995 # Czech, Hungarian, Polish and Slovak character set
996 foreach my $key(keys %Lang::tr
) {
997 from_to
($tr{$key}, "utf-8", "iso-8859-2");
999 } elsif (${Lang
::language
} eq 'tr') {
1001 foreach my $key(keys %Lang::tr
) {
1002 from_to
($tr{$key}, "utf-8", "iso-8859-9");
1005 foreach my $key(keys %Lang::tr
) {
1006 from_to
($tr{$key}, "utf-8", "iso-8859-1");
1014 updatecpugraph
("day");
1015 updatecpugraph
("week");
1016 updatecpugraph
("month");
1017 updatecpugraph
("year");
1020 updatememgraph
("day");
1021 updatememgraph
("week");
1022 updatememgraph
("month");
1023 updatememgraph
("year");
1026 updatediskgraph
("day");
1027 updatediskgraph
("week");
1028 updatediskgraph
("month");
1029 updatediskgraph
("year");
1031 if (open STAT
,"/dev/hda") {
1033 updatediskdatanew
("hda");
1034 updatediskgraphnew
("hda","day");
1035 updatediskgraphnew
("hda","week");
1036 updatediskgraphnew
("hda","month");
1037 updatediskgraphnew
("hda","year");
1039 if (-e
"$graphs/disk-hda-day.png") {
1040 system("rm $graphs/disk-hda-day.png");
1044 if (open STAT
,"/dev/hdb") {
1046 updatediskdatanew
("hdb");
1047 updatediskgraphnew
("hdb","day");
1048 updatediskgraphnew
("hdb","week");
1049 updatediskgraphnew
("hdb","month");
1050 updatediskgraphnew
("hdb","year");
1052 if (-e
"$graphs/disk-hdb-day.png") {
1053 system("rm $graphs/disk-hdb-day.png");
1057 if (open STAT
,"/dev/hdc") {
1059 updatediskdatanew
("hdc");
1060 updatediskgraphnew
("hdc","day");
1061 updatediskgraphnew
("hdc","week");
1062 updatediskgraphnew
("hdc","month");
1063 updatediskgraphnew
("hdc","year");
1065 if (-e
"$graphs/disk-hdc-day.png") {
1066 system("rm $graphs/disk-hdc-day.png");
1070 if (open STAT
,"/dev/hdd") {
1072 updatediskdatanew
("hdd");
1073 updatediskgraphnew
("hdd","day");
1074 updatediskgraphnew
("hdd","week");
1075 updatediskgraphnew
("hdd","month");
1076 updatediskgraphnew
("hdd","year");
1078 if (-e
"$graphs/disk-hdd-day.png") {
1079 system("rm $graphs/disk-hdd-day.png");
1083 if (open STAT
,"/dev/hde") {
1085 updatediskdatanew
("hde");
1086 updatediskgraphnew
("hde","day");
1087 updatediskgraphnew
("hde","week");
1088 updatediskgraphnew
("hde","month");
1089 updatediskgraphnew
("hde","year");
1091 if (-e
"$graphs/disk-hde-day.png") {
1092 system("rm $graphs/disk-hde-day.png");
1096 if (open STAT
,"/dev/hdf") {
1098 updatediskdatanew
("hdf");
1099 updatediskgraphnew
("hdf","day");
1100 updatediskgraphnew
("hdf","week");
1101 updatediskgraphnew
("hdf","month");
1102 updatediskgraphnew
("hdf","year");
1104 if (-e
"$graphs/disk-hdf-day.png") {
1105 system("rm $graphs/disk-hdf-day.png");
1109 if (open STAT
,"/dev/hdg") {
1111 updatediskdatanew
("hdg");
1112 updatediskgraphnew
("hdg","day");
1113 updatediskgraphnew
("hdg","week");
1114 updatediskgraphnew
("hdg","month");
1115 updatediskgraphnew
("hdg","year");
1117 if (-e
"$graphs/disk-hdg-day.png") {
1118 system("rm $graphs/disk-hdg-day.png");
1122 if (open STAT
,"/dev/hdh") {
1124 updatediskdatanew
("hdh");
1125 updatediskgraphnew
("hdh","day");
1126 updatediskgraphnew
("hdh","week");
1127 updatediskgraphnew
("hdh","month");
1128 updatediskgraphnew
("hdh","year");
1130 if (-e
"$graphs/disk-hdh-day.png") {
1131 system("rm $graphs/disk-hdh-day.png");
1139 updatefwhitsgraph
("day");
1140 updatefwhitsgraph
("week");
1141 updatefwhitsgraph
("month");
1142 updatefwhitsgraph
("year");
1149 updatelqgraph
("day");
1150 updatelqgraph
("week");
1151 updatelqgraph
("month");
1152 updatelqgraph
("year");
1155 ### HDDTEMP-Graphs for /dev/harddisk
1158 updatehddgraph
("day");
1159 updatehddgraph
("week");
1160 updatehddgraph
("month");
1161 updatehddgraph
("year");
1165 if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
1167 updatetempgraph
("day");
1168 updatetempgraph
("week");
1169 updatetempgraph
("month");
1170 updatetempgraph
("year");
1172 if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
1174 updatefangraph
("day");
1175 updatefangraph
("week");
1176 updatefangraph
("month");
1177 updatefangraph
("year");
1179 if ( $mbmon_settings{'GRAPH_VOLT'} == 1 )
1181 updatevoltgraph
("day");
1182 updatevoltgraph
("week");
1183 updatevoltgraph
("month");
1184 updatevoltgraph
("year");
1190 @ipacsum = `/usr/sbin/ipacsum --exact -s 5m 2>/dev/null`;
1192 updateifdata
("GREEN");
1193 updateifdata
("RED");
1194 if ($settings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/ ) {
1195 updateifdata
("ORANGE");
1197 if ($settings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/ ) {
1198 updateifdata
("BLUE");
1201 if ( -e
"$rrdlog/GREEN.rrd") {
1202 updateifgraph
("GREEN", "day");
1203 updateifgraph
("GREEN", "week");
1204 updateifgraph
("GREEN", "month");
1205 updateifgraph
("GREEN", "year");
1208 if ( -e
"$rrdlog/RED.rrd") {
1209 updateifgraph
("RED", "day");
1210 updateifgraph
("RED", "week");
1211 updateifgraph
("RED", "month");
1212 updateifgraph
("RED", "year");
1215 if ($settings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/ && -e
"$rrdlog/ORANGE.rrd") {
1216 updateifgraph
("ORANGE", "day");
1217 updateifgraph
("ORANGE", "week");
1218 updateifgraph
("ORANGE", "month");
1219 updateifgraph
("ORANGE", "year");
1222 if ($settings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/ && -e
"$rrdlog/BLUE.rrd") {
1223 updateifgraph
("BLUE", "day");
1224 updateifgraph
("BLUE", "week");
1225 updateifgraph
("BLUE", "month");
1226 updateifgraph
("BLUE", "year");
1229 system("chmod -R 0777 /home/httpd/html/graphs");
1230 system("chmod -R 0777 /home/httpd/html/sgraph");