Ad Widget

Collapse

vfs.file.exists doesn't take wildcard....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frater
    Senior Member
    • Oct 2010
    • 340

    #1

    vfs.file.exists doesn't take wildcard....

    Because vfs.file.exists doesn't accept wildcards and I needed it for Windows, I wrote this little function.....

    vfs.file.exists <==> vfs.files.exists

    zabbix_agentd.conf
    Code:
    UnsafeUserParameters=1
    UserParameter=vfs.files.exists[*], dir "$1" 2>null | find /c "bytes "
    It should be even easier in Linux, but I actually wanted something more advanced that looked at the age of the file and all.
    I already wrote something for that.

    Because I needed it on Windows I made a trigger that checks all the last 30 occurences and if that wildcard was there everytime, it would give an alert

    Code:
    vfs.files.exists[c:\queue\*out].min(#30)>0
    Last edited by frater; 28-03-2012, 20:56.
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP
  • YannickFavre
    Junior Member
    • Jul 2016
    • 1

    #2
    vfs.file.exists and wildcard

    Hi,

    I have also implement a custom action that can return the number of files:

    zabbix_agentd.conf
    Code:
    UnsafeUserParameters=1
    UserParameter=vfs.files.exists[*], dir "$1\*.$2" /b 2>null | find /c ".$2"
    Call is made with two arguments separated by a comma:
    First argument is the path
    Second argument the extension
    Code:
    vfs.files.exists[D:\My Folder\,txt]

    Comment

    Working...