Source
xxxxxxxxxx
'Mozilla/5.0 (Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1' => 'Safari 13 (iPhone)',
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/defines.inc.php';
require_once dirname(__FILE__).'/items.inc.php';
function httptest_authentications($type = null) {
$authentication_types = [
ZBX_HTTP_AUTH_NONE => _('None'),
ZBX_HTTP_AUTH_BASIC => _('Basic'),
ZBX_HTTP_AUTH_NTLM => _('NTLM'),
ZBX_HTTP_AUTH_KERBEROS => _('Kerberos'),
ZBX_HTTP_AUTH_DIGEST => _('Digest')
];
if (is_null($type)) {
return $authentication_types;
}
elseif (isset($authentication_types[$type])) {
return $authentication_types[$type];
}
else {
return _('Unknown');
}
}
function httptest_status2str($status = null) {
$statuses = [
HTTPTEST_STATUS_ACTIVE => _('Enabled'),
HTTPTEST_STATUS_DISABLED => _('Disabled')
];
if (is_null($status)) {
return $statuses;
}
elseif (isset($statuses[$status])) {
return $statuses[$status];
}
else {
return _('Unknown');
}
}
function httptest_status2style($status) {
$statuses = [
HTTPTEST_STATUS_ACTIVE => ZBX_STYLE_GREEN,
HTTPTEST_STATUS_DISABLED => ZBX_STYLE_RED
];
if (isset($statuses[$status])) {
return $statuses[$status];
}
else {
return ZBX_STYLE_GREY;
}
}
/**
* Delete web scenario item and web scenario step item history and trends by given web scenario IDs.
*
* @param array $httptestids
*
* @return bool
*/
function deleteHistoryByHttpTestIds(array $httptestids): bool {
DBstart();
$itemids = [];
$db_items = DBselect(
'SELECT hti.itemid'.
' FROM httptestitem hti'.
' WHERE '.dbConditionInt('httptestid', $httptestids).