Source
$pageid = CDBHelper::getRow('SELECT dashboard_pageid FROM dashboard_page WHERE dashboardid='.zbx_dbstr($resourceid));
<?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/testAuditlogCommon.php';
/**
* @backup dashboard
*/
class testAuditlogDashboard extends testAuditlogCommon {
/**
* Existing Dashboard ID.
*/
private const DASHBOARDID = 1;
public function testAuditlogDashboard_Create() {
$create = $this->call('dashboard.create', [
[
'name' => 'Audit dashboard',
'display_period' => 30,
'auto_start' => 1,
'pages' => [
[
'widgets' => [
[
'type' => 'problems',
'x' => 0,
'y' => 0,
'width' => 12,
'height' => 5,
'view_mode' => 0,
'fields' => [
[
'type' => 1,
'name' => 'tags.0.tag',
'value' => 'service'
],
[
'type' => 0,
'name' => 'tags.0.operator',
'value' => 1
],
[
'type' => 1,
'name' => 'tags.0.value',
'value' => 'zabbix_server'
]
]
]
]