Ad Widget

Collapse

Logrt regexp troubles

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OlivierF
    Junior Member
    • Apr 2016
    • 8

    #1

    Logrt regexp troubles

    Hi,

    I'm trying to monitor these log files:

    C:\Users\Administrator\.obm\log\1461236863418\Back up\2016-04-21-13-14-26.txt

    C:\Users\Administrator\.obm\log\1461236863418\Back up\2016-04-21-19-26-52.txt

    So I created this key, but it won't match my files..

    logrt["C:\Users\Administrator\.obm\log\1461236863418\Bac kup\^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}.txt$"]

    This is in the agent debug log:

    6264:20160421:200210.591 log files reside on 'NTFS' file system
    6264:20160421:200210.591 there are no files matching "/\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}.txt/" in "C:\Users\Administrator\.obm\log\1461236863418\Bac kup\" or insufficient access rights
    6264:20160421:200210.591 End of process_logrt():SUCCEED
    6264:20160421:200210.591 In need_meta_update() key:logrt["C:\Users\Administrator\.obm\log\1461236863418\Bac kup\/\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}.txt/"]
  • andris
    Zabbix developer
    • Feb 2012
    • 228

    #2
    In file name there is "...Back up..."
    In item key there is "...Bac kup....".
    Is that ok ?

    Comment

    • OlivierF
      Junior Member
      • Apr 2016
      • 8

      #3
      Originally posted by andris
      In file name there is "...Back up..."
      In item key there is "...Bac kup....".
      Is that ok ?
      Hm thank you for your response. That seems to be a copy/paste/markup error... Both are without spaces, just "Backup"

      Comment

      • andris
        Zabbix developer
        • Feb 2012
        • 228

        #4
        You can try
        ^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$
        instead of
        ^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}.txt$

        Comment

        • OlivierF
          Junior Member
          • Apr 2016
          • 8

          #5
          Originally posted by andris
          You can try
          ^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$
          instead of
          ^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}.txt$
          Unfortunately that didn't help.
          Code:
           2620:20160422:112226.696 there are no files matching "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$" in "C:\Users\Administrator\.obm\log\1461236863418\Backup\" or insufficient access rights
          Also tried it without the slash at the end:
          Code:
           1828:20160422:112302.863 there are no files matching "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}.txt$" in "C:\Users\Administrator\.obm\log\1461236863418\Backup\" or insufficient access rights
          Regarding the insufficient rights, the Zabbix agent is running as Local System. SYSTEM has full control on the files.
          I also tried running the service as the local administrator account, but the same message appears in the log.
          Last edited by OlivierF; 22-04-2016, 11:41.

          Comment

          • andris
            Zabbix developer
            • Feb 2012
            • 228

            #6
            This one worked on my test system:
            logrt["C:\Users\Administrator\.obm\log\1461236863418\Bac kup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$"]

            Comment

            • OlivierF
              Junior Member
              • Apr 2016
              • 8

              #7
              Originally posted by andris
              This one worked on my test system:
              logrt["C:\Users\Administrator\.obm\log\1461236863418\Bac kup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$"]
              I'm using agent x64 version 3.0.0, zabbix version 3.0.1
              Is that also what you are using?

              Edit: updated agent to 3.0.2, no change.
              Edit2: Please delete this thread as an example of my stupidity: the file extension was not .txt but .log.
              Last edited by OlivierF; 22-04-2016, 13:23.

              Comment

              • andris
                Zabbix developer
                • Feb 2012
                • 228

                #8
                I tested with Zabbix 3.1.0 (revision 59567), but should be the same with 3.0.0.

                Code:
                 1588:20160422:141746.016 In process_logrt() is_logrt:8 filename:'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$' lastlogs
                ize:12 mtime:1461323339
                  1588:20160422:141746.016 In split_filename() filename:'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$'
                  1588:20160422:141746.016 split_filename() D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$
                  1588:20160422:141746.016 split_filename()                                                                                                            ^
                  1588:20160422:141746.016 In split_string() str:'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$' del:'\.txt$'
                  1588:20160422:141746.016 End of split_string():SUCCEED part1:'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\' part2:'.txt$'
                  1588:20160422:141746.016 cannot find directory 'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}'
                  1588:20160422:141746.016 split_filename() D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$
                  1588:20160422:141746.016 split_filename()                                                     ^
                  1588:20160422:141746.016 In split_string() str:'D:\Users\Administrator\.obm\log\1461236863418\Backup\^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$' del:'\^[0-9]{4}-[0-9]{2}-
                [0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$'
                  1588:20160422:141746.016 End of split_string():SUCCEED part1:'D:\Users\Administrator\.obm\log\1461236863418\Backup\' part2:'^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.txt$'
                  1588:20160422:141746.016 End of split_filename():SUCCEED directory:'D:\Users\Administrator\.obm\log\1461236863418\Backup\' format:'^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.t
                xt$'
                  1588:20160422:141746.016 log files reside on 'VBoxSharedFolderFS' file system
                  1588:20160422:141746.016 In add_logfile() filename:'D:\Users\Administrator\.obm\log\1461236863418\Backup\2016-04-21-13-14-26.txt' mtime:1461323339 size:12
                  1588:20160422:141746.016 add_logfile() logfiles:0000000002031C90 logfiles_alloc:64
                  1588:20160422:141746.032 End of add_logfile()
                  1588:20160422:141746.032 setup_old2new: is_same_file(D:\Users\Administrator\.obm\log\1461236863418\Backup\2016-04-21-13-14-26.txt, D:\Users\Administrator\.obm\log\1461236863418\Backup\2016
                -04-21-13-14-26.txt) = 1
                  1588:20160422:141746.032 process_logrt() old file list:
                  1588:20160422:141746.032    nr:0 filename:'D:\Users\Administrator\.obm\log\1461236863418\Backup\2016-04-21-13-14-26.txt' mtime:1461323339 size:12 processed_size:12 seq:1 incomplete:0 dev:2
                065 ino_hi:0 ino_lo:18446735965097542864 md5size:12 md5buf:c7443c03b4f02e887646f3fa7f96e8a9
                  1588:20160422:141746.032 process_logrt() new file list: (mtime:1461323339 lastlogsize:12 start_idx:0)
                  1588:20160422:141746.032    nr:0 filename:'D:\Users\Administrator\.obm\log\1461236863418\Backup\2016-04-21-13-14-26.txt' mtime:1461323339 size:12 processed_size:12 seq:1 incomplete:0 dev:2
                065 ino_hi:0 ino_lo:18446735965097542864 md5size:12 md5buf:c7443c03b4f02e887646f3fa7f96e8a9
                  1588:20160422:141746.032 End of process_logrt():SUCCEED

                Comment

                • andris
                  Zabbix developer
                  • Feb 2012
                  • 228

                  #9
                  Well, I tested with the file on D: disk, file system 'VBoxSharedFolderFS'.

                  Comment

                  • OlivierF
                    Junior Member
                    • Apr 2016
                    • 8

                    #10
                    Originally posted by andris
                    Well, I tested with the file on D: disk, file system 'VBoxSharedFolderFS'.
                    Thank you very much for your help Andris. I found the issue, the file extension was not .txt, but .log.
                    Apparently these files open with notepad by default

                    Comment

                    Working...