]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/scripts/makegraphs
some small code fixes
[people/pmueller/ipfire-2.x.git] / src / scripts / makegraphs
1 #!/usr/bin/perl
2
3 ############################################################################
4 # #
5 # This file is part of the IPCop Firewall. #
6 # #
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. #
11 # #
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. #
16 # #
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 #
20 # #
21 # Copyright (C) 2004-01-19 Mark Wormgoor <mark@wormgoor.com>. #
22 # #
23 ############################################################################
24
25 use strict;
26 #use warnings;
27
28 use RRDs;
29 require "/var/ipfire/general-functions.pl";
30 require "${General::swroot}/lang.pl";
31
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);
36
37 # Added for conversion of utf-8 characters
38 use Encode 'from_to';
39 my %tr=();
40
41 system("chmod 777 /srv/web/ipfire/html/graphs");
42
43 # Force language back to English (ugly hack!)
44 # Modified to only force if we are unable to convert charset
45 # from utf-8
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"`;
54 } else {
55 use translated version for other languages
56 %tr=%Lang::tr;
57 }
58
59 # Settings
60 my $rrdlog = "/var/log/rrd";
61 my $graphs = "/srv/web/ipfire/html/graphs";
62 $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
63 my $hdd_device = "/dev/harddisk";
64 my $temp = '';
65 my %mbmon_values = ();
66 my $key;
67 my $value;
68 my @args = ();
69 my $count = 0;
70 my $ERROR;
71 my $dbg = 0;
72 my $path_smartctl = "/usr/sbin/smartctl";
73 my $path_hddtemp = "/usr/sbin/hddtemp";
74
75 my %color = ();
76 my %mainsettings = ();
77 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
78 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
79
80 open(MBMON_OUT, ">/var/log/mbmon-values");
81 open(FD, "/usr/bin/mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ;
82
83 while( $_ = <FD> )
84 {
85 next unless( /^([A-Za-z][^:\s]+)\s*:\s*([+\-]{0,1}[\d\.]+)/ ) ;
86 $key = $1 ;
87 $value = $2 ;
88 $key =~ y/A-Z/a-z/ ;
89 $mbmon_values{$key} = $value;
90 print(MBMON_OUT "$key=$value\n");
91 }
92 close(FD);
93 close(MBMON_OUT);
94
95 sub gettraffic {
96 my $interface = $_[0];
97
98 my $bytesin=0;
99 my $bytesout=0;
100
101 foreach (@ipacsum){
102 # Incoming...
103 $bytesin += $1 if (/^[\* ]\s+incoming\s+${interface}.+\:\s+(\d+)/);
104 # Forwarded Incoming...
105 $bytesin += $1 if (/^[\* ]\s+forwarded\s+incoming\s+${interface}.+\:\s+(\d+)/);
106 # Outgoing...
107 $bytesout += $1 if (/^[* ]\s+outgoing\s+${interface}.+\:\s+(\d+)/);
108 # Forwarded Outgoing...
109 $bytesout += $1 if (/^[* ]\s+forwarded\s+outgoing\s+${interface}.+\:\s+(\d+)/);
110 }
111 return "$bytesin:$bytesout";
112 }
113
114 sub updatecpudata {
115 if ( ! -e "$rrdlog/cpu.rrd") {
116 RRDs::create ("$rrdlog/cpu.rrd", "--step=300",
117 "DS:user:COUNTER:600:0:500000000",
118 "DS:system:COUNTER:600:0:500000000",
119 "DS:idle:COUNTER:600:0:500000000",
120 "DS:iowait:COUNTER:600:0:500000000",
121 "DS:irq:COUNTER:600:0:500000000",
122 "RRA:AVERAGE:0.5:1:576",
123 "RRA:AVERAGE:0.5:6:672",
124 "RRA:AVERAGE:0.5:24:732",
125 "RRA:AVERAGE:0.5:144:1460");
126 $ERROR = RRDs::error;
127 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
128 }
129
130 my ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq);
131 open STAT, "/proc/stat";
132 while(<STAT>) {
133 chomp;
134 /^cpu\s/ or next;
135 ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq) = split /\s+/;
136 last;
137 }
138 close STAT;
139 $user += $nice;
140 $irq += $softirq;
141 RRDs::update ("$rrdlog/cpu.rrd",
142 "-t", "user:system:idle:iowait:irq",
143 "N:$user:$system:$idle:$iowait:$irq");
144 $ERROR = RRDs::error;
145 print "Error in RRD::update for cpu: $ERROR\n" if $ERROR;
146 }
147
148 sub updateloaddata {
149 if ( ! -e "$rrdlog/load.rrd") {
150 RRDs::create ("$rrdlog/load.rrd", "--step=60",
151 "DS:load1:GAUGE:120:0:U",
152 "DS:load5:GAUGE:120:0:U",
153 "DS:load15:GAUGE:120:0:U",
154 "RRA:AVERAGE:0.5:1:2160",
155 "RRA:AVERAGE:0.5:5:2016",
156 "RRA:AVERAGE:0.5:15:2880",
157 "RRA:AVERAGE:0.5:60:8760");
158 $ERROR = RRDs::error;
159 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
160 }
161 }
162
163 sub updatememdata {
164 my ($memused, $memfree, $memshared, $membuffers, $memcache, $swapused, $swapfree, $swaptotal);
165 if ( ! -e "$rrdlog/mem.rrd") {
166 RRDs::create ("$rrdlog/mem.rrd", "--step=300",
167 "DS:memused:ABSOLUTE:600:0:5000000000",
168 "DS:memfree:ABSOLUTE:600:0:5000000000",
169 "DS:memshared:ABSOLUTE:600:0:5000000000",
170 "DS:membuffers:ABSOLUTE:600:0:5000000000",
171 "DS:memcache:ABSOLUTE:600:0:5000000000",
172 "DS:swapused:ABSOLUTE:600:0:5000000000",
173 "DS:swapfree:ABSOLUTE:600:0:5000000000",
174 "RRA:AVERAGE:0.5:1:576",
175 "RRA:AVERAGE:0.5:6:672",
176 "RRA:AVERAGE:0.5:24:732",
177 "RRA:AVERAGE:0.5:144:1460");
178 $ERROR = RRDs::error;
179 print "Error in RRD::create for mem: $ERROR\n" if $ERROR;
180 }
181
182 open MEM, "/proc/meminfo";
183 while(<MEM>) {
184 chomp;
185 if ($_ =~ /^MemTotal:/) {my @temp = split (/\s+/, $_);$memused = $temp[1];
186 } elsif ($_ =~ /^MemFree:/) {my @temp = split (/\s+/, $_);$memfree = $temp[1];
187 } elsif ($_ =~ /^Cached:/) {my @temp = split (/\s+/, $_);$memcache = $temp[1];
188 } elsif ($_ =~ /^Buffers:/) {my @temp = split (/\s+/, $_);$membuffers = $temp[1];
189 } elsif ($_ =~ /^SwapTotal:/) {my @temp = split (/\s+/, $_);$swaptotal = $temp[1];
190 } elsif ($_ =~ /^SwapFree:/) {my @temp = split (/\s+/, $_);$swapfree = $temp[1];}
191 }
192 close MEM;
193
194 system("/bin/df > /tmp/diskfree");
195 open DF, "/tmp/diskfree";
196 while(<DF>) {
197 chomp;
198 if ($_ =~ /^shm/) {my @temp = split (/\s+/, $_);$memshared = $temp[2];}
199 }
200 close DF;
201 system("/bin/rm -f /tmp/diskfree");
202 $swapused = $swaptotal-$swapfree;
203 RRDs::update ("$rrdlog/mem.rrd",
204 "-t", "memused:memfree:memshared:membuffers:memcache:swapused:swapfree",
205 "N:$memused:$memfree:$memshared:$membuffers:$memcache:$swapused:$swapfree");
206 $ERROR = RRDs::error;
207 print "Error in RRD::update for mem: $ERROR\n" if $ERROR;
208 }
209
210 sub updatediskdata {
211 my $disk = $_[0];
212 my ($readsect, $writesect, $trash);
213 my @array = split(/\//,$disk);
214 if ( ! -e "$rrdlog/disk-".$array[$#array].".rrd") {
215 RRDs::create ("$rrdlog/disk-".$array[$#array].".rrd", "--step=300",
216 "DS:readsect:COUNTER:600:0:5000000000",
217 "DS:writesect:COUNTER:600:0:5000000000",
218 "RRA:AVERAGE:0.5:1:576",
219 "RRA:AVERAGE:0.5:6:672",
220 "RRA:AVERAGE:0.5:24:732",
221 "RRA:AVERAGE:0.5:144:1460");
222 $ERROR = RRDs::error;
223 print "Error in RRD::create for disk $disk: $ERROR\n" if $ERROR;
224 }
225 my $Zeilen = `/usr/bin/iostat $disk | tail -2 | head -1`;
226 ($trash, $trash, $trash, $trash, $readsect, $writesect) = split(/\s+/,$Zeilen);
227 print "\nread:".$readsect."write:".$writesect."\n";
228 if ($readsect && $writesect) {
229 RRDs::update ("$rrdlog/disk-".$array[$#array].".rrd",
230 "-t", "readsect:writesect",
231 "N:$readsect:$writesect");
232 $ERROR = RRDs::error;
233 print "Error in RRD::update for disk $disk: $ERROR\n" if $ERROR;
234 } else {print "Error in RRD::update for disk: $disk no data available\n";}
235 }
236
237 sub updateifdata {
238 my $interface = $_[0];
239 if ( ! -e "$rrdlog/$interface.rrd") {
240 RRDs::create ("$rrdlog/$interface.rrd", "--step=300",
241 "DS:incoming:ABSOLUTE:600:0:12500000",
242 "DS:outgoing:ABSOLUTE:600:0:12500000",
243 "RRA:AVERAGE:0.5:1:576",
244 "RRA:AVERAGE:0.5:6:672",
245 "RRA:AVERAGE:0.5:24:732",
246 "RRA:AVERAGE:0.5:144:1460");
247 $ERROR = RRDs::error;
248 print "Error in RRD::create for $interface: $ERROR\n" if $ERROR;
249 }
250 my $traffic = gettraffic ($interface);
251 RRDs::update ("$rrdlog/$interface.rrd",
252 "-t", "incoming:outgoing",
253 "N:$traffic");
254 $ERROR = RRDs::error;
255 print "Error in RRD::update for $interface: $ERROR\n" if $ERROR;
256 }
257
258 sub updatefwhitsdata {
259 my $portamount=0;
260 my $alertaktuell=0;
261 my $aktuell=0;
262 my $portaktuell=0;
263 my $skip=0;
264 if (! -e "$rrdlog/firewallhits.rrd"){
265 RRDs::create ("$rrdlog/firewallhits.rrd", "--step=300",
266 "DS:amount:GAUGE:600:0:U",
267 "DS:portamount:GAUGE:600:0:U",
268 "RRA:AVERAGE:0.5:1:576",
269 "RRA:AVERAGE:0.5:6:672",
270 "RRA:AVERAGE:0.5:24:732",
271 "RRA:AVERAGE:0.5:144:1460");
272 $ERROR = RRDs::error;
273 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
274 }
275 system("logtailfwhits /var/log/messages /var/log/fwhits.messages.offset >/tmp/messages.fwhits");
276 if (!(open (FILE,'/tmp/messages.fwhits'))) {$skip=1;}
277 $aktuell = 0;
278 if (!$skip) {
279 while (<FILE>) {
280 if (/kernel:.*(IN=.*)$/) {$aktuell++;}
281 }
282 close (FILE);
283 }
284 system("logtailfwhits /var/log/snort/alert /var/log/snort/fwhits.alert.offset >/tmp/snort.fwhits");
285 if (!(open (FILE,'/tmp/snort.fwhits'))) {$skip=1;}
286 $alertaktuell = 0;
287 if (!$skip) {
288 while (<FILE>) {
289 if (/scan.*$/) {$alertaktuell++;}
290 }
291 close (FILE);
292 }
293 if (!(open (FILE,'/tmp/messages.fwhits'))) {$skip=1;}
294 $portaktuell = 0;
295 if (!$skip) {
296 while (<FILE>) {
297 if (/kernel:.*(Scan.*)$/) {$portaktuell++;}
298 }
299 close (FILE);
300 }
301 system("rm /tmp/messages.fwhits");
302 system("rm /tmp/snort.fwhits");
303 $portamount = $portaktuell + $alertaktuell;
304 chomp($portamount);
305 RRDs::update ("$rrdlog/firewallhits.rrd",
306 "N:$aktuell:$portamount");
307 $ERROR = RRDs::error;
308 print "Error in RRD::update for Firewallhits: $ERROR\n" if $ERROR;
309 }
310
311 # Creates and updates a link quality database
312 # -------------------------------------------
313 sub updatelq {
314 if ( ! -e "$rrdlog/lq.rrd") {
315 RRDs::create ("$rrdlog/lq.rrd", "--step=300",
316 "DS:loss:GAUGE:600:0:100",
317 "DS:roundtrip:GAUGE:600:0:10000",
318 "RRA:AVERAGE:0.5:1:576",
319 "RRA:AVERAGE:0.5:6:672",
320 "RRA:AVERAGE:0.5:24:732",
321 "RRA:AVERAGE:0.5:144:1460");
322 $ERROR = RRDs::error;
323 print "Error in RRD::create for link: $ERROR\n" if $ERROR;
324 }
325 my $packetloss=0;
326 my $roundtrip=0;
327 my $test=0;
328 #LQ_GATEWAY is the ip of your isp's public ip facing you
329 my $LQ_GATEWAY=`cat /var/ipfire/red/remote-ipaddress`;
330 chomp($LQ_GATEWAY);
331 my $NUMPINGS=5;
332 my $pingoutput = `/usr/bin/ping -w 10 -c $NUMPINGS -q $LQ_GATEWAY | tail -2`;
333 my @temp = split (/\/|\%|\s/, $pingoutput);
334 $packetloss = $temp[5];
335 $roundtrip = $temp[17];
336 print "Paketlos->".$packetloss."<-Roundtrip->".$roundtrip."<-\n";
337 if ( $packetloss eq "100" ){
338 my $pingoutput = `/usr/bin/ping -w 10 -c $NUMPINGS -q ping.ipfire.org | tail -2`;
339 my @temp = split (/\/|\%|\s/, $pingoutput);
340 $packetloss = $temp[5];
341 $roundtrip = $temp[17];
342 print "Paketlos->".$packetloss."<-Roundtrip->".$roundtrip."<-\n";
343 }
344 RRDs::update ("$rrdlog/lq.rrd", "N:$packetloss:$roundtrip");
345 $ERROR = RRDs::error;
346 print "Error in RRD::update for line quality: $ERROR\n" if $ERROR;
347 }
348
349 sub updatehdddata
350 {
351 my $disk = $_[0];
352 my $standby;
353 my @array = split(/\//,$disk);
354
355 if ( ! -e "$rrdlog/hddshutdown-".$array[$#array].".rrd"){
356 # database did not exist -> create
357 RRDs::create ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "--step=300",
358 "DS:standby:GAUGE:600:0:1",
359 "RRA:AVERAGE:0.5:1:576",
360 "RRA:AVERAGE:0.5:6:672",
361 "RRA:AVERAGE:0.5:24:732",
362 "RRA:AVERAGE:0.5:144:1460");
363 $ERROR = RRDs::error;
364 print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
365 }
366
367 if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
368 else {$standby = 0;}
369
370 RRDs::update ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
371 $ERROR = RRDs::error;
372 print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
373
374 if ( ! -e "$rrdlog/hddtemp-".$array[$#array].".rrd"){
375 # database did not exist -> create
376 RRDs::create ("$rrdlog/hddtemp-".$array[$#array].".rrd", "--step=300",
377 "DS:temperature:GAUGE:600:0:100",
378 "RRA:AVERAGE:0.5:1:576",
379 "RRA:AVERAGE:0.5:6:672",
380 "RRA:AVERAGE:0.5:24:732",
381 "RRA:AVERAGE:0.5:144:1460");
382 $ERROR = RRDs::error;
383 print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
384 }
385
386 # Temperaturlesen wÃrde die Platte aufwecken!!!
387 if (!$standby){
388 $temp = 0;
389 my $hdd_output = '';
390 my $smart_output = '';
391 if ( -e "$path_smartctl" ){system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");}
392 if ( -e "$path_hddtemp" ){
393 $hdd_output = `$path_hddtemp -qn /dev/$disk`;
394 # I know 4 response possible responses:
395 #
396 # /dev/harddisk: harddisk type: S.M.A.R.T. not available
397 # /dev/harddisk: harddisk type: no sensor
398 # /dev/harddisk: harddisk type: 37?C or ?F
399 # 37
400
401 if ( index($hdd_output, "S.M.A.R.T.") != -1 ){$temp = 0;}
402 elsif ( index($hdd_output, "no sensor") != -1 ){$temp = 1;}
403 elsif ( index($hdd_output, "$disk") != -1 ){my @temp = split(/:/,$hdd_output);$temp[2] =~ s/\D//gi;$temp = $temp[2];}
404 else{$hdd_output =~ /(\d+)\s/;$temp = $1;}
405 }
406 elsif ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
407 $hdd_output = `cat /var/log/smartctl_out_hddtemp-".$array[$#array]." | grep Temperature_`;
408 my @t = split(/\s+/,$hdd_output);
409 $temp = $t[9];
410 }else{$temp = 0;}
411
412 print "Temperature for ".$array[$#array]."->".$temp."<-\n";
413 # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
414 if ($temp){
415 RRDs::update ("$rrdlog/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
416 $ERROR = RRDs::error;
417 print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
418 }
419 }
420 }
421
422 sub updatembmondata
423 {
424 if ( ! -e "$rrdlog/mbmon.rrd" ){
425 # database did not exist -> create
426
427 @args = ("$rrdlog/mbmon.rrd");
428 push(@args, "--step=300");
429 foreach $key ( sort(keys %mbmon_values) ){push(@args, "DS:$key:GAUGE:600:U:U");}
430 push(@args, "RRA:AVERAGE:0.5:1:576");
431 push(@args, "RRA:AVERAGE:0.5:6:672");
432 push(@args, "RRA:AVERAGE:0.5:24:732");
433 push(@args, "RRA:AVERAGE:0.5:144:1460");
434
435 print("create ". join( ", ", @args)) if ( $dbg );
436 RRDs::create (@args);
437 $ERROR = RRDs::error;
438 print("Error in RRD::create for mbmon: $ERROR\n") if $ERROR;
439 }
440
441 my @ds;
442 my @val;
443 my $template;
444
445 foreach $key ( sort(keys %mbmon_values) ){
446 push(@ds, $key);
447 push(@val, $mbmon_values{$key});
448 }
449
450 $template = join(':', @ds);
451 $value = "N:".join(':', @val);
452
453 print("update template = '$template'\n") if ( $dbg );
454 print("update value = '$value'\n") if ( $dbg );
455
456 RRDs::update("$rrdlog/mbmon.rrd", "-t", $template, $value);
457 $ERROR = RRDs::error;
458 print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR;
459 }
460
461 ## Update ipac logs
462 system ('/usr/sbin/fetchipac');
463 sleep 8;
464
465 ###
466 ### Squid Graphs
467 ###
468 if ( -e "/var/log/squid/access.log") {system ("/usr/bin/squid-graph -o=/srv/web/ipfire/html/sgraph --tcp-only < /var/log/squid/access.log >/dev/null 2>&1");}
469
470 ###
471 ### utf8 conversion
472 ###
473 if ((${Lang::language} eq 'cs') || (${Lang::language} eq 'hu') || (${Lang::language} eq 'pl') || (${Lang::language} eq 'sk')) {
474 # Czech, Hungarian, Polish and Slovak character set
475 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-2");}
476 } elsif (${Lang::language} eq 'tr') {
477 # Turkish
478 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-9");}
479 } else {
480 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-1");}
481 }
482
483 ###
484 ### System graphs
485 ###
486 updatecpudata();
487 updateloaddata();
488 updatememdata();
489
490 ###
491 ### HDD graphs
492 ###
493
494
495 my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
496 system("unlink /tmp/hddstatus && touch /tmp/hddstatus");
497 print "\nFound following amount of disks:".@disks."\n";
498 foreach (@disks){
499 my $disk = $_;
500 chomp $disk;
501 print "Working on disk ".$disk.".\n";
502
503 my $status = "";
504 my $diskstats = "";
505 my $newdiskstats = "";
506 my @array = split(/\//,$disk);
507
508 $diskstats = `cat /tmp/hddstats-$array[$#array]`;
509 chomp $diskstats;
510 my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
511 chomp $newdiskstats;
512 my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
513 chomp $status;
514
515 if ($status !~/standby/ || $diskstats ne $newdiskstats){
516 if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
517 }
518
519 if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
520 else{$status = " active\n";}
521
522 open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
523 print DATEI $disk."-".$status;
524 close(DATEI);
525
526 updatediskdata($disk);
527 updatehdddata($disk);
528
529 }
530
531 ###
532 ### Firewallhits
533 ###
534 updatefwhitsdata();
535
536 ###
537 ### Link Quality
538 ###
539 updatelq();
540
541 ###
542 ### Mbmon Data
543 ###
544 updatembmondata();
545
546 ###
547 ### Network Graphs
548 ###
549 @ipacsum = `/usr/sbin/ipacsum --exact -s 5m 2>/dev/null`;
550 if (@ipacsum) {
551 updateifdata ("GREEN");
552 updateifdata ("RED");
553 if ($settings{'CONFIG_TYPE'} =~ /^(2|4)$/ ) {updateifdata ("ORANGE");}
554 if ($settings{'CONFIG_TYPE'} =~ /^(3|4)$/ ) {updateifdata ("BLUE");}
555 }