diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 50b47d9d34..a72ce6dc71 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -47,7 +47,7 @@ else { $action = get_parameterBetweenListValues('action2', array('new', 'save', 'edit', 'update', 'delete'), 'new'); } -$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'editor'), 'data'); +$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data'); $refr = (int) get_parameter ('refr', $config['vc_refr']); @@ -397,6 +397,25 @@ switch ($activeTab) { break; } break; + case 'wizard_services': + $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); + $visualConsoleName = $visualConsole['name']; + switch ($action) { + case 'update': + enterprise_include_once("/include/functions_visual_map.php"); + + $icon = (string) get_parameter('icon'); + $id_services = (array) get_parameter('services_selected'); + + $result = enterprise_hook('enterprise_visual_map_process_services_wizard_add', array($id_services, $idVisualConsole, $icon)); + if ($result != ENTERPRISE_NOT_HOOK) { + $statusProcessInDB = array('flag' => $result['status'], 'message' => $result['message']); + } + + $action = 'edit'; + break; + } + break; case 'editor': switch ($action) { case 'new': @@ -429,28 +448,36 @@ else { // Hash for auto-auth in public link $hash = md5($config["dbpass"] . $id_layout . $config["id_user"]); -$buttons = array( - 'consoles_list' => array('active' => false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .''), - 'public_link' => array('active' => false, - 'text' => ''. - html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).''), - 'data' => array('active' => false, - 'text' => '' . - html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .''), - 'list_elements' => array('active' => false, - 'text' => '' . - html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .''), - 'wizard' => array('active' => false, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .''), - 'editor' => array('active' => false, - 'text' => '' . - html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .''), - 'view' => array('active' => false, - 'text' => '' . - html_print_image ("images/operation.png", true, array ("title" => __('View'))) .'')); +$buttons = array(); + +$buttons['consoles_list'] = array('active' => false, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .''); +$buttons['public_link'] = array('active' => false, + 'text' => ''. + html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).''); +$buttons['data'] = array('active' => false, + 'text' => '' . + html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .''); +$buttons['list_elements'] = array('active' => false, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .''); + +if (enterprise_installed()) { + $buttons['wizard_services'] = array('active' => false, + 'text' => '' . + html_print_image ("images/wand_services.png", true, array ("title" => __('Services wizard'))) .''); +} + +$buttons['wizard'] = array('active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .''); +$buttons['editor'] = array('active' => false, + 'text' => '' . + html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .''); +$buttons['view'] = array('active' => false, + 'text' => '' . + html_print_image ("images/operation.png", true, array ("title" => __('View'))) .''); if ($action == 'new' || $idVisualConsole === false) { $buttons = array('data' => $buttons['data']); //Show only the data tab @@ -474,6 +501,11 @@ switch ($activeTab) { case 'wizard': require_once($config['homedir'] . '/godmode/reporting/visual_console_builder.wizard.php'); break; + case 'wizard_services': + if (enterprise_installed()) { + enterprise_include('/godmode/reporting/visual_console_builder.wizard_services.php'); + } + break; case 'data': require_once($config['homedir'] . '/godmode/reporting/visual_console_builder.data.php'); break; diff --git a/pandora_console/images/wand_services.png b/pandora_console/images/wand_services.png new file mode 100644 index 0000000000..2654e5ee9d Binary files /dev/null and b/pandora_console/images/wand_services.png differ diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 5dabafe113..98144a7157 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -226,7 +226,10 @@ define('SERVICE_ELEMENT_WEIGHT_CRITICAL', 1); define('SERVICE_ELEMENT_WEIGHT_WARNING', 0.5); define('SERVICE_ELEMENT_WEIGHT_OK', 0); define('SERVICE_ELEMENT_WEIGHT_UNKNOWN', 0); - +//Modes +define('SERVICE_MODE_MANUAL', 0); +define('SERVICE_MODE_AUTO', 1); +define('SERVICE_MODE_SIMPLE', 2); /* Status images */ diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index 5bdc878177..6e385f7ee6 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -123,6 +123,11 @@ else { $sql_post .= " AND id_agente = " . $id_agent; break; } + +} + +if ($id_agent_module) { + $sql_post .= " AND id_agentmodule = " . $id_agent_module; } if ($id_user_ack != "0") diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index ff03eb1730..53273f6a18 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -193,6 +193,7 @@ $event_type = get_parameter ("event_type", ''); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", 3); // -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated, $id_agent = (int) get_parameter ("id_agent", 0); +$id_agent_module = (int) get_parameter ("id_agent_module", 0); $pagination = (int) get_parameter ("pagination", $config["block_size"]); $event_view_hr = (int) get_parameter ("event_view_hr", $history ? 0 : $config["event_view_hr"]); $id_user_ack = get_parameter ("id_user_ack", 0); diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 2cd7a780ef..42c85ce38a 100644 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -96,6 +96,12 @@ if (check_acl ($config["id_user"], $id_group, "RW")) { html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .''; $options['list_elements']['text'] = '' . html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .''; + + if (enterprise_installed()) { + $options['wizard_services']['text'] = '' . + html_print_image ("images/wand_services.png", true, array ("title" => __('Services wizard'))) .''; + } + $options['wizard']['text'] = '' . html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .''; $options['editor']['text'] = '' .