Changeset 3822
- Timestamp:
- 07/26/10 15:02:09 (2 years ago)
- Files:
-
- trunk/node/lib/Munin/Node/SpoolWriter.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/node/lib/Munin/Node/SpoolWriter.pm
r3803 r3822 48 48 # work out where to store the line 49 49 if ($line =~ m/(?:\w+)\.value (?:[0-9]+:)?(?:-?[0-9.]+|U)/) { 50 # It's a data line51 $fh = $fh_data ||= IO::File->new($self->{spooldir} . "/munin-daemon.$service.data", "a+");52 53 50 # If the value line isn't timestamped 54 51 # we have to add the timestamp on the line 55 52 $line =~ s/(\w+)\.value (?!\d+:)(-?[0-9.]+|U)/$1.value $timestamp:$2/; 56 } else { 53 54 # It's a data line 55 $fh = $fh_data ||= IO::File->new($self->{spooldir} . "/munin-daemon.$service.data", "a+"); 56 } 57 else { 57 58 # It's a config line 58 59 $fh = $fh_config ||= IO::File->new($self->{spooldir} . "/munin-daemon.$service.config", "w"); 59 60 } 60 61 61 print {$fh} $line, "\n"; 62 unless ($fh) { 63 logger("Unable to open spool file: $!"); 64 return; 65 } 66 67 print {$fh} $line, "\n" or logger("Error writing results: $!"); 62 68 } 63 69
