Ad Widget

Collapse

How to create a trigger for "File bigger than X MB"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • XorroX
    Junior Member
    • May 2015
    • 8

    #1

    How to create a trigger for "File bigger than X MB"

    Hi guys,

    Could anybody tell me, if there is a way to trigger a path for a file that grows bigger than X MB?

    We are using Zabbix 2.4.5.

    For example:
    I want to get an alert if a file in "C:/Temp/Test" grows bigger than 10 MB.

    Thanks for your help!
  • frankbarmentlo
    Junior Member
    • Sep 2015
    • 4

    #2
    the type of item you have to use is zabbix agent or zabbix agent(active);
    the key is: vfs.file.size["C:/Temp/Test"]

    This will return the file size in bytes,
    according to that, you have to set a trigger when the returned value is larger then either 1.000.000, or larger then 1.048.576.

    I had to set up the same here, so I'll test and get back for a more precise explanation on the trigger in a bit

    Comment

    • frankbarmentlo
      Junior Member
      • Sep 2015
      • 4

      #3
      I made the item
      vfs.file.size[/var/log/iptables.log]
      with trigger:
      {jaguar.svr.fb:vfs.file.size[/var/log/iptables.log].last()}>10485760



      and that seemed to work.
      instead of 10.485.760 you can also use 10.000.000, but it depends on the way of calculation

      Comment

      • jamesNJ
        Senior Member
        • Jun 2015
        • 103

        #4
        Create an item using the key vfs.file.size[file], then create a trigger which checks that the number of bytes this file is exceeds whatever limit you desire.

        That key is limited to files that zabbix user process can read/stat according to the docs. So if that doesn't work you will need to cook up a small script which runs under privileges necessary to read your file and return similar information. You could do that with either system.run[] or with a UserParameter

        Comment

        Working...