Ad Widget

Collapse

Variable file name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ibrahim
    Junior Member
    • Sep 2006
    • 19

    #1

    Variable file name

    Hi,
    I have the following problem that I am trying to solve without much success until now. I have some log files that have their names changed once they reach a certain size limit. Then logging is shifted into another file. So, using zabbix items like log and vfs.file.time isn't possible if I want data about the current file.

    What I tried to first creating an item to get the current file name. Then I configured log and vfs.file.time items using the macro {host:file_name_item.last(0)} as file name parameter. This didn't work. is it supposed to work?

    I thought about using a symbolic link to the current file. But this would require a script to update the link regularly.

    Any ideas how to tackle this problem using zabbix only. Thanks in advance.

    Ibrahim
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Please give me an idea how the file names are rotated and format of their names.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Ibrahim
      Junior Member
      • Sep 2006
      • 19

      #3
      Hi,
      The format of the files is as follows: BF<nnn>.DAT
      where nnn is in the range 001 to 100 (configurable)
      Once BF001.DAT reaches a configurable size limit, logging shifts to BF002.DAT. Finally logging returns to BF001.DAT.

      For these files I need to know the latest modification time and the lest file name. And then I will need a trigger if mo logging is done for 15 minutes.
      I didn't solve this yet.

      Another files I have are simply : SL<nnn>.txt with nnn 001 upward. logging is done to a file until it reached a size limit, then it shifts to the consequent file. In this logging case, there is a lways a file current_logfile.txt that has the latest file name. This one is quite easy to handle. I just created a symbolic link to the current file. log item takes the symblic link as argument. Then i have created an action to update the symblic link when the checksum of current_logfile.txt changes.

      Would appreciate any feedback.
      Many thanks
      Ibrahim

      Comment

      Working...