Source
$this->waitForLogLineToBePresent(self::COMPONENT_SERVER, 'End of trapper_process_history_push', true, 95, 3);
<?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__).'/../include/CIntegrationTest.php';
require_once dirname(__FILE__).'/../include/CAPITest.php';
/**
* Test suite for history.push API methods (pushing of history)
*
* @required-components server
* @configurationDataProvider serverConfigurationProvider
* @hosts test_history_push1,test_history_push_non_monitored,test_history_push_maintained
* @backup history,items,hosts,history_uint,history_text,history_str,history_log,ids
*/
class testHistoryPush extends CIntegrationTest {
const HOSTNAME1 = 'test_history_push1';
private static $hostid_normal;
private static $hostid_non_monitored;
private static $hostid_maintained;
private static $itemids;
/**
* @inheritdoc
*/
public function prepareData() {
// Create host "test_history_push1"
$response = $this->call('host.create', [
[
'host' => self::HOSTNAME1,
'interfaces' => [],
'groups' => [['groupid' => 4]],
'status' => HOST_STATUS_MONITORED
]
]);
$this->assertArrayHasKey('hostids', $response['result']);
$this->assertArrayHasKey(0, $response['result']['hostids']);
self::$hostid_normal = $response['result']['hostids'][0];
// Create host "test_history_push_non_monitored"
$response = $this->call('host.create', [
[
'host' => "test_history_push_non_monitored",
'interfaces' => [],
'groups' => [['groupid' => 4]],
'status' => HOST_STATUS_NOT_MONITORED
]
]);
$this->assertArrayHasKey('hostids', $response['result']);