Ad Widget

Collapse

History value truncated

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashf
    Junior Member
    • Aug 2021
    • 11

    #1

    History value truncated

    I'm having trouble with an item that reports the versions of the installed packages. The problem is that the list is greater (115 KB) than the data text limit - https://www.zabbix.com/documentation...xt_data_limits

    Can anyone point me in the right direction if it is the data text limit and which table I need to alter? I've set mediumtext in the history_text table value but this doesn't seem to have made any difference.

    MariaDB [zabbix]> describe history_text;
    +--------+---------------------+------+-----+---------+-------+
    | Field | Type | Null | Key | Default | Extra |
    +--------+---------------------+------+-----+---------+-------+
    | itemid | bigint(20) unsigned | NO | MUL | NULL | |
    | clock | int(11) | NO | | 0 | |
    | value | mediumtext | YES | | NULL | |
    | ns | int(11) | NO | | 0 | |
    +--------+---------------------+------+-----+---------+-------+
    4 rows in set (0.001 sec)

    Thanks
  • ashf
    Junior Member
    • Aug 2021
    • 11

    #2
    For more info, testing the item returns all the data to the last package ending at zsync, 3531 lines, length 114,150, ~111kb

    Click image for larger version

Name:	Capture.PNG
Views:	985
Size:	33.9 KB
ID:	430138

    But executing the item only ends at libsnappy-java, 2073 lines, length 67,667, 66kb to history:

    Click image for larger version

