#11799 hide interval for broker agents

This commit is contained in:
Jonathan 2024-01-25 15:25:08 +01:00
parent 874bd04aa8
commit cdd9af5108
1 changed files with 16 additions and 12 deletions

View File

@ -499,19 +499,23 @@ $tableAgent->data['primary_group'][0] .= ui_print_group_icon(
'after_input_icon'
);
$tableAgent->data['primary_group'][0] .= '</span>';
// CHECK BROKER FOR SHOW INTERVAL.
enterprise_include('include/functions_config_agents.php');
// Read configuration file.
$files = config_agents_get_agent_config_filenames($id_agente);
$file_name = $files['conf'];
$agent_config = file_get_contents($file_name);
$encoding = 'UTF-8';
$agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding);
if ($agent_config_utf8 !== false) {
$agent_config = $agent_config_utf8;
}
$broker = str_contains($agent_config, '#broker active');
$broker = false;
if (enterprise_installed()) {
// CHECK BROKER FOR SHOW INTERVAL.
enterprise_include('include/functions_config_agents.php');
// Read configuration file.
$files = config_agents_get_agent_config_filenames($id_agente);
$file_name = $files['conf'];
$agent_config = file_get_contents($file_name);
$encoding = 'UTF-8';
$agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding);
if ($agent_config_utf8 !== false) {
$agent_config = $agent_config_utf8;
}
$broker = str_contains($agent_config, '#broker active');
}
if ($broker === false) {
$tableAgent->data['caption_interval'][0] = __('Interval');