Ad Widget

Collapse

Get value from agent failed: ZBX_TCP_READ() timed out for item vfs.dir.count

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zabbix_Julian
    Junior Member
    • Jul 2022
    • 25

    #1

    Get value from agent failed: ZBX_TCP_READ() timed out for item vfs.dir.count

    Hello,

    I try to count the files in a folder (Windows Folder).
    There are currently about 700 XML files in it and I use the Item vfs.dir.count[C:\filepaht\example]. If I now test it I receive this error:
    "Get value from agent failed: ZBX_TCP_READ() timed out​".

    I already increased the "Timeout Option" to 30 seconds(max) and I would say that 700 files are not that much .

    I have already read in the forums but found nothing suitable.
    I can get a connection via telnet. The item works as soon as I take another folder (on the same server) where only 20 documents are in it.

    Click image for larger version

Name:	image.png
Views:	1411
Size:	113.4 KB
ID:	453520
    Click image for larger version

Name:	image.png
Views:	1217
Size:	9.1 KB
ID:	453521​​

    Thanks in advance.

    Best regards
    ​​​
  • Answer selected by Zabbix_Julian at 31-10-2022, 18:25.
    markfree
    Senior Member
    • Apr 2019
    • 868

    Originally posted by Zabbix_Julian
    Thanks for the tip.
    I think it's because of the filepath.... I have 2 spaces in a foldername and it looks like Zabbix can't count the files because of that. If I use a different folder on the windows server it works.
    But for this path where I have the 2 spaces in the foldername it doestn work and I receive this error:
    ​​

    Have you tried with quotes between your directory path?
    Code:
    vfs.dir.count["F:\FTP Server Storage\something\else",".*\.xml",,file]

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #2
      According to documentation.
      Execution time is limited by the default timeout value in agent configuration (3 sec). Since large directory traversal may take longer than that, no data will be returned and the item will turn unsupported. Partial count will not be returned.​
      Still, I've managed to successfully count Windows System32 directory with no issues. I find that to be a somewhat big folder.
      Testing at the managed host, the Agent took a little while, indeed, but did not timeout.

      Code:
      PS C:\zabbix> (Measure-Command { .\zabbix_agent2.exe -t vfs.dir.count[C:\Windows\System32] }).Seconds
      39
      
      PS C:\zabbix> .\zabbix_agent2.exe -t vfs.dir.count[C:\Windows\System32]
      vfs.dir.count[C:\Windows\System32] [s|16125]
      The Server also managed to get the correct count.
      Click image for larger version  Name:	image.png Views:	0 Size:	8.5 KB ID:	453533

      Even with 39 seconds to count the directory, the Agent did not timeout, and I did not change any timeout settings.

      Maybe your XML directory has something different.
      Have you tested the agent at the host itself?

      I would suggest you to add some filter to your item (vfs.dir.count["YOUR_DIR",".*\.xml",,file]).
      Maybe that can enhance the directory count.
      Last edited by markfree; 28-10-2022, 16:49.

      Comment

      • Zabbix_Julian
        Junior Member
        • Jul 2022
        • 25

        #3
        Hello markfree,

        thank you for the quick response.
        As you can see, I receive Data from the agent which is installed on the windows machine:

        Click image for larger version

Name:	image.png
Views:	1140
Size:	100.3 KB
ID:	453537


        Also if I use the same directory but a different folder and copy ~ 100 XML files to it, it works...
        I dont know why it should not work.

        Best regards and a nice weekend!​
        Attached Files

        Comment


        • markfree
          markfree commented
          Editing a comment
          Test the Agent at the Win host using "zabbix-agent -t vfs.dir.count[C:\filepaht\example]". If it works, proceed the test to the Server with Zabbix Get.
      • Zabbix_Julian
        Junior Member
        • Jul 2022
        • 25

        #4
        Thanks for the tip.
        I think it's because of the filepath.... I have 2 spaces in a foldername and it looks like Zabbix can't count the files because of that. If I use a different folder on the windows server it works.
        But for this path where I have the 2 spaces in the foldername it doestn work and I receive this error:
        ​​
        Attached Files

        Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #5
          Originally posted by Zabbix_Julian
          Thanks for the tip.
          I think it's because of the filepath.... I have 2 spaces in a foldername and it looks like Zabbix can't count the files because of that. If I use a different folder on the windows server it works.
          But for this path where I have the 2 spaces in the foldername it doestn work and I receive this error:
          ​​

          Have you tried with quotes between your directory path?
          Code:
          vfs.dir.count["F:\FTP Server Storage\something\else",".*\.xml",,file]

          Comment

          • Zabbix_Julian
            Junior Member
            • Jul 2022
            • 25

            #6
            My bad, I found it now. Zabbix also tried to count subfolders... I forogt to set the "0" to denie the subfolder check. It works now with this key:
            vfs.dir.count[F:\C:\filepaht\example,.xml,,,,0,,,,,]

            Thank you for your help markfree

            Comment

            Working...