Ad Widget

Collapse

Monitor file age naming issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Awad
    Junior Member
    • Dec 2018
    • 2

    #1

    Monitor file age naming issue

    Hello,

    I wants to monitor the age of a specific file, the file path is: D:\BI\Data\Tes - New.File.12580b5634df4be38ddba7fb58dc47c8
    I was able to do this by writing the below under Zabbix WebPortal 'Key' field:
    vfs.file.time["D:\BI\Data\Test - New.File.12580b5634df4be38ddba7fb58dc47c8",modify]

    The problem is that part of the file name "12580b5634df4be38ddba7fb58dc47c8" keeps changing from time to time, due to this, I was thinking if there is any way to monitor the file by adding the asterisk (*) like the below;
    vfs.file.time["D:\BI\Data\Test - New.File.*",modify]

    This didn't work as Zabbix didn't find the file.

    Please advise if there is any way to do this through Zabbix.

    Thanks,
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #2
    Hi,
    What you could do in this situation is create a script on the server that returns the age of the file and gather the values by creating a UserParameter item in Zabbix.
    You could read more about UserParameter items here - https://www.zabbix.com/documentation...userparameters

    Comment

    • sancho
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2015
      • 295

      #3
      Hi Awad,

      Using Unixutils for windows http://unxutils.sourceforge.net/

      You can create a key system.run with this line dir D: BI\Data\Test-New.File.* | gawk "FNR== 6{print $1","$2}"

      Code:
      system.run[dir D:FBI\Data\Test-New.File.* | gawk "FNR== 6{print $1","$2"]
      Or create the same with UserParameter as ArtursL says.

      Depending on the result of the "dir" you may have to change the parameters.

      Comment

      • Awad
        Junior Member
        • Dec 2018
        • 2

        #4
        Hello Sancho and ArtursL,

        Kindly note that I am new in Zabbix, and need help on how to create the script etc.
        I have downloaded both UnxUtils.zip and UnxUpdates.zip, extracted them together, but don't know what and how to do next.

        Please help.
        Awad

        Comment

        • sancho
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Mar 2015
          • 295

          #5
          Awad,
          In the last update of zabbix there is a new item that you can use vfs.dir.count
          For unixutils, you have the executables in the path:
          UnxUtils \ usr \ local \ wbin
          You can add the route in the environment variables or execute them indicating the full route.

          Comment

          Working...