I was having some trouble with check-log.rb here. It crashed while parsing /var/log/syslog, because it found some really weird characters in there, which were logged e. g. together with strange GET requests. I fixed this for me applying the patch below, its a one liner. Maybe you want to consider applying this to the check, making it more robust, though it may drop some bytes now.
Kind Regards,
Philipp
@@ -106,6 +106,7 @@
@log.seek(@bytes_to_skip, File::SEEK_SET)
end
@log.each_line do |line|
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
bytes_read += line.size
if m = line.match(config[:pattern])
if m[1]
Hi all,
I was having some trouble with check-log.rb here. It crashed while parsing /var/log/syslog, because it found some really weird characters in there, which were logged e. g. together with strange GET requests. I fixed this for me applying the patch below, its a one liner. Maybe you want to consider applying this to the check, making it more robust, though it may drop some bytes now.
Kind Regards,
Philipp
@@ -106,6 +106,7 @@ @log.seek(@bytes_to_skip, File::SEEK_SET) end @log.each_line do |line|