Ad Widget

Collapse

Zabbix won't read a text file that only has numbers

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • momovideo
    Junior Member
    • Mar 2022
    • 6

    #1

    Zabbix won't read a text file that only has numbers

    Hi everyone,
    I wanted Zabbix to read a file that shows a number of counted files in a certain folder. I created a script in Windows that counts files in a folder and then writes that number in a text file. There is nothing else in that file, just a number. In Zabbix, I created an item like this
    logrt["D:\Count\filecount.txt"]
    Zabbix doesn't throw any error, but it also doesn't show any data. I want to mention that I have multiple log monitoring items configured and they work perfectly, but this one just won't work for me. I tried changing logrt to simply log, type of information in item configuration, and changing the file location, but no dice.

    Zabbix I am running is 5.0.1. Active agent is configured and working.
  • Answer selected by momovideo at 23-03-2022, 16:23.
    vitS
    Member
    • Apr 2021
    • 43

    vs.file.content reads the content of file, I guess
    vfs.file.contents[file,<encoding>] Retrieving contents of a file. Returns text

    Comment

    • vitS
      Member
      • Apr 2021
      • 43

      #2
      vs.file.content reads the content of file, I guess
      vfs.file.contents[file,<encoding>] Retrieving contents of a file. Returns text

      Comment

      • Semiadmin
        Senior Member
        • Oct 2014
        • 1625

        #3
        why not use a standard key vfs.dir.count[dir,<regex_incl>,<regex_excl>,<types_incl>,<types_ excl>,<max_depth>,<min_size>,<max_size>,<min_age>, <max_age>,<regex_excl_dir>] ?

        Comment

        • momovideo
          Junior Member
          • Mar 2022
          • 6

          #4
          Sorry, I forgot to mention that I already use the vfs.dir.count, but when the number of files in the folder exceeds about 15K, the Zabbix stops showing any data for that item. Since it is happening often, I wanted to find another way to count files, hence the issue in my first post.

          vitS, I will try that, thank you.

          EDIT.
          Originally posted by vitS
          vs.file.content reads the content of file, I guess
          vfs.file.contents[file,<encoding>] Retrieving contents of a file. Returns text
          And it works just like I needed it to. Thank you both for your help.
          Last edited by momovideo; 23-03-2022, 16:01.

          Comment

          • Semiadmin
            Senior Member
            • Oct 2014
            • 1625

            #5
            Yes, this is a problem with vfs.dir.count or vfs.dir.size, it's easy to reach an agent timeout

            Comment

            Working...