Ad Widget

Collapse

Support for multiple applications in data overview dropped?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alarmdispatcher
    Junior Member
    • Jul 2019
    • 2

    #1

    Support for multiple applications in data overview dropped?

    After I used Zabbix 3.2 for a long time, I recently started upgrading my system to Zabbix 4.0.3. My question is about the data overview element as used in the screens.
    While in 3.2 it was possible to have multiple applications separated by semicolon in a data overview, this seems not to be supported anymore.
    I checked the documentation but could not find anything regarding this topic.

    Does anybody know if the support was dropped or the notation changed?
    Click image for larger version

Name:	Zabbix3.2_data_overview.png
Views:	570
Size:	64.5 KB
ID:	382834
  • Dark_Ph0eNix
    Junior Member
    • Dec 2020
    • 1

    #2
    Originally posted by alarmdispatcher
    After I used Zabbix 3.2 for a long time, I recently started upgrading my system to Zabbix 4.0.3. My question is about the data overview element as used in the screens.
    While in 3.2 it was possible to have multiple applications separated by semicolon in a data overview, this seems not to be supported anymore.
    I checked the documentation but could not find anything regarding this topic.

    Does anybody know if the support was dropped or the notation changed?
    Click image for larger version

Name:	Zabbix3.2_data_overview.png
Views:	570
Size:	64.5 KB
ID:	382834
    In Zabbix 5.0 may be and other version you can change PHP code at file "/usr/share/zabbix/include/items.inc.php"
    Replace original code
    PHP Code:
    function getDataOverviewItems(?array $groupids null, ?array $hostids null, ?string $application ''): array {
    $config select_config();
    if (
    $application !== '') {
    $applicationids array_keys(API::Application()->get([
    'output' => [],
    'hostids' => $hostids,
    'groupids' => $groupids,
    'search' => ['name' => $application],
    'preservekeys' => true
    ]));
    $db_items API::Item()->get([
    'output' => ['itemid''hostid''name''key_''value_type''units''valuemapid'],
    'applicationids' => $applicationids,
    'monitored' => true,
    'webitems' => true,
    'limit' => $config['search_limit'],
    'preservekeys' => true
    ]);

    To code with split application name by ","
    PHP Code:
    function getDataOverviewItems(?array $groupids null, ?array $hostids null, ?string $application ''): array {
    $config select_config();
    if (
    $application !== '') {
    if (
    stristr($application',') == True) {
    $applicationids = array();
    foreach (
    explode(','$application) as $app) {
    $applicationids array_merge($applicationidsarray_keys(API::Application()->get([
    'output' => [],
    'hostids' => $hostids,
    'groupids' => $groupids,
    'search' => ['name' => $app],
    'preservekeys' => true
    ])));
    // error_log($app . '\\n\\n' . implode(',', $applicationids) . '\\n\\n',0);
    }
    // error_log($application . '\n\n' . implode(',', $applicationids) . '\n\n',0);
    }
    else
    {
    $applicationids array_keys(API::Application()->get([
    'output' => [],
    'hostids' => $hostids,
    'groupids' => $groupids,
    'search' => ['name' => $application],
    'preservekeys' => true
    ]));
    error_log($application '\n\n' implode(','$applicationids) . '\n\n',0);
    }
    $db_items API::Item()->get([
    'output' => ['itemid''hostid''name''key_''value_type''units''valuemapid'],
    'applicationids' => $applicationids,
    'monitored' => true,
    'webitems' => true,
    'limit' => $config['search_limit'],
    'preservekeys' => true
    ]);

    Comment

    Working...