Name:	Capture2.PNG
Views:	958
Size:	14.8 KB
ID:	430139

    Things I've tried:

    Increasing historycache

    db edit:
    backup db
    drop history tables
    dump db
    drop db
    edit ../create.sql.gz to use mediumtext for the value in history_text
    recreate db
    import db dump

    This has made no difference to the output to history, so I'm not sure it is the history_text table truncating the data.


    Any help on this would be greatly appreaciated.

    Comment

    • ashf
      Junior Member
      • Aug 2021
      • 11

      #3
      Checking the row length of the table:

      select value,length(value) from history_text;

      returns:

      ..
      libsmartcols1 2.33.1-0.1 amd64
      libsmbclient 2:4.9.5+dfsg-5+deb10u1 amd64
      libsmbios-c2 2.4.1-1 amd64
      libsmi2ldbl 0.4.8+dfsg2-16 amd64
      libsnappy-java 1.1.7.2-1 all | 65535 |

      So 65535, which brings me back to custom script limit - https://www.zabbix.com/documentation...m_script_limit

      Do I need to change form mysql to postgres?

      Comment

      • sb195c@att.com
        Member
        • Oct 2017
        • 41

        #4
        It's not the database backend limiting, it's the zabbix C code itself. The schema and data structures are defined within the source code, and hard coded to 65536 bytes max. If you require longer text fields (as I did) you have to modify the table column datatype, then modify the C code and recompile it.

        Comment

        • ashf
          Junior Member
          • Aug 2021
          • 11

          #5
          Originally posted by [email protected]
          It's not the database backend limiting, it's the zabbix C code itself. The schema and data structures are defined within the source code, and hard coded to 65536 bytes max. If you require longer text fields (as I did) you have to modify the table column datatype, then modify the C code and recompile it.
          Thanks, I'm out of my depth when it comes to recompiling C, can you point me in the right direction please? Is it a particular file I need to edit or something more?

          Comment

          • ashf
            Junior Member
            • Aug 2021
            • 11

            #6
            Ok, so looking for hard coded values in zabbix software I can find the following references to 65536 and 65535, am I warm?

            root@rausu:/etc/ansible# grep -iR -A 3 -B 2 65536 /usr/share/zabbix/
            /usr/share/zabbix/include/defines.inc.php-
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_HAVE_IPV6', true);
            /usr/share/zabbix/include/defines.inc.php:define('ZBX_DISCOVERER_IPRANGE_LIM IT', 65536);
            /usr/share/zabbix/include/defines.inc.php-
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_SOCKET_TIMEOUT', 3); // Socket timeout limit.
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_CONNECT_TIMEOUT', 3); // Zabbix server connect timeout limit.
            root@rausu:/etc/ansible# grep -iR -A 3 -B 2 65535 /usr/share/zabbix/
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- value: <?= json_encode($data['value']) ?>,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- monospace_font: false,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php: maxlength: 65535,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- autofocus: true,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- readonly: false,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- grow: 'auto',
            --
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- value: <?= json_encode($data['prev_value']) ?>,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- monospace_font: false,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php: maxlength: 65535,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- disabled: <?= $data['show_prev'] ? 'false' : 'true' ?>,
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- grow: 'auto',
            /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- rows: 0
            --
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php-
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php- const GRAPH_WIDTH_MIN = 1;
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php: const GRAPH_WIDTH_MAX = 65535;
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php- const GRAPH_HEIGHT_MIN = 1;
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php: const GRAPH_HEIGHT_MAX = 65535;
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php-
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php- public function __construct() {
            /usr/share/zabbix/app/controllers/CControllerWidgetSvgGraphView.php- parent::__construct();
            --
            /usr/share/zabbix/screens.php- 'elementid' => [T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, null],
            /usr/share/zabbix/screens.php- 'screenname' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/screens.php: 'step' => [T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null],
            /usr/share/zabbix/screens.php- 'from' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/screens.php- 'to' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/screens.php- 'reset' => [T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null]
            --
            /usr/share/zabbix/slides.php- 'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
            /usr/share/zabbix/slides.php- 'elementid' => [T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, null],
            /usr/share/zabbix/slides.php: 'step' => [T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null],
            /usr/share/zabbix/slides.php- 'from' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/slides.php- 'to' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/slides.php- 'reset' => [T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null],
            --
            /usr/share/zabbix/include/classes/api/services/CAction.php- if (isset($operation['opcommand']['port']) && !zbx_empty($operation['opcommand']['port'])) {
            /usr/share/zabbix/include/classes/api/services/CAction.php- if (zbx_ctype_digit($operation['opcommand']['port'])) {
            /usr/share/zabbix/include/classes/api/services/CAction.php: if ($operation['opcommand']['port'] > 65535 || $operation['opcommand']['port'] < 1) {
            /usr/share/zabbix/include/classes/api/services/CAction.php- self::exception(ZBX_API_ERROR_PARAMETERS,
            /usr/share/zabbix/include/classes/api/services/CAction.php- _s('Incorrect action operation port "%1$s".', $operation['opcommand']['port'])
            /usr/share/zabbix/include/classes/api/services/CAction.php- );
            --
            /usr/share/zabbix/include/classes/api/services/CMap.php- foreach ($maps as $map) {
            /usr/share/zabbix/include/classes/api/services/CMap.php- // Check mandatory fields "width" and "height".
            /usr/share/zabbix/include/classes/api/services/CMap.php: if ($map['width'] > 65535 || $map['width'] < 1) {
            /usr/share/zabbix/include/classes/api/services/CMap.php- self::exception(ZBX_API_ERROR_PARAMETERS,
            /usr/share/zabbix/include/classes/api/services/CMap.php- _s('Incorrect "width" value for map "%1$s".', $map['name'])
            /usr/share/zabbix/include/classes/api/services/CMap.php- );
            /usr/share/zabbix/include/classes/api/services/CMap.php- }
            /usr/share/zabbix/include/classes/api/services/CMap.php-
            /usr/share/zabbix/include/classes/api/services/CMap.php: if ($map['height'] > 65535 || $map['height'] < 1) {
            /usr/share/zabbix/include/classes/api/services/CMap.php- self::exception(ZBX_API_ERROR_PARAMETERS,
            /usr/share/zabbix/include/classes/api/services/CMap.php- _s('Incorrect "height" value for map "%1$s".', $map['name'])
            /usr/share/zabbix/include/classes/api/services/CMap.php- );
            --
            /usr/share/zabbix/include/classes/api/services/CMap.php-
            /usr/share/zabbix/include/classes/api/services/CMap.php- // Check "width" and "height" fields.
            /usr/share/zabbix/include/classes/api/services/CMap.php: if ($map['width'] > 65535 || $map['width'] < 1) {
            /usr/share/zabbix/include/classes/api/services/CMap.php- self::exception(ZBX_API_ERROR_PARAMETERS,
            /usr/share/zabbix/include/classes/api/services/CMap.php- _s('Incorrect "width" value for map "%1$s".', $map['name'])
            /usr/share/zabbix/include/classes/api/services/CMap.php- );
            /usr/share/zabbix/include/classes/api/services/CMap.php- }
            /usr/share/zabbix/include/classes/api/services/CMap.php-
            /usr/share/zabbix/include/classes/api/services/CMap.php: if ($map['height'] > 65535 || $map['height'] < 1) {
            /usr/share/zabbix/include/classes/api/services/CMap.php- self::exception(ZBX_API_ERROR_PARAMETERS,
            /usr/share/zabbix/include/classes/api/services/CMap.php- _s('Incorrect "height" value for map "%1$s".', $map['name'])
            /usr/share/zabbix/include/classes/api/services/CMap.php- );
            --
            /usr/share/zabbix/include/classes/db/DB.php-
            /usr/share/zabbix/include/classes/db/DB.php- if ($schema['fields'][$field_name]['type'] == self::FIELD_TYPE_TEXT) {
            /usr/share/zabbix/include/classes/db/DB.php: return ($DB['TYPE'] == ZBX_DB_ORACLE) ? 2048 : 65535;
            /usr/share/zabbix/include/classes/db/DB.php- }
            /usr/share/zabbix/include/classes/db/DB.php-
            /usr/share/zabbix/include/classes/db/DB.php- if ($schema['fields'][$field_name]['type'] == self::FIELD_TYPE_NCLOB) {
            /usr/share/zabbix/include/classes/db/DB.php: return 65535;
            /usr/share/zabbix/include/classes/db/DB.php- }
            /usr/share/zabbix/include/classes/db/DB.php-
            /usr/share/zabbix/include/classes/db/DB.php- return $schema['fields'][$field_name]['length'];
            --
            /usr/share/zabbix/include/defines.inc.php-
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_MIN_PORT_NUMBER', 0);
            /usr/share/zabbix/include/defines.inc.php:define('ZBX_MAX_PORT_NUMBER', 65535);
            /usr/share/zabbix/include/defines.inc.php-
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_MACRO_TYPE_TEXT', 0); // Display macro value as text.
            /usr/share/zabbix/include/defines.inc.php-define('ZBX_MACRO_TYPE_SECRET', 1); // Display masked macro value.
            --
            /usr/share/zabbix/host_screen.php- 'tr_hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
            /usr/share/zabbix/host_screen.php- 'screenid' => [T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, null],
            /usr/share/zabbix/host_screen.php: 'step' => [T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null],
            /usr/share/zabbix/host_screen.php- 'from' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/host_screen.php- 'to' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/host_screen.php- 'reset' => [T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null]
            --
            /usr/share/zabbix/sysmaps.php- ],
            /usr/share/zabbix/sysmaps.php- 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')],
            /usr/share/zabbix/sysmaps.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('Width')],
            /usr/share/zabbix/sysmaps.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('Height')],
            /usr/share/zabbix/sysmaps.php- 'backgroundid' => [T_ZBX_INT, O_OPT, null, DB_ID, 'isset({add}) || isset({update})'],
            /usr/share/zabbix/sysmaps.php- 'iconmapid' => [T_ZBX_INT, O_OPT, null, DB_ID, 'isset({add}) || isset({update})'],
            /usr/share/zabbix/sysmaps.php- 'expandproblem' => [T_ZBX_INT, O_OPT, null,
            --
            /usr/share/zabbix/chart3.php- 'http_item_type' => [T_ZBX_INT, O_OPT, null, null, null],
            /usr/share/zabbix/chart3.php- 'name' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart3.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_WIDTH_MIN, 65535), null],
            /usr/share/zabbix/chart3.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_HEIGHT_MIN, 65535), null],
            /usr/share/zabbix/chart3.php- 'ymin_type' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), null],
            /usr/share/zabbix/chart3.php- 'ymax_type' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), null],
            /usr/share/zabbix/chart3.php- 'ymin_itemid' => [T_ZBX_INT, O_OPT, null, DB_ID, null],
            --
            /usr/share/zabbix/chart7.php- 'profileIdx2' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart7.php- 'name' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart7.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(CPieGraphDraw::GRAPH_WIDTH_MIN, 65535), null],
            /usr/share/zabbix/chart7.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(CPieGraphDraw::GRAPH_HEIGHT_MIN, 65535), null],
            /usr/share/zabbix/chart7.php- 'graphtype' => [T_ZBX_INT, O_OPT, null, IN('2,3'), null],
            /usr/share/zabbix/chart7.php- 'graph3d' => [T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null],
            /usr/share/zabbix/chart7.php- 'legend' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            --
            /usr/share/zabbix/chart6.php- 'profileIdx' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart6.php- 'profileIdx2' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart6.php: 'width' => [T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(20, 65535), null],
            /usr/share/zabbix/chart6.php- 'height' => [T_ZBX_INT, O_OPT, P_NZERO, '{} > 0', null],
            /usr/share/zabbix/chart6.php- 'graph3d' => [T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null],
            /usr/share/zabbix/chart6.php- 'legend' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            --
            /usr/share/zabbix/screenedit.php- hasRequest('add') || hasRequest('update') ? getResourceNameByType(getRequest('resourcetype')) : null],
            /usr/share/zabbix/screenedit.php- 'templateid' => [T_ZBX_INT, O_OPT, null, DB_ID, null],
            /usr/share/zabbix/screenedit.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null, _('Width')],
            /usr/share/zabbix/screenedit.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null, _('Height')],
            /usr/share/zabbix/screenedit.php- 'max_columns' => [T_ZBX_INT, O_OPT, null,
            /usr/share/zabbix/screenedit.php- BETWEEN(SCREEN_SURROGATE_MAX_COLUMNS_MIN, SCREEN_SURROGATE_MAX_COLUMNS_MAX), null, _('Max columns')
            /usr/share/zabbix/screenedit.php- ],
            --
            /usr/share/zabbix/chart2.php- 'profileIdx' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart2.php- 'profileIdx2' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart2.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_WIDTH_MIN, 65535), null],
            /usr/share/zabbix/chart2.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_HEIGHT_MIN, 65535), null],
            /usr/share/zabbix/chart2.php- 'outer' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            /usr/share/zabbix/chart2.php- 'onlyHeight' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            /usr/share/zabbix/chart2.php- 'legend' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            --
            /usr/share/zabbix/setup.php- 'type' => [T_ZBX_STR, O_OPT, null, IN('"'.ZBX_DB_MYSQL.'","'.ZBX_DB_POSTGRESQL.'","'. ZBX_DB_ORACLE.'"'), null],
            /usr/share/zabbix/setup.php- 'server' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/setup.php: 'port' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null, _('Database port')],
            /usr/share/zabbix/setup.php- 'database' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, null, _('Database name')],
            /usr/share/zabbix/setup.php- 'user' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/setup.php- 'password' => [T_ZBX_STR, O_OPT, null, null, null],
            --
            /usr/share/zabbix/setup.php- 'zbx_server' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/setup.php- 'zbx_server_name' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/setup.php: 'zbx_server_port' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null, _('Port')],
            /usr/share/zabbix/setup.php- // actions
            /usr/share/zabbix/setup.php- 'save_config' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
            /usr/share/zabbix/setup.php- 'retry' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
            --
            /usr/share/zabbix/items.php- getParamFieldLabelByType(getRequest('type', 0))
            /usr/share/zabbix/items.php- ],
            /usr/share/zabbix/items.php: 'inventory_link' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535),
            /usr/share/zabbix/items.php- '(isset({add}) || isset({update})) && {value_type} != '.ITEM_VALUE_TYPE_LOG
            /usr/share/zabbix/items.php- ],
            /usr/share/zabbix/items.php- 'snmp_oid' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY,
            --
            /usr/share/zabbix/chart.php- 'profileIdx' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart.php- 'profileIdx2' => [T_ZBX_STR, O_OPT, null, null, null],
            /usr/share/zabbix/chart.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_WIDTH_MIN, 65535), null],
            /usr/share/zabbix/chart.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(CLineGraphDraw::GRAPH_HEIGHT_MIN, 65535), null],
            /usr/share/zabbix/chart.php- 'outer' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            /usr/share/zabbix/chart.php- 'batch' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            /usr/share/zabbix/chart.php- 'onlyHeight' => [T_ZBX_INT, O_OPT, null, IN('0,1'), null],
            --
            /usr/share/zabbix/graphs.php- 'graphid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'],
            /usr/share/zabbix/graphs.php- 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')],
            /usr/share/zabbix/graphs.php: 'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(20, 65535), 'isset({add}) || isset({update})', _('Width')],
            /usr/share/zabbix/graphs.php: 'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(20, 65535), 'isset({add}) || isset({update})', _('Height')],
            /usr/share/zabbix/graphs.php- 'graphtype' => [T_ZBX_INT, O_OPT, null, IN('0,1,2,3'), 'isset({add}) || isset({update})'],
            /usr/share/zabbix/graphs.php- 'show_3d' => [T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null],
            /usr/share/zabbix/graphs.php- 'show_legend' => [T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null],

            Comment

            • ashf
              Junior Member
              • Aug 2021
              • 11

              #7

              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- value: <?= json_encode($data['value']) ?>,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- monospace_font: false,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php: maxlength: 65535,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- autofocus: true,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- readonly: false,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- grow: 'auto',
              --
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- value: <?= json_encode($data['prev_value']) ?>,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- monospace_font: false,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php: maxlength: 65535,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- disabled: <?= $data['show_prev'] ? 'false' : 'true' ?>,
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- grow: 'auto',
              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php- rows: 0

              /usr/share/zabbix/app/views/js/popup.itemtestedit.view.js.php

              This reference sets the length in the test item popup, so I no longer get minus figures when running the test now I've set it to 165535.

              Click image for larger version

