Ad Widget

Collapse

Large file workaround

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbixuserfk
    Member
    • Apr 2020
    • 37

    #1

    Large file workaround

    Hi,

    I want to retreive a large json file in Zabbix 5.0 through this basic Zabbix agent item with key system.run[cat /tmp/mc_show_ap_client_trail-info] and Type of information : Text, but I get the error Not supported by Zabbix Agent
    I believe this is due to the size of the file - which is 3.79 Mo (3797259) - since the documentation says that the text data limit is 65536 characters.
    Text data limits


    Text data limits depend on the database backend. Before storing text values in the database they get truncated to match the database value type limit:
    Character Log Text
    MySQL 255 characters 65536 bytes 65536 bytes
    PostgreSQL 255 characters 65536 characters 65536 characters
    Oracle 255 characters 65536 characters 65536 characters
    Is there any workaround to read the whole content of such files for each interval please ?​
    Last edited by zabbixuserfk; 16-02-2023, 11:53.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    system.run is by default disabled ... this also causes "not supported" items...
    and up to 512kB of data can be returned ...
    system.run[command,<mode>]
    Run specified command on the host. Text result of the command

    1 - with mode as nowait (regardless of command result)
    command - command for execution
    mode - possible values:
    wait - wait end of execution (default),
    nowait - do not wait
    See supported platforms.

    Up to 512KB of data can be returned, including trailing whitespace that is truncated.
    To be processed correctly, the output of the command must be text.

    Example:
    => system.run[ls -l /] → detailed file list of root directory.

    Note: system.run items are disabled by default. Learn how to enable them.

    The return value of the item is standard output together with standard error produced by command. The exit code is not checked.

    Empty result is allowed starting with Zabbix 2.4.0.
    See also: Command execution.

    You can obtain bigger file over http items, but you can not save more than item type allows, thus you should split needed info into dependent items, for example. And preprocess all the acquired data, if needed...

    Comment

    • zabbixuserfk
      Member
      • Apr 2020
      • 37

      #3
      system.run items are enabled indeed in my case.
      I know it's possible to get large json data through http items but I've had to write a script to make the api calls and it takes more than the agent timeout to answer... That's why I've redirected the result in a file that I hoped I could read after that...​

      Comment

      Working...