Ad Widget

Collapse

Zabbix function "vsf.file.exists": please help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newbie-red
    Junior Member
    • Mar 2024
    • 2

    #1

    Zabbix function "vsf.file.exists": please help

    Hi all,

    I am trying to use the Zabbix function called "vsf.file.exists", but I am doing for sure something pretty wrong, because I am getting to noware.

    Description of my setup:
    Zabbix-Server (running pretty fine - no problem at all)

    1st. monitored Linux-Client (on which I am running "zabbix_agent2 ver. 6.4.11") [running fine - no problem at all]

    My need:
    I need to verify every 20 minutes, if any file has been created within a certain subdirectory of the 1st. monitored Linux-Client.

    In order to reach my goal I am trying to setup the Zabbix function called "vsf.file.exists" (his value should be returned to the Zabbix-Server by the zabbix_agent2):
    Within the Zabbix-Server I did create a new "item" related to the "1st. Linux-Client":
    his "key" looks like as follow: vfs.file.exists[file,/mnt1/folder1/folder2/folder3/folder4/tmp_in,dir]

    The Problem/Error
    :
    When I test the vsf-function I get the following error:
    Invalid type "/mnt1/folder1/folder2/folder3/folder4/tmp_in"

    As I already said, I am doing for sure something wrong, but I can not solve the issue so far.

    Any help would be much appreciated.

    Thank U very much indeed in advance.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    https://www.zabbix.com/documentation...le-system-data
    vfs.file.exists[file,<types_incl>,<types_excl>]
    Checks if file exists. 0 - not found

    1 - file of the specified type exists
    file - full path to file
    types_incl - list of file types to include, possible values: file (regular file, default (if types_excl is not set)), dir (directory), sym (symbolic link), sock (socket), bdev (block device), cdev (character device), fifo (FIFO), dev (synonymous with "bdev,cdev"), all (all mentioned types, default if types_excl is set).
    types_excl - list of file types to exclude, see types_incl for possible values (by default no types are excluded)
    that "/mnt1/folder1/folder2/folder3/folder4/tmp_in" looks like a directory path but key expects "file type to include" as second parameter... that's why you get your error...

    Besides, that key works with hardcoded filename... you cannot use it for "any"... Probably should use vfs.dir.get for catching all of directory contents and making any assumptions on it...
    Last edited by cyber; 21-03-2024, 09:36.

    Comment

    • newbie-red
      Junior Member
      • Mar 2024
      • 2

      #3
      Cyber,

      thank you very much indeed for your reply.

      I think, I got your main message: basically I am using the complete wrong "key" for reaching my aim: I should rather use the "key" called "vfs.dir.get".

      I shall give it a try.

      Thank U again: much appreciated.


      Comment

      Working...