Source
* @param array $parent_templates The list of the templates, prepared by getHostPrototypeParentTemplates() function.
<?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/>.
**/
/**
* Get ipmi auth type label by it's number.
*
* @param null|int $type
*
* @return array|string
*/
function ipmiAuthTypes($type = null) {
$types = [
IPMI_AUTHTYPE_DEFAULT => _('Default'),
IPMI_AUTHTYPE_NONE => _('None'),
IPMI_AUTHTYPE_MD2 => _('MD2'),
IPMI_AUTHTYPE_MD5 => 'MD5',
IPMI_AUTHTYPE_STRAIGHT => _('Straight'),
IPMI_AUTHTYPE_OEM => _('OEM'),
IPMI_AUTHTYPE_RMCP_PLUS => _('RMCP+')
];
if (is_null($type)) {
return $types;
}
elseif (isset($types[$type])) {
return $types[$type];
}
else {
return _('Unknown');
}
}
/**
* Get ipmi auth privilege label by it's number.
*
* @param null|int $type
*
* @return array|string
*/
function ipmiPrivileges($type = null) {
$types = [
IPMI_PRIVILEGE_CALLBACK => _('Callback'),
IPMI_PRIVILEGE_USER => _('User'),
IPMI_PRIVILEGE_OPERATOR => _('Operator'),
IPMI_PRIVILEGE_ADMIN => _('Admin'),
IPMI_PRIVILEGE_OEM => _('OEM')
];
if (is_null($type)) {
return $types;