Source
* Function checks that Zabbix server status is updated after failover delay passes and frontend config is re-validated.
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__).'/../common/testSystemInformation.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
/**
* @backup dashboard, ha_node, config
*
* @backupConfig
*
* @onBefore prepareDashboardData
*/
class testDashboardSystemInformationWidget extends testSystemInformation {
public static $dashboardid; // Dashboard for checking widget content with enabled and disabled HA cluster.
public static $widgets_dashboardid; // Dashboard for checking creation and update of system information widgets.
/**
* Attach MessageBehavior to the test.
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* Function creates dashboards with widgets for test and defines the corresponding dashboard IDs.
*/
public static function prepareDashboardData() {
$response = CDataHelper::call('dashboard.create', [
[
'name' => 'Dashboard for Sysinfo + HA test',
'private' => 0,
'pages' => [
[
'name' => 'Page with widgets',
'widgets' => [
[
'type' => 'systeminfo',
'name' => 'System stats view',
'width' => 36,
'height' => 8
],
[
'type' => 'systeminfo',
'name' => 'High availability nodes view',
'x' => 36,
'y' => 0,
'width' => 36,
'height' => 8,
'fields' => [