Ad Widget

Collapse

Problem with vfs.file.contents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oxhyd
    Junior Member
    • Jul 2019
    • 14

    #1

    Problem with vfs.file.contents

    Hello,

    I want to go up the contents of a txt file and I have a problem.

    Click image for larger version

Name:	Capture.PNG
Views:	5697
Size:	32.2 KB
ID:	386680

    In last data, it returns to me "??T"

    Click image for larger version

Name:	Capturef.PNG
Views:	5366
Size:	3.4 KB
ID:	386681

    In the file I want to recover, there is "Testing" written in it and if it's empty it just returns me "??"
    If you have an idea of the problem .. Thanks in advance





  • Oxhyd
    Junior Member
    • Jul 2019
    • 14

    #2
    In log :
    5700:20190924:111403.786 for key [vfs.file.contents[C:\Program Files\Zabbix Agent\scripts\Maintenance\EventLog.txt]] received value [ÿþT]
    5700:20190924:111403.787 In process_value() key:'SRV:vfs.file.contents[C:\Program Files\Zabbix Agent\scripts\Maintenance\EventLog.txt]' lastlogsize:null value:'ÿþT'
    700:20190924:111403.787 buffer: new element 0
    5700:20190924:111403.788 End of process_value():SUCCEED

    Well, I did some tests and it's the .txt format that does not work ..
    It annoys me a lot, is it a bug?
    I just made a file without format with text inside and it works ..
    Would anyone have any idea why this does not work with a .txt file?

    Thank you
    Last edited by Oxhyd; 24-09-2019, 11:31.

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      Isn't the character code of the file a character code such as UTF-8 instead of ASCII? And did you create it with notepad.exe on Windows?
      When you create a UTF-8 file with notepad.exe on Windows, a special character called BOM is inserted first. Then, when Zabbix agent tries to read it, it cannot read normally because of the special character.

      Try writing to an ASCII file or writing to the file you want to monitor in such a way that the BOM is not inserted.

      Comment

      • Oxhyd
        Junior Member
        • Jul 2019
        • 14

        #4
        Thank you, that was the problem

        My question now, it is possible to read a file in ANSI or other?
        Because I have a lot of file automatically generate applications that I want to monitor but if that is not possible, it's annoying ..
        Thank you

        Comment

        • dimir
          Zabbix developer
          • Apr 2011
          • 1080

          #5
          You can vote for



          Also some workarounds are suggested there in comments.

          Comment

          Working...