Ad Widget

Collapse

Undefined index: db_datafile_size [hosts.php:1214

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jvlavl
    Member
    • Sep 2015
    • 37

    #1

    Undefined index: db_datafile_size [hosts.php:1214

    Hello,

    can someone help solve this issue?

    this is the error i get at the bottom of the site
    • Undefined index: db_datafile_size [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:725]
    • Undefined index: db_datafile_size [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:730]
    • Undefined index: db_logfile_size [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:725]
    • Undefined index: db_logfile_size [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:730]

    What did I do:

    I have added to records in the database in the table host_inventory

    - db_logfile_size VARCHAR(64) checked not null utf8_general_ci
    - db_datafile_size VARCHAR(64) checked not null utf8_general_ci

    added php/include/hosts.inc.php

    71 => [
    'nr' => 71,
    'db_field' => 'db_datafile_size',
    'title' => _('Database Data file')
    ],
    72 => [
    'nr' => 72,
    'db_field' => 'db_logfile_size',
    'title' => _('Database Log file')
    ]

    I'm able to populate both fields to the inventory list
    Under host inventory I see both fields present

    What am I forgetting to adjust?.

    Rgds,

    John
  • lzuzanak
    Junior Member
    • Apr 2018
    • 6

    #2
    I have same problem. In /include/hosts.inc.php is WARNING text....
    WARNING! Before modifying this array, make sure changes are synced with C. C analog is located in function DBget_inventory_field() in src/libs/zbxdbhigh/db.c
    ....but I dont know how can I sync changes with C....

    Comment

    • lzuzanak
      Junior Member
      • Apr 2018
      • 6

      #3
      some reply??

      Comment


      • Atsushi
        Atsushi commented
        Editing a comment
        There is a possibility that the latest version has been fixed.
        Please tell me the detailed version of Zabbix you are using.
    • lzuzanak
      Junior Member
      • Apr 2018
      • 6

      #4
      I have version 3.2.11

      Comment

    • lzuzanak
      Junior Member
      • Apr 2018
      • 6

      #5
      ok... if I upgrade to Zabbix 4.0 LTS (after release) than I can add own fields and code without compiling? Or if I change version to 3.0?

      Comment


      • Atsushi
        Atsushi commented
        Editing a comment
        I do not know what kind of addition etc you are making.
        If you are doing customization such as adding column of database yourself, you may not be able to upgrade the version automatically.

        Please create a verification environment beforehand and check the version upgrade in that environment.
    • lzuzanak
      Junior Member
      • Apr 2018
      • 6

      #6
      ok... come back to right question

      I added to DB table "host_inventory" some new columns. After that I added to "php/include/hosts.inc.php" new fields. After that on host page I saw the errors:

      • Undefined index: <new_db_column> [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:725]
      • Undefined index: <new_db_column> [hosts.php:1214 → CView->render() → include() in include/views/configuration.host.edit.php:730]
      In the file "php/include/hosts.inc.php" is comment with this text
      WARNING! Before modifying this array, make sure changes are synced with C. C analog is located in function DBget_inventory_field() in src/libs/zbxdbhigh/db.c
      I dont know how to sync changes with C... Can you help me? I think it is a problem and if I sync C than problem will fix.

      Comment


      • Atsushi
        Atsushi commented
        Editing a comment
        It is not that the same error was issued, but it means that there was another error due to customization.

        If you can not change both PHP and C together, you should not add your own columns.
        I think that it is better for you to consider what you use for another purpose by using the existing inventory column.
    • lzuzanak
      Junior Member
      • Apr 2018
      • 6

      #7
      but... How Can I sync C?

      Comment


      • Atsushi
        Atsushi commented
        Editing a comment
        Which and how did you customize PHP files?

        Also, have you actually looked at the source of C language?
        For example, the function DBget_inventory_field().

        I can only say that you should change both PHP and C so that it can be consistent with your customization.
    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #8
      In zabbix php application many files are used in many different situations.
      To diagnose issue it needs to be known how to exact error has been produced over web interface.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • Fabio Doebber
        Junior Member
        • May 2018
        • 8

        #9
        I have the same problem, I tried to create a new field in the form and the same message appears

        Comment

        Working...