Ad Widget

Collapse

vfs.file.time - Date in file name expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LionsPark
    Junior Member
    • Aug 2015
    • 3

    #1

    vfs.file.time - Date in file name expression

    Hi all,

    I am trying to monitor a Windows file to see if it has changed in the last 15 Min. The issue I am having, is that the directory and file name changes every day. The file format is V:\somename\yyyyMM\dd_Filename.ext

    If I use vfs.file.time[V:\\Logfile\\201508\\07_log.txt,modify] zabbix collects data. I am now trying to create regexp_describing_filename_pattern that includes Year, Month and Day.

    i.e. vfs.file.time[V:\\Logfile\\”yyyyMM”\\”dd”_log.txt,modify]

    Does anyone have any ideas on how to do this?

    Thank you,
    Gary
  • LionsPark
    Junior Member
    • Aug 2015
    • 3

    #2
    Well, it is not exactly what I wanted. I like the idea of using the vfs.file.time builtin function in Zabbix, but here is how I got around my issue.

    I am using the windows date %Date% like this to pull apart the current date to find the current log file.
    %Date:~5,2%
    On the windows server, I added the following into the Zabbix config file
    Code:
    UserParameter=RepFileDate,for %I in (V:\\Program\\Replication\\%Date:~0,4%%Date:~5,2%\\%Date:~8,2%_LogFile.TXT) do @echo %~tI
    I then used "RepFileDate" in my items and triggers.

    I am always looking for a better way to do this. If anyone knows how to use variables in the vfs.file.time[] i'm still interested.

    Thank you,

    Gary

    Comment

    • jamesNJ
      Senior Member
      • Jun 2015
      • 103

      #3
      You might be able to insert a macro in the place where you need that date. I had an idea in another post:


      I tried this out and it seems possible to create a user defined global macro and then have an external process modify the database directly to alter that macro as needed.

      Comment

      • LionsPark
        Junior Member
        • Aug 2015
        • 3

        #4
        Originally posted by jamesNJ
        You might be able to insert a macro in the place where you need that date. I had an idea in another post:


        I tried this out and it seems possible to create a user defined global macro and then have an external process modify the database directly to alter that macro as needed.
        Hi, thank you for the idea.

        I will play around with the Macros and see if I can use {$DATE} or create my own.

        Gary

        Comment

        Working...