Changeset 1751
- Timestamp:
- 12/03/08 10:13:29 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/DEV-opsview3/opsview-core/installer/migrate_rrds
r1748 r1751 37 37 use XML::LibXML; 38 38 39 # Cache all hostnames and servicenames for faster checking later 39 40 my $hostnames = {}; 40 41 my $it = Opsview::Host->retrieve_all; … … 57 58 my @files = grep /\.rrd$/, readdir D; 58 59 closedir D; 60 61 my $rrd_migration_flag = "/usr/local/nagios/var/rrd_migration.flag"; 62 open F, "> $rrd_migration_flag" or die "Cannot create migration flag"; 63 close F; 59 64 60 65 foreach my $file (@files) { … … 79 84 } 80 85 } 81 if ($found) { 82 print "hostname=$hostname, servicename=$servicename, db=$db\n"; 83 } else { 86 unless ($found) { 84 87 print "ERROR: $file - cannot match to a hostname or servicename\n"; 85 88 next; 86 89 } 90 91 my $time = scalar localtime; 92 print "$time: hostname=$hostname, servicename=$servicename, db=$db\n"; 87 93 88 94 # Dump the rrd, save to file … … 220 226 } 221 227 222 # Delete the original rrd 223 } 224 } 228 print "Created $metric - $rrdname\n"; 229 } 230 231 # Delete the original rrd 232 unlink "$rrddir/$file"; 233 print "...done\n"; 234 } 235 236 unlink $rrd_migration_flag; 225 237 226 238 # From insert.pl
