mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 00:34:46 +02:00
add cps for agent, module, policies and bulk opertaion
This commit is contained in:
parent
7dc60b65a2
commit
76cd718262
@ -515,9 +515,20 @@ $table->data[4][3] = html_print_input_text ('url_description',
|
|||||||
$url_description, '', 45, 255, true);
|
$url_description, '', 45, 255, true);
|
||||||
|
|
||||||
$table->data[5][2] = __('Quiet');
|
$table->data[5][2] = __('Quiet');
|
||||||
$table->data[5][3] = ui_print_help_tip(
|
$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
|
||||||
__('The agent still runs but the alerts and events will be stop'), true);
|
$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true);
|
||||||
$table->data[5][3] .= html_print_checkbox('quiet', 1, $quiet, true);
|
|
||||||
|
$cps_array[-1] = __('Disabled');
|
||||||
|
if($cps > 0){
|
||||||
|
$cps_array[$cps] = __('Enabled');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$cps_array[0] = __('Enabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[6][0] = __('Cascade protection services');
|
||||||
|
$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||||
|
$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true);
|
||||||
|
|
||||||
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
||||||
unset($table);
|
unset($table);
|
||||||
|
@ -84,6 +84,7 @@ $direccion_agente = io_safe_input($direccion_agente);
|
|||||||
$intervalo = SECONDS_5MINUTES;
|
$intervalo = SECONDS_5MINUTES;
|
||||||
$ff_interval = 0;
|
$ff_interval = 0;
|
||||||
$quiet_module = 0;
|
$quiet_module = 0;
|
||||||
|
$cps_module = 0;
|
||||||
$id_server = "";
|
$id_server = "";
|
||||||
$max_alerts = 0;
|
$max_alerts = 0;
|
||||||
$modo = 1;
|
$modo = 1;
|
||||||
@ -148,6 +149,7 @@ $tab_description = '';
|
|||||||
$url_description = '';
|
$url_description = '';
|
||||||
$quiet = 0;
|
$quiet = 0;
|
||||||
$macros = '';
|
$macros = '';
|
||||||
|
$cps = 0;
|
||||||
|
|
||||||
$create_agent = (bool)get_parameter('create_agent');
|
$create_agent = (bool)get_parameter('create_agent');
|
||||||
$module_macros = array ();
|
$module_macros = array ();
|
||||||
@ -161,7 +163,7 @@ if ($create_agent) {
|
|||||||
|
|
||||||
//safe_output only validate ip
|
//safe_output only validate ip
|
||||||
$direccion_agente = trim(io_safe_output($direccion_agente));
|
$direccion_agente = trim(io_safe_output($direccion_agente));
|
||||||
|
|
||||||
if(!validate_address($direccion_agente)){
|
if(!validate_address($direccion_agente)){
|
||||||
$mssg_warning = 1;
|
$mssg_warning = 1;
|
||||||
}
|
}
|
||||||
@ -187,11 +189,12 @@ if ($create_agent) {
|
|||||||
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
|
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
|
||||||
$url_description = (string) get_parameter("url_description");
|
$url_description = (string) get_parameter("url_description");
|
||||||
$quiet = (int) get_parameter("quiet", 0);
|
$quiet = (int) get_parameter("quiet", 0);
|
||||||
|
$cps = (int) get_parameter("cps", 0);
|
||||||
|
|
||||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||||
|
|
||||||
if ($fields === false) $fields = array();
|
if ($fields === false) $fields = array();
|
||||||
|
|
||||||
$field_values = array();
|
$field_values = array();
|
||||||
|
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
@ -216,8 +219,10 @@ if ($create_agent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!$exists_alias){
|
if(!$exists_alias){
|
||||||
$id_agente = db_process_sql_insert ('tagente',
|
$id_agente = db_process_sql_insert (
|
||||||
array ('nombre' => $nombre_agente,
|
'tagente',
|
||||||
|
array (
|
||||||
|
'nombre' => $nombre_agente,
|
||||||
'alias' => $alias,
|
'alias' => $alias,
|
||||||
'alias_as_name' => $alias_as_name,
|
'alias_as_name' => $alias_as_name,
|
||||||
'direccion' => $direccion_agente,
|
'direccion' => $direccion_agente,
|
||||||
@ -235,7 +240,10 @@ if ($create_agent) {
|
|||||||
'icon_path' => $icon_path,
|
'icon_path' => $icon_path,
|
||||||
'update_gis_data' => $update_gis_data,
|
'update_gis_data' => $update_gis_data,
|
||||||
'url_address' => $url_description,
|
'url_address' => $url_description,
|
||||||
'quiet' => $quiet));
|
'quiet' => $quiet,
|
||||||
|
'cps' => $cps
|
||||||
|
)
|
||||||
|
);
|
||||||
enterprise_hook ('update_agent', array ($id_agente));
|
enterprise_hook ('update_agent', array ($id_agente));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -253,19 +261,19 @@ if ($create_agent) {
|
|||||||
if ( $direccion_agente != '') {
|
if ( $direccion_agente != '') {
|
||||||
agents_add_address ($id_agente, $direccion_agente);
|
agents_add_address ($id_agente, $direccion_agente);
|
||||||
}
|
}
|
||||||
|
|
||||||
$agent_created_ok = true;
|
$agent_created_ok = true;
|
||||||
|
|
||||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||||
WHERE id_group = ".$grupo);
|
WHERE id_group = ".$grupo);
|
||||||
|
|
||||||
if($tpolicy_group_old){
|
if($tpolicy_group_old){
|
||||||
foreach ($tpolicy_group_old as $key => $old_group) {
|
foreach ($tpolicy_group_old as $key => $old_group) {
|
||||||
db_process_sql_insert ('tpolicy_agents',
|
db_process_sql_insert ('tpolicy_agents',
|
||||||
array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente));
|
array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = '{"Name":"' . $nombre_agente .'",
|
$info = '{"Name":"' . $nombre_agente .'",
|
||||||
"IP":"' . $direccion_agente .'",
|
"IP":"' . $direccion_agente .'",
|
||||||
"Group":"' . $grupo .'",
|
"Group":"' . $grupo .'",
|
||||||
@ -282,8 +290,9 @@ if ($create_agent) {
|
|||||||
"Icon path":"' . $icon_path .'",
|
"Icon path":"' . $icon_path .'",
|
||||||
"Update GIS data":"' . $update_gis_data .'",
|
"Update GIS data":"' . $update_gis_data .'",
|
||||||
"Url description":"' . $url_description .'",
|
"Url description":"' . $url_description .'",
|
||||||
"Quiet":"' . (int)$quiet.'"}';
|
"Quiet":"' . (int)$quiet.'",
|
||||||
|
"Cps":"' . (int)$cps.'"}';
|
||||||
|
|
||||||
$unsafe_alias = io_safe_output($alias);
|
$unsafe_alias = io_safe_output($alias);
|
||||||
db_pandora_audit("Agent management",
|
db_pandora_audit("Agent management",
|
||||||
"Created agent $unsafe_alias", false, true, $info);
|
"Created agent $unsafe_alias", false, true, $info);
|
||||||
@ -743,6 +752,7 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
|
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
|
||||||
$url_description = (string) get_parameter("url_description");
|
$url_description = (string) get_parameter("url_description");
|
||||||
$quiet = (int) get_parameter("quiet", 0);
|
$quiet = (int) get_parameter("quiet", 0);
|
||||||
|
$cps = (int) get_parameter("cps", 0);
|
||||||
|
|
||||||
$old_interval = db_get_value('intervalo', 'tagente', 'id_agente', $id_agente);
|
$old_interval = db_get_value('intervalo', 'tagente', 'id_agente', $id_agente);
|
||||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||||
@ -794,47 +804,49 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
$direccion_agente != agents_get_address ($id_agente)) {
|
$direccion_agente != agents_get_address ($id_agente)) {
|
||||||
agents_add_address ($id_agente, $direccion_agente);
|
agents_add_address ($id_agente, $direccion_agente);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action_delete_ip = (bool)get_parameter('delete_ip', false);
|
$action_delete_ip = (bool)get_parameter('delete_ip', false);
|
||||||
//If IP is set for deletion, delete first
|
//If IP is set for deletion, delete first
|
||||||
if ($action_delete_ip) {
|
if ($action_delete_ip) {
|
||||||
$delete_ip = get_parameter_post ("address_list");
|
$delete_ip = get_parameter_post ("address_list");
|
||||||
|
|
||||||
$direccion_agente = agents_delete_address($id_agente, $delete_ip);
|
$direccion_agente = agents_delete_address($id_agente, $delete_ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array ('disabled' => $disabled,
|
$values = array (
|
||||||
'id_parent' => $id_parent,
|
'disabled' => $disabled,
|
||||||
'id_os' => $id_os,
|
'id_parent' => $id_parent,
|
||||||
'modo' => $modo,
|
'id_os' => $id_os,
|
||||||
'alias' => $alias,
|
'modo' => $modo,
|
||||||
'alias_as_name' => $alias_as_name,
|
'alias' => $alias,
|
||||||
'direccion' => $direccion_agente,
|
'alias_as_name' => $alias_as_name,
|
||||||
'id_grupo' => $grupo,
|
'direccion' => $direccion_agente,
|
||||||
'intervalo' => $intervalo,
|
'id_grupo' => $grupo,
|
||||||
'comentarios' => $comentarios,
|
'intervalo' => $intervalo,
|
||||||
'cascade_protection' => $cascade_protection,
|
'comentarios' => $comentarios,
|
||||||
'cascade_protection_module' => $cascade_protection_module,
|
'cascade_protection' => $cascade_protection,
|
||||||
'server_name' => $server_name,
|
'cascade_protection_module' => $cascade_protection_module,
|
||||||
'custom_id' => $custom_id,
|
'server_name' => $server_name,
|
||||||
'icon_path' => $icon_path,
|
'custom_id' => $custom_id,
|
||||||
'update_gis_data' => $update_gis_data,
|
'icon_path' => $icon_path,
|
||||||
'url_address' => $url_description,
|
'update_gis_data' => $update_gis_data,
|
||||||
'url_address' => $url_description,
|
'url_address' => $url_description,
|
||||||
'quiet' => $quiet,
|
'url_address' => $url_description,
|
||||||
'safe_mode_module' => $safe_mode_module);
|
'quiet' => $quiet,
|
||||||
|
'cps' => $cps,
|
||||||
|
'safe_mode_module' => $safe_mode_module
|
||||||
|
);
|
||||||
|
|
||||||
if ($config['metaconsole_agent_cache'] == 1) {
|
if ($config['metaconsole_agent_cache'] == 1) {
|
||||||
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
||||||
}
|
}
|
||||||
|
|
||||||
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente);
|
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente);
|
||||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||||
WHERE id_group = ".$group_old);
|
WHERE id_group = ".$group_old);
|
||||||
|
|
||||||
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
|
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
|
||||||
|
|
||||||
|
|
||||||
if ($result == false && $update_custom_result == false) {
|
if ($result == false && $update_custom_result == false) {
|
||||||
ui_print_error_message(
|
ui_print_error_message(
|
||||||
__('There was a problem updating the agent'));
|
__('There was a problem updating the agent'));
|
||||||
@ -868,7 +880,7 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
foreach ($tpolicy_group as $key => $value) {
|
foreach ($tpolicy_group as $key => $value) {
|
||||||
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
|
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
|
||||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente);
|
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente);
|
||||||
|
|
||||||
if(!$tpolicy_agents){
|
if(!$tpolicy_agents){
|
||||||
db_process_sql_insert ('tpolicy_agents',
|
db_process_sql_insert ('tpolicy_agents',
|
||||||
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente));
|
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente));
|
||||||
@ -879,7 +891,7 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = '{
|
$info = '{
|
||||||
"id_agente":"' . $id_agente . '",
|
"id_agente":"' . $id_agente . '",
|
||||||
"alias":"' . $alias . '",
|
"alias":"' . $alias . '",
|
||||||
@ -897,8 +909,9 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
"Icon Path":"' . $icon_path . '",
|
"Icon Path":"' . $icon_path . '",
|
||||||
"Update GIS data":"' .$update_gis_data .'",
|
"Update GIS data":"' .$update_gis_data .'",
|
||||||
"Url description":"' . $url_description .'",
|
"Url description":"' . $url_description .'",
|
||||||
"Quiet":"' . (int)$quiet.'"}';
|
"Quiet":"' . (int)$quiet.'",
|
||||||
|
"Cps":"' . (int)$cps.'"}';
|
||||||
|
|
||||||
enterprise_hook ('update_agent', array ($id_agente));
|
enterprise_hook ('update_agent', array ($id_agente));
|
||||||
ui_print_success_message (__('Successfully updated'));
|
ui_print_success_message (__('Successfully updated'));
|
||||||
db_pandora_audit("Agent management",
|
db_pandora_audit("Agent management",
|
||||||
@ -918,14 +931,14 @@ if ($id_agente) {
|
|||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
|
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
|
||||||
if (empty ($agent)) {
|
if (empty ($agent)) {
|
||||||
//Close out the page
|
//Close out the page
|
||||||
ui_print_error_message (__('There was a problem loading the agent'));
|
ui_print_error_message (__('There was a problem loading the agent'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$intervalo = $agent["intervalo"]; // Define interval in seconds
|
$intervalo = $agent["intervalo"]; // Define interval in seconds
|
||||||
$nombre_agente = $agent["nombre"];
|
$nombre_agente = $agent["nombre"];
|
||||||
if(empty($alias)){
|
if(empty($alias)){
|
||||||
@ -951,6 +964,7 @@ if ($id_agente) {
|
|||||||
$update_gis_data = $agent["update_gis_data"];
|
$update_gis_data = $agent["update_gis_data"];
|
||||||
$url_description = $agent["url_address"];
|
$url_description = $agent["url_address"];
|
||||||
$quiet = $agent["quiet"];
|
$quiet = $agent["quiet"];
|
||||||
|
$cps = $agent["cps"];
|
||||||
$safe_mode_module = $agent["safe_mode_module"];
|
$safe_mode_module = $agent["safe_mode_module"];
|
||||||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||||
}
|
}
|
||||||
@ -967,7 +981,7 @@ $edit_module = (bool) get_parameter ('edit_module');
|
|||||||
// GET DATA for MODULE UPDATE OR MODULE INSERT
|
// GET DATA for MODULE UPDATE OR MODULE INSERT
|
||||||
if ($update_module || $create_module) {
|
if ($update_module || $create_module) {
|
||||||
$id_grupo = agents_get_agent_group ($id_agente);
|
$id_grupo = agents_get_agent_group ($id_agente);
|
||||||
|
|
||||||
$id_agent_module = (int) get_parameter ('id_agent_module');
|
$id_agent_module = (int) get_parameter ('id_agent_module');
|
||||||
|
|
||||||
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
|
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
|
||||||
@ -1001,6 +1015,7 @@ if ($update_module || $create_module) {
|
|||||||
$interval = (int) get_parameter ('module_interval', $intervalo);
|
$interval = (int) get_parameter ('module_interval', $intervalo);
|
||||||
$ff_interval = (int) get_parameter ('module_ff_interval');
|
$ff_interval = (int) get_parameter ('module_ff_interval');
|
||||||
$quiet_module = (int) get_parameter ('quiet_module');
|
$quiet_module = (int) get_parameter ('quiet_module');
|
||||||
|
$cps_module = (int) get_parameter ('cps_module');
|
||||||
$id_plugin = (int) get_parameter ('id_plugin');
|
$id_plugin = (int) get_parameter ('id_plugin');
|
||||||
$id_export = (int) get_parameter ('id_export');
|
$id_export = (int) get_parameter ('id_export');
|
||||||
$disabled = (bool) get_parameter ('disabled');
|
$disabled = (bool) get_parameter ('disabled');
|
||||||
@ -1318,6 +1333,7 @@ if ($update_module) {
|
|||||||
'unit' => io_safe_output($unit),
|
'unit' => io_safe_output($unit),
|
||||||
'macros' => $macros,
|
'macros' => $macros,
|
||||||
'quiet' => $quiet_module,
|
'quiet' => $quiet_module,
|
||||||
|
'cps' => $cps_module,
|
||||||
'critical_instructions' => $critical_instructions,
|
'critical_instructions' => $critical_instructions,
|
||||||
'warning_instructions' => $warning_instructions,
|
'warning_instructions' => $warning_instructions,
|
||||||
'unknown_instructions' => $unknown_instructions,
|
'unknown_instructions' => $unknown_instructions,
|
||||||
@ -1362,8 +1378,8 @@ if ($update_module) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$check_dynamic =
|
$check_dynamic =
|
||||||
db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed
|
db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed
|
||||||
FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module);
|
FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module);
|
||||||
|
|
||||||
if( ($check_dynamic['dynamic_interval'] == $dynamic_interval) &&
|
if( ($check_dynamic['dynamic_interval'] == $dynamic_interval) &&
|
||||||
($check_dynamic['dynamic_max'] == $dynamic_max) &&
|
($check_dynamic['dynamic_max'] == $dynamic_max) &&
|
||||||
@ -1500,6 +1516,7 @@ if ($create_module) {
|
|||||||
'unit' => io_safe_output($unit),
|
'unit' => io_safe_output($unit),
|
||||||
'macros' => $macros,
|
'macros' => $macros,
|
||||||
'quiet' => $quiet_module,
|
'quiet' => $quiet_module,
|
||||||
|
'cps' => $cps_module,
|
||||||
'critical_instructions' => $critical_instructions,
|
'critical_instructions' => $critical_instructions,
|
||||||
'warning_instructions' => $warning_instructions,
|
'warning_instructions' => $warning_instructions,
|
||||||
'unknown_instructions' => $unknown_instructions,
|
'unknown_instructions' => $unknown_instructions,
|
||||||
|
@ -162,6 +162,7 @@ if ($id_agent_module) {
|
|||||||
}
|
}
|
||||||
$ff_interval = $module['module_ff_interval'];
|
$ff_interval = $module['module_ff_interval'];
|
||||||
$quiet_module = $module['quiet'];
|
$quiet_module = $module['quiet'];
|
||||||
|
$cps_module = $module['cps'];
|
||||||
$unit = $module['unit'];
|
$unit = $module['unit'];
|
||||||
$tcp_port = $module['tcp_port'];
|
$tcp_port = $module['tcp_port'];
|
||||||
$tcp_send = $module['tcp_send'];
|
$tcp_send = $module['tcp_send'];
|
||||||
@ -302,6 +303,7 @@ else {
|
|||||||
$max = '';
|
$max = '';
|
||||||
$interval = '';
|
$interval = '';
|
||||||
$quiet_module = 0;
|
$quiet_module = 0;
|
||||||
|
$cps_module = 0;
|
||||||
$unit = '';
|
$unit = '';
|
||||||
$prediction_module = '';
|
$prediction_module = '';
|
||||||
$custom_integer_1 = 0;
|
$custom_integer_1 = 0;
|
||||||
|
@ -566,11 +566,20 @@ if ($__code_from == 'modules') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$table_advanced->data[7][0] = __('Quiet');
|
$table_advanced->data[7][0] = __('Quiet');
|
||||||
$table_advanced->data[7][0] .= ui_print_help_tip(
|
$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
|
||||||
__('The module still stores data but the alerts and events will be stop'), true);
|
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy);
|
||||||
$table_advanced->colspan[7][1] = 7;
|
|
||||||
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1,
|
$cps_array[-1] = __('Disabled');
|
||||||
$quiet_module, true, $disabledBecauseInPolicy);
|
if($cps > 0){
|
||||||
|
$cps_array[$cps_module] = __('Enabled');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$cps_array[0] = __('Enabled');
|
||||||
|
}
|
||||||
|
$table_advanced->data[7][2] = __('Cascade Protection Services');
|
||||||
|
$table_advanced->data[7][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||||
|
$table_advanced->colspan[7][3] = 5;
|
||||||
|
$table_advanced->data[7][3] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, "", $disabledBecauseInPolicy);
|
||||||
|
|
||||||
$table_advanced->data[8][0] = __('Critical instructions') .
|
$table_advanced->data[8][0] = __('Critical instructions') .
|
||||||
ui_print_help_tip(__("Instructions when the status is critical"), true);
|
ui_print_help_tip(__("Instructions when the status is critical"), true);
|
||||||
|
@ -82,6 +82,8 @@ if ($update_agents) {
|
|||||||
$values['delete_conf'] = get_parameter('delete_conf');
|
$values['delete_conf'] = get_parameter('delete_conf');
|
||||||
if (get_parameter('quiet_select', -1) != -1)
|
if (get_parameter('quiet_select', -1) != -1)
|
||||||
$values['quiet'] = get_parameter('quiet_select');
|
$values['quiet'] = get_parameter('quiet_select');
|
||||||
|
if (get_parameter('cps_select', -2) != -2)
|
||||||
|
$values['cps'] = get_parameter('cps_select');
|
||||||
|
|
||||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||||
|
|
||||||
@ -392,6 +394,7 @@ $update_gis_data = -1;
|
|||||||
$cascade_protection = -1;
|
$cascade_protection = -1;
|
||||||
$cascade_protection_module = -1;
|
$cascade_protection_module = -1;
|
||||||
$quiet_select = -1;
|
$quiet_select = -1;
|
||||||
|
$cps_select = -2;
|
||||||
|
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
@ -479,6 +482,19 @@ $table->data[6][1] = html_print_select(array(-1 => __('No change'),
|
|||||||
1 => __('Yes'), 0 => __('No')),
|
1 => __('Yes'), 0 => __('No')),
|
||||||
"quiet_select", $quiet_select, "", '', 0, true);
|
"quiet_select", $quiet_select, "", '', 0, true);
|
||||||
|
|
||||||
|
$cps_array[-2] = __('No change');
|
||||||
|
$cps_array[-1] = __('Disabled');
|
||||||
|
if($cps > 0){
|
||||||
|
$cps_array[$cps_select] = __('Enabled');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$cps_array[0] = __('Enabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[7][0] = __('Cascade Protection Service');
|
||||||
|
$table->data[7][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||||
|
$table->data[7][1] = html_print_select($cps_array, "cps_select", $cps_select, "", '', 0, true);
|
||||||
|
|
||||||
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
||||||
unset($table);
|
unset($table);
|
||||||
|
|
||||||
|
@ -635,21 +635,34 @@ $table->data['edit11'][0] .= ui_print_help_tip(__('The module still store data b
|
|||||||
$table->data['edit11'][1] = html_print_select(array(-1 => __('No change'),
|
$table->data['edit11'][1] = html_print_select(array(-1 => __('No change'),
|
||||||
1 => __('Yes'), 0 => __('No')),
|
1 => __('Yes'), 0 => __('No')),
|
||||||
"quiet_select", -1, "", '', 0, true);
|
"quiet_select", -1, "", '', 0, true);
|
||||||
$table->data['edit11'][2] = __('Timeout');
|
|
||||||
$table->data['edit11'][3] = html_print_input_text(
|
$cps_array[-2] = __('No change');
|
||||||
|
$cps_array[-1] = __('Disabled');
|
||||||
|
if($cps > 0){
|
||||||
|
$cps_array[$cps_select] = __('Enabled');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$cps_array[0] = __('Enabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data['edit11'][2] = __('Cascade Protection Service');
|
||||||
|
$table->data['edit11'][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||||
|
$table->data['edit11'][3] .= html_print_select($cps_array, "cps_select", -1, "", '', 0, true);
|
||||||
|
|
||||||
|
$table->data['edit16'][0] = __('Timeout');
|
||||||
|
$table->data['edit16'][1] .= html_print_input_text(
|
||||||
'max_timeout', '', '', 5, 10, true) . ' ' .
|
'max_timeout', '', '', 5, 10, true) . ' ' .
|
||||||
ui_print_help_tip (
|
ui_print_help_tip (
|
||||||
__('Seconds that agent will wait for the execution of the module.'), true);
|
__('Seconds that agent will wait for the execution of the module.'), true);
|
||||||
|
|
||||||
$table->data['edit16'][0] = __('Retries');
|
$table->data['edit16'][1] .= __('Retries');
|
||||||
$table->data['edit16'][1] = html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' .
|
$table->data['edit16'][1] .= html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' .
|
||||||
ui_print_help_tip (
|
ui_print_help_tip (
|
||||||
__('Number of retries that the module will attempt to run.'), true);
|
__('Number of retries that the module will attempt to run.'), true);
|
||||||
|
|
||||||
|
$table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);;
|
||||||
$table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);;
|
$table->data['edit22'][1] = '<textarea id="textarea_plugin_parameter" name="plugin_parameter" cols="65" rows="15"></textarea>';
|
||||||
$table->data['edit22'][1] = '<textarea id="textarea_plugin_parameter" name="plugin_parameter" cols="65" rows="15"></textarea>';
|
|
||||||
|
|
||||||
$table->data['edit16'][2] = __('Port');
|
$table->data['edit16'][2] = __('Port');
|
||||||
$table->data['edit16'][3] = html_print_input_text ('tcp_port', '', '', 5, 20, true);
|
$table->data['edit16'][3] = html_print_input_text ('tcp_port', '', '', 5, 20, true);
|
||||||
|
|
||||||
@ -1491,7 +1504,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
|
|||||||
$values['custom_string_2'] = io_input_password($snmp3_privacy_pass);
|
$values['custom_string_2'] = io_input_password($snmp3_privacy_pass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$throw_unknown_events = get_parameter('throw_unknown_events', '');
|
$throw_unknown_events = get_parameter('throw_unknown_events', '');
|
||||||
if ($throw_unknown_events !== '') {
|
if ($throw_unknown_events !== '') {
|
||||||
//Set the event type that can show.
|
//Set the event type that can show.
|
||||||
@ -1499,24 +1512,27 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
|
|||||||
EVENTS_GOING_UNKNOWN => (int)$throw_unknown_events);
|
EVENTS_GOING_UNKNOWN => (int)$throw_unknown_events);
|
||||||
$values['disabled_types_event'] = json_encode($disabled_types_event);
|
$values['disabled_types_event'] = json_encode($disabled_types_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (strlen(get_parameter('history_data')) > 0) {
|
if (strlen(get_parameter('history_data')) > 0) {
|
||||||
$values['history_data'] = get_parameter('history_data');
|
$values['history_data'] = get_parameter('history_data');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_parameter('quiet_select', -1) != -1) {
|
if (get_parameter('quiet_select', -1) != -1) {
|
||||||
$values['quiet'] = get_parameter('quiet_select');
|
$values['quiet'] = get_parameter('quiet_select');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get_parameter('cps_select', -2) != -2) {
|
||||||
|
$values['cps'] = get_parameter('cps_select');
|
||||||
|
}
|
||||||
|
|
||||||
$filter_modules = false;
|
$filter_modules = false;
|
||||||
|
|
||||||
if (!is_numeric($module_name) or ($module_name != 0))
|
if (!is_numeric($module_name) or ($module_name != 0))
|
||||||
$filter_modules['nombre'] = $module_name;
|
$filter_modules['nombre'] = $module_name;
|
||||||
|
|
||||||
// Whether to update module tag info
|
// Whether to update module tag info
|
||||||
$update_tags = get_parameter('id_tag', false);
|
$update_tags = get_parameter('id_tag', false);
|
||||||
|
|
||||||
if (array_search(0, $agents_select) !== false) {
|
if (array_search(0, $agents_select) !== false) {
|
||||||
//Apply at All agents.
|
//Apply at All agents.
|
||||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user