Ad Widget

Collapse

Read text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nighttraveler
    Junior Member
    • Dec 2014
    • 6

    #1

    Read text file

    Hello,

    Server 2.2.2, Client 2.2.7. I need read text file (log, txt and etc.) and show it in Latest Date. What I do:
    1/ Create Template
    2/ Create Application - Log TXT
    3/ Create Item:
    name Log Text
    type Simple check
    key vfs.file.contents["c:\script\log\log1c.log",ANSI]
    app Log TXT

    picture attached

    Waiting for 10 min, after that check Latest Date and don't see any information. Where mistake? Please help.
    Attached Files
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    I would look at using the key log[c:\script\log\log1c.log,,,100,,,skip] with item type of "Log" instead of what you are attempting.

    if you use the above, it must be set as Zabbix agent (Active) item and you must have proper read permissions.

    The fourth parameter "100" tells it max number of new lines per/sec to retrieve and the seventh parameter "skip" tells it to only retrieve new log entries since the last check.

    You can see the information here: https://www.zabbix.com/documentation...s/zabbix_agent

    On a sidenote, I see you are using a newer version of the agent as compared to your server version. That is not recommended. It is OK to use an older version of the agent with a newer version of the server, but you could hit some issues with the other way around.

    Comment

    • Nighttraveler
      Junior Member
      • Dec 2014
      • 6

      #3
      I don't have any problem with keys log[,,,,] or logrt[,,,,]. I want to read all file and print it in the web interface, is it real with key vfs.file.contents or not?
      When i used key at server, like:

      $ zabbix_get -s 192.168.1.1 -k vfs.file.contents["c:\script\log\log1c.log",ANSI]

      I saw all file.

      Comment

      Working...