#ErrorLevel,Computer,IDO,Description,MinValue,MinTime,MaxValue,MaxTime,CurrentValue,CurrentTime 0,localhost,1.3.6.1.4.1.314.50.1.20.3.1.3,CFG persistent MEM,18720,11:29,18760,12:30,17176,14:26 #### if (! /^\s*(\d),(\w+),([\d\.]+),([^,]+),([^,]+),(\d+:\d+),([^,]+),(\d+:\d+),.*$/ ) { exit_error("Cannot parce log file") } $level=$1; $computer=$2; $iod=$3; $comment=$4; $min_value=$5; $min_time=$6; $max_value=$7; $max_time=$8; if ( $CONFIG{$computer}{iod}{$iod}{value} =~ /\w+/ ) {} elsif ( $CONFIG{$computer}{iod}{$iod}{value} < $min_value ) { $min_value = $CONFIG{$computer}{iod}{$iod}{value}; $min_time = "$hour:$min"; } elsif ( $CONFIG{$computer}{iod}{$iod}{value} > $max_value ) { $max_value = $CONFIG{$computer}{iod}{$iod}{value}; $max_time = "$hour:$min"; } print LOG "$level,$computer,$iod,$comment,$min_value,$min_time,$max_value, $max_time,$CONFIG{$computer}{iod}{$iod}{value},$hour:$min\n";