Ad Widget

Collapse

Monitoring directories

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinguin123
    Member
    • Apr 2015
    • 52

    #1

    Monitoring directories

    Hi,

    is there a possibility to receive an alert when a directory in CentOS 7 is empty or not available?
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    Originally posted by pinguin123
    Hi,

    is there a possibility to receive an alert when a directory in CentOS 7 is empty or not available?
    you can use this command in a bash script :

    find /* -type d -empty
    will list all empty files

    Comment

    • pinguin123
      Member
      • Apr 2015
      • 52

      #3
      Sorry, I didn't express myself well.

      I'm looking for a solution that if a special directory is empty or not available, I want to receive a trigger. I would like to work without scripts, if possible.

      Comment

      • batchenr
        Senior Member
        • Sep 2016
        • 440

        #4
        Originally posted by pinguin123
        Sorry, I didn't express myself well.

        I'm looking for a solution that if a special directory is empty or not available, I want to receive a trigger. I would like to work without scripts, if possible.
        then read this ref :


        search for vfs or system.run
        to make your trigger from them

        Comment

        • pinguin123
          Member
          • Apr 2015
          • 52

          #5
          I tried to find a solution, but somehow it didn't work. The file was not available and nevertheless I didn't receive a tigger alert.

          Item:
          Code:
          vfs.file.exists[/directory/filename]

          Trigger:
          Code:
          {Template FileCheck:vfs.file.exists[/directory/filename].str()}=0
          Is there something missing in the trigger expression?

          Comment

          • batchenr
            Senior Member
            • Sep 2016
            • 440

            #6
            Originally posted by pinguin123
            I tried to find a solution, but somehow it didn't work. The file was not available and nevertheless I didn't receive a tigger alert.

            Item:
            Code:
            vfs.file.exists[/directory/filename]

            Trigger:
            Code:
            {Template FileCheck:vfs.file.exists[/directory/filename].str()}=0
            Is there something missing in the trigger expression?
            you can check your triggers before using zabbix_get
            to see if it works

            Comment

            • pinguin123
              Member
              • Apr 2015
              • 52

              #7
              And how? Sorry for this question, but I am not experienced in this area.

              Comment

              • aasanov
                Junior Member
                • Oct 2019
                • 2

                #8
                How to monitor whole directory ?
                Does anyone know?

                Comment

                • 1berto
                  Senior Member
                  • Sep 2018
                  • 182

                  #9
                  You execute zabbix_get on the server or proxy that monitor your host, just check the documentation, is pretty sel explanatory:
                  zabbix_get -s 127.0.0.1 -p 10050 -k "vfs.file.exists[/directory/filename]"

                  127.0.0.1 is of course the IP of the host you want to check (that must have a running agent of course).


                  Comment

                  Working...