Source
xxxxxxxxxx
'action.recovery_operations['.$operationid[1]['operationid'].'].operationid' => ['add', $operationid[1]['operationid']],
<?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 actions
*/
class testAuditlogAction extends testAuditlogCommon {
/**
* Existing Action ID.
*/
private const ACTIONID = 3;
public function testAuditlogAction_Create() {
$create = $this->call('action.create', [
[
'name' => 'Audit action',
'eventsource' => 0,
'status' => 0,
'esc_period' => '2m',
'filter' => [
'evaltype' => 0,
'conditions' => [
[
'conditiontype' => 1,
'operator' => 0,
'value' => 10084
]
]
],
'operations' => [
[
'operationtype' => 0,
'esc_period' => '0s',
'esc_step_from' => 1,
'esc_step_to' => 2,
'evaltype' => 0,
'opmessage_grp' => [
[
'usrgrpid' => 7
]
],
'opmessage' => [
'default_msg' => 1,
'mediatypeid' => 1
]
]
],
'recovery_operations' => [
[
'operationtype' => 11,
'opmessage' => [
'default_msg' => 1
]
]
],
'update_operations' => [
[
'operationtype' => 12,
'opmessage' => [
'default_msg' => 0,
'message' => 'Custom update operation message body',
'subject' => 'Custom update operation message subject'
]
]
],
'pause_symptoms' => 0,
'pause_suppressed' => 0,
'notify_if_canceled' => 0
]
]);
$resourceid = $create['result']['actionids'][0];
$operationid = CDBHelper::getAll('SELECT operationid FROM operations WHERE actionid='.
zbx_dbstr($resourceid).' AND operationtype In (0,11,12)'
);