Name:	editpopup.itemtestedit.PNG
Views:	952
Size:	14.5 KB
ID:	430449

              However, the history log values are still truncated.

              Comment

              • ashf
                Junior Member
                • Aug 2021
                • 11

                #8
                Ok looking at the zabbix github -

                Real-time monitoring of IT components and services, such as networks, servers, VMs, applications and the cloud. - File not found · zabbix/zabbix


                186 #define HISTORY_TEXT_VALUE_LEN 65535
                187 #define HISTORY_LOG_VALUE_LEN 65535

                I'm guessing it's this?

                Comment

                • ashf
                  Junior Member
                  • Aug 2021
                  • 11

                  #9
                  So I've had a play with the source files to see if I can get longtext to work by editing the following files:

                  src/libs/zbxdbhigh/dbschema.c
                  src/libs/zbxdbhigh/db.c
                  include/db.h

                  The result is that I've managed to reduce my history text output to just 35566

                  Can anyone help please?

                  Comment

                  • ashf
                    Junior Member
                    • Aug 2021
                    • 11

                    #10
                    I've managed to re-compile the code to give me back the output of 65335 characters but it seems to just ignore the longtext values.

                    root@devbox:/home/ash/zabbix-5.0.14# make install >> installlog
                    dbschema.c:31:31: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
                    #define ZBX_TYPE_LONGTEXT_LEN 4294967295
                    ^~~~~~~~~~
                    dbschema.c:459:30: note: in expansion of macro ‘ZBX_TYPE_LONGTEXT_LEN’
                    {"script", "", NULL, NULL, ZBX_TYPE_LONGTEXT_LEN, ZBX_TYPE_LONGTEXT, ZBX_NOTNULL, 0},
                    ^~~~~~~~~~~~~~~~~~~~~
                    dbschema.c:31:31: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
                    #define ZBX_TYPE_LONGTEXT_LEN 4294967295
                    ^~~~~~~~~~
                    dbschema.c:1258:29: note: in expansion of macro ‘ZBX_TYPE_LONGTEXT_LEN’
                    {"value", "", NULL, NULL, ZBX_TYPE_LONGTEXT_LEN, ZBX_TYPE_LONGTEXT, ZBX_NOTNULL, 0},
                    ^~~~~~~~~~~~~~~~~~~~~
                    dbschema.c:31:31: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
                    #define ZBX_TYPE_LONGTEXT_LEN 4294967295
                    ^~~~~~~~~~
                    dbschema.c:1269:29: note: in expansion of macro ‘ZBX_TYPE_LONGTEXT_LEN’
                    {"value", "", NULL, NULL, ZBX_TYPE_LONGTEXT_LEN, ZBX_TYPE_LONGTEXT, ZBX_NOTNULL, 0},
                    ^~~~~~~~~~~~~~~~~~~~~
                    dbschema.c:31:31: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
                    #define ZBX_TYPE_LONGTEXT_LEN 4294967295
                    ^~~~~~~~~~
                    dbschema.c:1283:29: note: in expansion of macro ‘ZBX_TYPE_LONGTEXT_LEN’
                    {"value", "", NULL, NULL, ZBX_TYPE_LONGTEXT_LEN, ZBX_TYPE_LONGTEXT, ZBX_NOTNULL, 0},


                    I don't understand why Zabbix have hard-capped the history log like this

                    Comment

                    • ashf
                      Junior Member
                      • Aug 2021
                      • 11

                      #11
                      Ok I've given up trying to fix this in the Zabbix code, so instead, I've decided to create clones of the machines I'm monitoring and on one-half set "head -n 2047" and the other half set "tail -n 2047"

                      Comment

                      Working...