Voila après avoir consulté le log d'ods, je me suis rendu compte qu'il etait bourré d'erreur, enfin toujours la meme
Error in Drain function 2 : Unknown column 'hg_id' in 'where clause'
Après quelques recherches sur le forum, j'ai vu que c'était due à une mauvaise application du patch 23 (je me rappelle avoir eu une erreur).
J'ai mon fichier parsing_log.pl qui contient ceci :
}
if ($opt_a) {
parseArchive;
} else {
parseLogFile();
}
# if ($retention ne 0){
# my $last_log = time() - ($retention * 24 * 60 * 60);
# my $sth1 = $dbh->prepare("DELETE FROM log WHERE ctime < '$last_log'");
# if (!$sth1->execute) {die "Error:" . $sth1->errstr . "\n";}
# }
exit;
et le fichier parsing_log.pl.rej :
*** 72,108 ****
}
}
while (<FILE>) {
- if ($_ =~ /^\[([0-9]*)\]\sSERVICE ALERT\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\
~\@\+\#\!\?]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `type`, `retry`, `output`) VALUES ('0', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."', '".$tab[3].
"','".$tab[4]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sHOST ALERT\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\
^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `status`, `type`, `re
try`, `output`) VALUES ('1', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."','".$tab[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sSERVICE NOTIFICATION\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\
=\<\>\*\$\^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sHOST NOTIFICATION\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<
\>\*\$\^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sWarning\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\~
\@\+\#\!\?\*]*)/){
my $tab = $2;
$ctime = $1;
$tab =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `output`) VALUES ('4','$ctime', '".$
tab."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\~\@\+\#\!\?\
*]*)/) {
$ctime = $1;
my $tab = $2;
$tab =~ s/\'/\\\'/g;
--- 71,107 ----
}
}
while (<FILE>) {
+ if ($_ =~ m/^\[([0-9]*)\]\sSERVICE ALERT\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `type`, `retry`, `output`) VALUES ('0', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."', '".$tab[3].
"','".$tab[4]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST ALERT\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `status`, `type`, `re
try`, `output`) VALUES ('1', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."','".$tab[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sSERVICE NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sWarning\:\s(.*)$/){
my $tab = $2;
$ctime = $1;
$tab =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `output`) VALUES ('4','$ctime', '".$
tab."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\s(.*)$/) {
$ctime = $1;
my $tab = $2;
$tab =~ s/\'/\\\'/g;
Apparement il faut supprimer/ajouter des lignes.Je n'ai pas très bien compris la chose.Jusqu'ou enlever les lignes -, ou ajouter les lignes précédés du +
Si quelqu'un pourrait m'éclairer..
Merci d'avance!

Error in Drain function 2 : Unknown column 'hg_id' in 'where clause'
Après quelques recherches sur le forum, j'ai vu que c'était due à une mauvaise application du patch 23 (je me rappelle avoir eu une erreur).
J'ai mon fichier parsing_log.pl qui contient ceci :
}
if ($opt_a) {
parseArchive;
} else {
parseLogFile();
}
# if ($retention ne 0){
# my $last_log = time() - ($retention * 24 * 60 * 60);
# my $sth1 = $dbh->prepare("DELETE FROM log WHERE ctime < '$last_log'");
# if (!$sth1->execute) {die "Error:" . $sth1->errstr . "\n";}
# }
exit;
et le fichier parsing_log.pl.rej :
*** 72,108 ****
}
}
while (<FILE>) {
- if ($_ =~ /^\[([0-9]*)\]\sSERVICE ALERT\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\
~\@\+\#\!\?]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `type`, `retry`, `output`) VALUES ('0', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."', '".$tab[3].
"','".$tab[4]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sHOST ALERT\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\
^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `status`, `type`, `re
try`, `output`) VALUES ('1', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."','".$tab[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sSERVICE NOTIFICATION\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\
=\<\>\*\$\^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sHOST NOTIFICATION\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<
\>\*\$\^\~\@\+\#\!\?\*]*)/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\sWarning\:\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\~
\@\+\#\!\?\*]*)/){
my $tab = $2;
$ctime = $1;
$tab =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `output`) VALUES ('4','$ctime', '".$
tab."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
- } elsif ($_ =~ /^\[([0-9]*)\]\ ([a-zA-Z0-9\.\-\_\ \%\'\"\(\[\]\)\{\}\,\;\:\/\=\<\>\*\$\^\~\@\+\#\!\?\
*]*)/) {
$ctime = $1;
my $tab = $2;
$tab =~ s/\'/\\\'/g;
--- 71,107 ----
}
}
while (<FILE>) {
+ if ($_ =~ m/^\[([0-9]*)\]\sSERVICE ALERT\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `type`, `retry`, `output`) VALUES ('0', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."', '".$tab[3].
"','".$tab[4]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST ALERT\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `status`, `type`, `re
try`, `output`) VALUES ('1', '$ctime', '".$tab[0]."', '".$tab[1]."', '".$tab[2]."','".$tab[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sSERVICE NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[5] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `host_name` , `service_description`,
`status`, `notification_cmd`, `notification_contact`, `output`) VALUES ('2', '$ctime', '".$tab[1]."', '".$tab[2]."',
'".$tab[3]."', '".$tab[4]."','".$tab[0]."','".$tab[5]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sHOST NOTIFICATION\:\s(.*)$/){
my @tab = split(/;/, $2);
$ctime = $1;
$tab[4] =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `notification_contact`, `host_name`
, `status`, `notification_cmd`, `output`) VALUES ('3', '$ctime', '".$tab[0]."','".$tab[1]."', '".$tab[2]."', '".$tab
[3]."','".$tab[4]."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\sWarning\:\s(.*)$/){
my $tab = $2;
$ctime = $1;
$tab =~ s/\'/\\\'/g;
$sth = $dbh->prepare("INSERT INTO `log` (`msg_type`,`ctime`, `output`) VALUES ('4','$ctime', '".$
tab."')");
if (!$sth->execute) {print "Error:" . $sth->errstr . "\n";}
+ } elsif ($_ =~ m/^\[([0-9]*)\]\s(.*)$/) {
$ctime = $1;
my $tab = $2;
$tab =~ s/\'/\\\'/g;
Apparement il faut supprimer/ajouter des lignes.Je n'ai pas très bien compris la chose.Jusqu'ou enlever les lignes -, ou ajouter les lignes précédés du +
Si quelqu'un pourrait m'éclairer..
Merci d'avance!

Comment