Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seekfiles ignored after server reboot #65

Open
nicutor opened this issue Jan 20, 2022 · 6 comments
Open

seekfiles ignored after server reboot #65

nicutor opened this issue Jan 20, 2022 · 6 comments

Comments

@nicutor
Copy link

nicutor commented Jan 20, 2022

Hi,

I gave a reboot to the server and even if the seekfile was there, the logfile was fully processed again.

$protocolsdir = '/usr/local/test/tmp/logfiles';
$seekfilesdir = '/usr/local/test/tmp/logfiles';
$protocolretention = '30';
$scriptpath = '/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/test/bin';
$options = 'preview=1';

@searches = (
  {
    tag => 'test',
    logfile => '/usr/local/test/logs/test_log',
    criticalpatterns => [
      '\{test\}'
    ],
    options => 'nologfilenocry,nosavethresholdcount,maxlength=1024,allyoucaneat,criticalthreshold=1,script',
    script => 'logfiles_test.sh'
  }
);

Because of this, the script was run again even if was not supposed to do so.

Is this the normal behaviour? I am missing something? Shouldn't the seekfile be used all the time if exists?

Thank you.

@nicutor nicutor changed the title seekfilesdir ignored after server reboot seekfiles ignored after server reboot Jan 20, 2022
@lausser
Copy link
Owner

lausser commented Jan 20, 2022 via email

@hpreusse
Copy link

hpreusse commented Jan 28, 2022

Same issue here, the "check_logfiles -v" is attached. Striking is the message

Fri Jan 28 15:47:23 2022: this is not the same logfile /appl/laugh/test.log 64774:4163772 != 64770:4163772

check_logfiles thinks that this is a new file due to the changing device id. Informations about the system: this is a KVM VM, file system is xfs and we're using LVM. The changing device id's are visible in the seek file (parameter "devino"). How can we avoid that then device id's are read and used to recognize the log file? Thanks!

changing_device_id.log

@hpreusse
Copy link

Another remark: the elastic people have similar issues, here the file identity strategy can be configured.

@lausser
Copy link
Owner

lausser commented Jan 29, 2022 via email

@hpreusse
Copy link

Sorry, I'm to stupid to use that option. What am I doing wrong? ramdomdevno does not work either although the commit c29c3d4 gives the idea that correct option name is randomdevno. Thanks!

[icinga@hostname ~]$ /opt/laugh/icinga/scripts/check_logfiles_v4.0.1.3 -v '--criticalpattern' 'error|fehler' '--logfile' '/appl/laugh/test.log' '--warningpattern' 'warning|warnung'                                                          Mon Jan 31 21:16:53 2022: ==================== /appl/laugh/test.log ==================
Mon Jan 31 21:16:53 2022: try pre2seekfile /var/tmp/check_logfiles/check_logfiles.test.log.seek instead
Mon Jan 31 21:16:53 2022: try pre3seekfile /tmp/check_logfiles._appl_laugh_test.log.seek instead
Mon Jan 31 21:16:53 2022: no seekfile /var/tmp/check_logfiles/check_logfiles._appl_laugh_test.log.seek found
Mon Jan 31 21:16:53 2022: but logfile /appl/laugh/test.log found
Mon Jan 31 21:16:53 2022: ILS lastlogfile = /appl/laugh/test.log
Mon Jan 31 21:16:53 2022: ILS lastoffset = 119 / lasttime = 0 (Thu Jan  1 01:00:00 1970) / inode = 64770:4163772
Mon Jan 31 21:16:53 2022: the logfile did not change
Mon Jan 31 21:16:53 2022: keeping position 119 and time 0 (Thu Jan  1 01:00:00 1970) for inode 64770:4163772 in mind
OK - no errors or warnings|'default_lines'=0 'default_warnings'=0 'default_criticals'=0 'default_unknowns'=0
[icinga@hostname ~]$ /opt/laugh/icinga/scripts/check_logfiles_v4.0.1.3 -v '--criticalpattern' 'error|fehler' '--logfile' '/appl/laugh/test.log' '--warningpattern' 'warning|warnung' --randomdevno
Unknown option: randomdevno
<snip>
[icinga@hostname ~]$ /opt/laugh/icinga/scripts/check_logfiles_v4.0.1.3 -version
check_logfiles_v4.0.1.3 v4.0.1.3

@hpreusse
Copy link

I can confirm that version 4.1 (when using the option --randomdevno) solves the issue for me. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants