Hi everyone,
I found a small bug that will be corrected in v3.0.92.
If you are on a small server that doesn't get very many messages, the cache doesn't have enough time to build before the program exits, thus leaving you with an empty hosts, programs and mnemonics (if any).
To remedy this, you can add the following to your db_insert.pl around line 290:
Existing Code:
if (eof()) { # check for end of last file
open (DUMP, ">$dumpfile") or die "can't open $dumpfile: $!\n";
print LOG "EOF - Flushing buffer\n" if ($debug > 0);
print STDOUT "EOF - Flushing buffer\n" if ($debug > 0);
print STDOUT "Importing $#dumparr messages into the database\n" if ($debug > 0);
print LOG "Importing $#dumparr messages into the database\n" if ($debug > 0);
print DUMP @dumparr;
undef (@dumparr);
close (DUMP);
$db_load->execute();
if ($db_load->errstr()) {
print STDOUT "FATAL: Unable to execute SQL statement: ", $db_load->errstr(), "\n" if ($debug > 0);
}
Add the next bit of code right after the } statement above:
# Added to insert cached hosts, progs and mnes
my @hosts = keys %host_cache;
foreach my $h (@hosts) {
$db_insert_host->execute($h);
}
my @prgs = keys %program_cache;
foreach my $p (@prgs) {
$db_insert_prg->execute($p, $program_cache{$p});
}
my @mnes = keys %mne_cache;
foreach my $m (@mnes) {
$db_insert_mne->execute($m, $mne_cache{$m});
}
%host_cache = ();
%program_cache = ();
%mne_cache = ();
# End add