Source
$messages['triggers.severities'] = serialize(array_filter($messages['triggers.severities'], function($v) {
<?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/>.
**/
function getSounds() {
$file_list = [];
$dir = scandir('./audio');
foreach ($dir as $file) {
$pos = strrpos($file, '.');
if ($pos === false || mb_strtolower(substr($file, $pos + 1)) !== 'mp3') {
continue;
}
$filename = substr($file, 0, $pos);
$file_list[$filename] = $file;
}
return $file_list;
}
function getMessageSettings() {
$defSeverities = [
TRIGGER_SEVERITY_NOT_CLASSIFIED => 1,
TRIGGER_SEVERITY_INFORMATION => 1,
TRIGGER_SEVERITY_WARNING => 1,
TRIGGER_SEVERITY_AVERAGE => 1,
TRIGGER_SEVERITY_HIGH => 1,
TRIGGER_SEVERITY_DISASTER => 1
];
$messages = [
'enabled' => 0,
'timeout' => 60,
'last.clock' => 0,
'triggers.recovery' => 1,
'triggers.severities' => null,
'sounds.mute' => 0,
'sounds.repeat' => 1,
'sounds.recovery' => 'alarm_ok.mp3',
'sounds.'.TRIGGER_SEVERITY_NOT_CLASSIFIED => 'no_sound.mp3',
'sounds.'.TRIGGER_SEVERITY_INFORMATION => 'alarm_information.mp3',
'sounds.'.TRIGGER_SEVERITY_WARNING => 'alarm_warning.mp3',
'sounds.'.TRIGGER_SEVERITY_AVERAGE => 'alarm_average.mp3',
'sounds.'.TRIGGER_SEVERITY_HIGH => 'alarm_high.mp3',
'sounds.'.TRIGGER_SEVERITY_DISASTER => 'alarm_disaster.mp3',
'show_suppressed' => 0,
'snoozed.eventid' => 0
];
$dbProfiles = DBselect(