]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/scripts/makegraphs
changed temperature reading to smartctrl
[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 "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
393 $hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
394 my @t = split(/\s+/,$hdd_output);
395 $temp = $t[9];
396 }else{$temp = 0;}
397 print "Temperature for ".$array[$#array]."->".$temp."<-\n";
398 system("echo \"Temperature for $array[$#array] -> $temp <-\n\" >>/tmp/debug");
399 # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
400 if ($temp){
401 RRDs::update ("$rrdlog/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
402 $ERROR = RRDs::error;
403 print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
404 }
405 }
406 }
407
408 sub updatembmondata
409 {
410 if ( ! -e "$rrdlog/mbmon.rrd" ){
411 # database did not exist -> create
412
413 @args = ("$rrdlog/mbmon.rrd");
414 push(@args, "--step=300");
415 foreach $key ( sort(keys %mbmon_values) ){push(@args, "DS:$key:GAUGE:600:U:U");}
416 push(@args, "RRA:AVERAGE:0.5:1:576");
417 push(@args, "RRA:AVERAGE:0.5:6:672");
418 push(@args, "RRA:AVERAGE:0.5:24:732");
419 push(@args, "RRA:AVERAGE:0.5:144:1460");
420
421 print("create ". join( ", ", @args)) if ( $dbg );
422 RRDs::create (@args);
423 $ERROR = RRDs::error;
424 print("Error in RRD::create for mbmon: $ERROR\n") if $ERROR;
425 }
426
427 my @ds;
428 my @val;
429 my $template;
430
431 foreach $key ( sort(keys %mbmon_values) ){
432 push(@ds, $key);
433 push(@val, $mbmon_values{$key});
434 }
435
436 $template = join(':', @ds);
437 $value = "N:".join(':', @val);
438
439 print("update template = '$template'\n") if ( $dbg );
440 print("update value = '$value'\n") if ( $dbg );
441
442 RRDs::update("$rrdlog/mbmon.rrd", "-t", $template, $value);
443 $ERROR = RRDs::error;
444 print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR;
445 }
446
447 ## Update ipac logs
448 system ('/usr/sbin/fetchipac');
449 sleep 8;
450
451 ###
452 ### Squid Graphs
453 ###
454 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");}
455
456 ###
457 ### utf8 conversion
458 ###
459 if ((${Lang::language} eq 'cs') || (${Lang::language} eq 'hu') || (${Lang::language} eq 'pl') || (${Lang::language} eq 'sk')) {
460 # Czech, Hungarian, Polish and Slovak character set
461 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-2");}
462 } elsif (${Lang::language} eq 'tr') {
463 # Turkish
464 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-9");}
465 } else {
466 foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-1");}
467 }
468
469 ###
470 ### System graphs
471 ###
472 updatecpudata();
473 updateloaddata();
474 updatememdata();
475
476 ###
477 ### HDD graphs
478 ###
479
480
481 my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
482 system("unlink /tmp/hddstatus && touch /tmp/hddstatus");
483 print "\nFound following amount of disks:".@disks."\n";
484 foreach (@disks){
485 my $disk = $_;
486 chomp $disk;
487 print "Working on disk ".$disk.".\n";
488
489 my $status = "";
490 my $diskstats = "";
491 my $newdiskstats = "";
492 my @array = split(/\//,$disk);
493
494 $diskstats = `cat /tmp/hddstats-$array[$#array]`;
495 chomp $diskstats;
496 my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
497 chomp $newdiskstats;
498 my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
499 chomp $status;
500
501 if ($status !~/standby/ || $diskstats ne $newdiskstats){
502 if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
503 }
504
505 if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
506 else{$status = " active\n";}
507
508 open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
509 print DATEI $disk."-".$status;
510 close(DATEI);
511
512 updatediskdata($disk);
513 updatehdddata($disk);
514
515 }
516
517 ###
518 ### Firewallhits
519 ###
520 updatefwhitsdata();
521
522 ###
523 ### Link Quality
524 ###
525 updatelq();
526
527 ###
528 ### Mbmon Data
529 ###
530 updatembmondata();
531
532 ###
533 ### Network Graphs
534 ###
535 @ipacsum = `/usr/sbin/ipacsum --exact -s 5m 2>/dev/null`;
536 if (@ipacsum) {
537 updateifdata ("GREEN");
538 updateifdata ("RED");
539 if ($settings{'CONFIG_TYPE'} =~ /^(2|4)$/ ) {updateifdata ("ORANGE");}
540 if ($settings{'CONFIG_TYPE'} =~ /^(3|4)$/ ) {updateifdata ("BLUE");}
541 }