diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 68fed537b4..5199a030ae 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210527 +Version: 7.0NG.754-210528 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 1a3b93590f..f01b00ee29 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210527" +pandora_version="7.0NG.754-210528" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 2dc59f129b..0329fd8a41 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210527'; +use constant AGENT_BUILD => '210528'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 3b3ea1d6ec..b094bd0ae7 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210527 +%define release 210528 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index b940c8b585..d71828b386 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210527 +%define release 210528 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index c761574ac4..c64d01b09e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210527" +PI_BUILD="210528" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0d7d94ede5..01fba38997 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210527} +{210528} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 014db5cebb..83d167d56d 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.754 Build 210527") +#define PANDORA_VERSION ("7.0NG.754 Build 210528") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 69bafa9a00..bc907eca4b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.754(Build 210527))" + VALUE "ProductVersion", "(7.0NG.754(Build 210528))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e96ee4632a..f56c42c5e2 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210527 +Version: 7.0NG.754-210528 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 352fe3bf0c..15edaa640e 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210527" +pandora_version="7.0NG.754-210528" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 0abde09010..f93dec02a4 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -1,16 +1,29 @@ '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); + echo ''; echo ''; echo "'; diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 3b9670a8e0..4e1f0e791c 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -196,7 +196,6 @@ function mainModuleGroups() ON ta.id_agente = tam.id_agente WHERE ta.disabled = 0 AND tam.disabled = 0 - AND tam.id_modulo <> 0 AND tam.delete_pending = 0 AND ta.id_grupo IN (%s) GROUP BY tam.id_agente_modulo @@ -246,13 +245,24 @@ function mainModuleGroups() $array_data[$value['id_grupo']][$value['id_mg']] = $value; } - ui_print_page_header( + // Header. + ui_print_standard_header( __('Combined table of agent group and module group'), 'images/module_group.png', false, '', false, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); echo "
".$fullscreen['text'].'
diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 37593d5355..cd417e3a43 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -53,13 +53,24 @@ function pandora_realtime_graphs() $hide_header = get_parameter('hide_header', 0); if ($hide_header === 0) { - ui_print_page_header( + // Header. + ui_print_standard_header( __('Realtime graphs'), 'images/extensions.png', false, 'real_time_view', false, - $onheader + $onheader, + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); } diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index 950f4e2b81..2f904dbf9f 100755 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -1096,13 +1096,8 @@ function resource_registration_extension_main() } $xml = simplexml_load_file($_FILES['resource_upload']['tmp_name'], null, LIBXML_NOCDATA); - if ($xml === false) { - ui_print_error_message( - __('Error uploading resource. Check if the selected file is a valid resource template in .ptr format') - ); - } else { - process_upload_xml($xml); - } + + process_upload_xml($xml); } diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php index 8946b5e1f8..90a1bc5d4d 100644 --- a/pandora_console/general/alert_enterprise.php +++ b/pandora_console/general/alert_enterprise.php @@ -192,15 +192,15 @@ if (check_login()) { echo " -
-
+
+
OK
"; if ($open) { echo "
About Enterprise -
"; +
"; } } diff --git a/pandora_console/general/first_task/cluster_builder.php b/pandora_console/general/first_task/cluster_builder.php index 08ea618cce..157bdce0d7 100644 --- a/pandora_console/general/first_task/cluster_builder.php +++ b/pandora_console/general/first_task/cluster_builder.php @@ -24,12 +24,20 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], return; } -\ui_print_page_header( - __('Monitoring').' » '.__('Clusters'), +// Header. +ui_print_standard_header( + __('Clusters'), 'images/chart.png', false, '', - false + false, + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + ] ); ui_require_css_file('first_task'); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 3856b1be8c..32b1d14ea2 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -1,17 +1,32 @@ $viewtab]; // Header. -ui_print_page_header( +ui_print_standard_header( __('Agents defined in %s', get_product_name()), 'images/agent.png', false, '', true, - $onheader + $onheader, + [ + [ + 'link' => '', + 'label' => __('Resources'), + ], + [ + 'link' => '', + 'label' => __('Manage agents'), + ], + ] ); if (is_central_policies_on_node()) { diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 335017ab51..6f2747de19 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -1130,7 +1130,6 @@ foreach ($modules as $module) { [ 'alt' => __('Enable module'), 'title' => __('Enable module'), - 'class' => 'invert_filter_important', ] ).''; } else { diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index bda1aaa2b5..9844a34fa3 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -115,12 +115,7 @@ function add_component_selection($id_network_component_type) '', '---'.__('Manual setup').'---', 0, - true, - false, - true, - '', - false, - 'width: 460px; ' + true ); $data[1] .= ''; $data[1] .= ' '; $data[1] .= ''; - $data[1] .= ''; + $data[1] .= ''; $data[1] .= ''; } } @@ -1278,7 +1285,34 @@ if ($create_alert || $update_alert) { } if (check_acl_restricted_all($config['id_user'], $row['id_group'], 'LW')) { - $data[8] = ''.html_print_image('images/copy.png', true, ['alt' => __('Duplicate'), 'title' => __('Duplicate'), 'class' => 'invert_filter']).''.''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter']).''.''.html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']).''.''.html_print_image('images/cross.png', true, ['border' => '0', 'class' => 'invert_filter', 'alt' => __('Delete')]).''; + $data[8] = ''.html_print_image( + 'images/copy.png', + true, + [ + 'alt' => __('Duplicate'), + 'title' => __('Duplicate'), + ] + ).''.''.html_print_image( + 'images/config.png', + true, + [ + 'border' => '0', + 'alt' => __('Update'), + ] + ).''.''.html_print_image( + 'images/add.png', + true, + [ + 'title' => __('Add action'), + ] + ).''.''.html_print_image( + 'images/cross.png', + true, + [ + 'border' => '0', + 'alt' => __('Delete'), + ] + ).''; $data[9] = html_print_checkbox_extended( @@ -1409,7 +1443,7 @@ if ($create_alert || $update_alert) { echo '
'; html_print_input_hidden('multiple_delete', 1); - html_print_submit_button(__('Delete selected'), 'delete_button', false, 'class="sub delete"'); + html_print_submit_button(__('Delete selected'), 'delete_button', false, 'class="sub delete mrgn_btn_10px"'); echo '
'; echo ''; } diff --git a/pandora_console/godmode/snmpconsole/snmp_filters.php b/pandora_console/godmode/snmpconsole/snmp_filters.php index 8afefcf34f..821d7a7c6e 100644 --- a/pandora_console/godmode/snmpconsole/snmp_filters.php +++ b/pandora_console/godmode/snmpconsole/snmp_filters.php @@ -32,15 +32,36 @@ $index_post = (int) get_parameter('index_post', 0); // Create/update header if ($edit_filter > -2) { if ($edit_filter > -1) { - ui_print_page_header(__('SNMP Console').' » '.__('Update filter'), 'images/op_snmp.png', false, '', false); + $activeFilterCaption = ' » '.__('Update filter'); } else { - ui_print_page_header(__('SNMP Console').' » '.__('Create filter'), 'images/op_snmp.png', false, '', false); + $activeFilterCaption = ' » '.__('Create filter'); } } else { // Overview header - ui_print_page_header(__('SNMP Console').' » '.__('Filter overview'), 'images/op_snmp.png', false, '', false); + $activeFilterCaption = ' » '.__('Filter overview'); } +// Header. +ui_print_standard_header( + __('SNMP Console').$activeFilterCaption, + 'images/op_snmp.png', + false, + '', + false, + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('SMNP'), + ], + ] +); + + // Create/update filter if ($update_filter > -2) { // UPDATE diff --git a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php index 29137f1382..15173eee4c 100755 --- a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php +++ b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php @@ -33,14 +33,27 @@ $snmp_type = (int) get_parameter('snmp_type', 0); $snmp_value = (string) get_parameter('snmp_value', ''); $generate_trap = (bool) get_parameter('generate_trap', 0); -ui_print_page_header( +// Header. +ui_print_standard_header( __('SNMP Trap generator'), 'images/op_snmp.png', false, 'snmp_trap_generator_view', - false + false, + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('SMNP'), + ], + ] ); + if ($generate_trap) { $result = true; $error = ''; diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index b72b2985f9..bcc7719c23 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -1582,6 +1582,10 @@ class AgentWizard extends HTML if ($candidate['execution_type'] === 0 || $candidate['execution_type'] === EXECUTION_TYPE_NETWORK ) { + if (substr($candidate['value'], 0, 1) !== '.') { + $candidate['value'] = '.'.$candidate['value']; + } + if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE) { $values['id_module'] = MODULE_DATA; $values['module_interval'] = 1; @@ -1947,6 +1951,10 @@ class AgentWizard extends HTML || $candidate['execution_type'] === EXECUTION_TYPE_NETWORK ) { if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE) { + if (substr($candidate['value'], 0, 1) !== '.') { + $candidate['value'] = '.'.$candidate['value']; + } + $tmp->module_interval(300); $tmp->id_modulo(MODULE_DATA); $tmp->updateConfigurationData( diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index 6ff84785dc..5e0861ed6c 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -729,37 +729,24 @@ class AgentsAlerts extends HTML public function loadHeader() { if ($this->pure == 0) { - // Breadcrums. - $this->setBreadcrum([]); - - $this->prepareBreadcrum( - [ - [ - 'link' => '', - 'label' => __('Monitoring'), - 'selected' => false, - ], - [ - 'link' => '', - 'label' => __('Views'), - 'selected' => true, - ], - ], - true - ); - - ui_print_page_header( + // Header. + ui_print_standard_header( __('Agents/Alerts'), '', false, '', - true, - '', false, - '', - GENERIC_SIZE_TEXT, - '', - $this->printHeader(true) + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); } diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index dc0dca6df4..6050bffa2e 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -279,8 +279,10 @@ class Tree protected function getTagJoin() { - return 'INNER JOIN ttag_module ttm - ON tam.id_agente_modulo = ttm.id_agente_modulo'; + return 'INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente + INNER JOIN ttag_module ttm + ON tam.id_agente_modulo = ttm.id_agente_modulo'; } @@ -931,11 +933,16 @@ class Tree $agent_status_filter = $this->getAgentStatusFilter(); $module_search_filter = $this->getModuleSearchFilter(); $module_status_inner = ''; - $module_status_filter = $this->getModuleStatusFilterFromTestado(); - if (!empty($module_status_filter)) { - $module_status_inner = ' - INNER JOIN tagente_estado tae - ON tae.id_agente_modulo = tam.id_agente_modulo'; + $module_search_inner = ''; + $module_search_filter = ''; + if (!empty($this->filter['searchModule'])) { + $module_search_inner = ' + INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae + ON tae.id_agente_modulo = tam.id_agente_modulo'; + $module_search_filter = "AND tam.disabled = 0 + AND tam.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado(); } $sql_model = "SELECT %s FROM @@ -944,13 +951,11 @@ class Tree FROM tagente ta LEFT JOIN tagent_secondary_group tasg ON ta.id_agente = tasg.id_agent - INNER JOIN tagente_modulo tam - ON ta.id_agente = tam.id_agente $inner_inside $module_status_inner $group_inner + $module_search_inner WHERE ta.disabled = 0 - AND tam.disabled = 0 %s $agent_search_filter $agent_status_filter @@ -973,6 +978,7 @@ class Tree $inner GROUP BY g ORDER BY $order_by_final"; + hd($sql, true); return $sql; } @@ -1020,7 +1026,7 @@ class Tree $agent_search_filter = $this->getAgentSearchFilter(); $agent_status_filter = $this->getAgentStatusFilter(); $module_search_filter = $this->getModuleSearchFilter(); - $module_status_filter = $this->getModuleStatusFilterFromTestado($this->filter['statusModule']); + $module_status_filter = $this->getModuleStatusFilter(); $condition = $this->L2condition; $condition_inside = $this->L2conditionInside; diff --git a/pandora_console/include/class/TreeModuleGroup.class.php b/pandora_console/include/class/TreeModuleGroup.class.php index b5cec41370..9b8d39fd6f 100644 --- a/pandora_console/include/class/TreeModuleGroup.class.php +++ b/pandora_console/include/class/TreeModuleGroup.class.php @@ -31,6 +31,8 @@ class TreeModuleGroup extends Tree 'tmg.id_mg AS id', ]; $this->L1inner = 'INNER JOIN tmodule_group tmg ON tmg.id_mg = x2.g'; + $this->L1innerInside = 'INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente'; $this->L1orderByFinal = 'tmg.name'; $this->L2condition = 'AND tam.id_module_group = '.$this->rootID; diff --git a/pandora_console/include/class/TreeTag.class.php b/pandora_console/include/class/TreeTag.class.php index 280d34fa2b..87d05a644b 100644 --- a/pandora_console/include/class/TreeTag.class.php +++ b/pandora_console/include/class/TreeTag.class.php @@ -27,6 +27,8 @@ class TreeTag extends Tree $this->L1fieldName = 'id_tag'; $this->L1fieldNameSql = 'ttm.id_tag'; $this->L1innerInside = ' + INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente INNER JOIN ttag_module ttm ON ttm.id_agente_modulo = tam.id_agente_modulo '; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 430ca593b6..d18146b678 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210527'; +$build_version = 'PC210528'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index f7d264d0c4..26a46eae7b 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -374,7 +374,7 @@ function db_get_value_filter($field, $table, $filter, $where_join='AND', $search * * @param string SQL select statement to execute. * - * @return the first value of the first row of a table result from query. + * @return mixed the first value of the first row of a table result from query. */ function db_get_value_sql($sql, $dbconnection=false) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b2d1edb62d..0842cff2bd 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2711,6 +2711,7 @@ function reporting_exception( // Metaconsole connection. $server_name = $exc['server_name']; if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) { + metaconsole_restore_db(); $connection = metaconsole_get_connection($server_name); if (metaconsole_load_external_db($connection) != NOERR) { // ui_print_error_message ("Error connecting to ".$server_name); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 0d12af41a9..f4d0dff15e 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -35,6 +35,8 @@ if (isset($config['homedir'])) { include_once $config['homedir'].'/include/functions_groups.php'; include_once $config['homedir'].'/include/functions_users.php'; include_once $config['homedir'].'/include/functions_html.php'; + // For standard breadcrumbs. + ui_require_css_file('discovery'); } @@ -4302,6 +4304,99 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } +/** + * Generates the Pandora 75x Standard views header. + * This function should be the standard for + * generating the headers of all PFMS views. + * + * @param string $title The title of this view. + * @param string $icon Icon for show. + * @param boolean $return If true, the string with the formed header is returned. + * @param string $help String for attach at end a link for help. + * @param boolean $godmode If false, it will created like operation mode. + * @param array $options Tabs allowed + * @param array $breadcrumbs Breadcrumbs with the walk. + * + * EXAMPLE: + * ``` + * $buttons['option_1'] = [ + * 'active' => false, + * 'text' => ''.html_print_image( + * 'images/wand.png', + * true, + * [ 'title' => __('Option 1 for show'), 'class' => 'invert_filter' ] + * ).'', + * ]; + * + * ui_print_standard_header( + * __('Favorites'), + * 'images/op_reporting.png', + * false, + * '', + * true, + * $buttons, + * [ + * [ 'link' => '', 'label' => __('Topology maps') ], + * [ 'link' => '', 'label' => __('Visual console') ], + * ] + * ); + * ``` + * + * @return string If apply + */ +function ui_print_standard_header( + string $title, + string $icon='', + bool $return=false, + string $help='', + bool $godmode=false, + array $options=[], + array $breadcrumbs=[] +) { + // Create the breadcrumb. + $headerInformation = new HTML(); + $headerInformation->setBreadcrum([]); + // Prepare the breadcrumbs. + $countBreadcrumbs = count($breadcrumbs); + $countUnitBreadcrumb = 0; + $applyBreadcrumbs = []; + foreach ($breadcrumbs as $unitBreadcrumb) { + // Count new breadcrumb. + $countUnitBreadcrumb++; + // Apply selected if is the last. + $unitBreadcrumb['selected'] = ($countBreadcrumbs === $countUnitBreadcrumb); + // Apply for another breadcrumb. + $applyBreadcrumbs[] = $unitBreadcrumb; + } + + // Attach breadcrumbs. + $headerInformation->prepareBreadcrum( + $applyBreadcrumbs, + true + ); + // Create the header. + $output = ui_print_page_header( + $title, + $icon, + true, + $help, + $godmode, + $options, + false, + '', + GENERIC_SIZE_TEXT, + '', + $headerInformation->printHeader(true) + ); + + if ($return !== true) { + echo $output; + } else { + return $output; + } +} + + /** * Return a standard page header (Pandora FMS 3.1 version) * diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 063613b1c0..3b48e5f919 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8512,6 +8512,11 @@ div.stat-win-spinner img { margin-left: 20px; } +.btn_update_online_open { + float: right; + margin-bottom: 20px; +} + .align-left-important { text-align: left !important; } diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index f5e971c065..09393879ba 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1019,3 +1019,11 @@ li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab { margin: 20px auto; border-radius: 3px; } + +table.alternate tr:nth-child(2n + 1) td { + background-color: #222; +} + +table.alternate tr:nth-child(2n) td { + background-color: #111; +} diff --git a/pandora_console/install.php b/pandora_console/install.php index ad0f399c50..b423e99b20 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
'', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); } else { ui_meta_print_header(__('Alerts view')); diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 73aaa601ff..377cff3d4d 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -1,17 +1,32 @@ $setuptab]; } -ui_print_page_header( +// Header. +ui_print_standard_header( __('Agent detail'), 'images/agent.png', false, '', false, - $onheader + $onheader, + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); if (!$strict_user) { diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index 61dfda1a22..000931ff6b 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -1,16 +1,32 @@ '; } else { // $updated_info = __("Updated at realtime"); - $updated_info = ''; + $updated_info = ''; } // Header. -ui_print_page_header( +ui_print_standard_header( __('Group view'), 'images/group.png', false, '', false, - $updated_time + (array) $updated_time, + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); $total_agentes = 0; diff --git a/pandora_console/operation/agentes/interface_view.php b/pandora_console/operation/agentes/interface_view.php index a24788edd0..4f20c459f3 100644 --- a/pandora_console/operation/agentes/interface_view.php +++ b/pandora_console/operation/agentes/interface_view.php @@ -1,18 +1,32 @@ '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); } diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index 8f735e72de..5eccda04f8 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -1,9 +1,8 @@ '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Networkmap'), + ], + ] ); $id_snmp_l2_recon = db_get_value( diff --git a/pandora_console/operation/agentes/pandora_networkmap.php b/pandora_console/operation/agentes/pandora_networkmap.php index 8c8c5ec087..c960a333aa 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.php +++ b/pandora_console/operation/agentes/pandora_networkmap.php @@ -1,15 +1,32 @@ '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Networkmap'), + ], + ] ); echo $result_txt; diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index a6811c1856..f7d3c7ea30 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1,17 +1,32 @@ '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); if ($section == 'fields') { diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index d7f668597e..d82a749a85 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -1,17 +1,32 @@ '; } else { // $updated_info = __("Updated at realtime"); - $updated_info = ''; + $updated_info = ''; } // Header. -ui_print_page_header( +ui_print_standard_header( __('Tactical view'), '', false, '', false, - $updated_time + (array) $updated_time, + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ] ); // Currently this function makes loading this page is impossible. Change diff --git a/pandora_console/operation/dashboard/dashboard.php b/pandora_console/operation/dashboard/dashboard.php index a3379565b7..348b365e9f 100644 --- a/pandora_console/operation/dashboard/dashboard.php +++ b/pandora_console/operation/dashboard/dashboard.php @@ -1,7 +1,6 @@ $value) { $table->data[$i][0] = '#'.$array_get_incidents[$key][0]; $table->data[$i][1] = ''; - $table->data[$i][1] .= $array_get_incidents[$key][3]; + $table->data[$i][1] .= ui_print_truncate_text($array_get_incidents[$key][3], 160, false); $table->data[$i][1] .= ''; $table->data[$i][2] = $group_incident[$array_get_incidents[$key][8]]; $table->data[$i][3] = $status_incident[$array_get_incidents[$key][6]].' / '.$resolution_incident[$array_get_incidents[$key][12]]; diff --git a/pandora_console/operation/messages/message_edit.php b/pandora_console/operation/messages/message_edit.php index c2ce7529ec..b1748a6736 100644 --- a/pandora_console/operation/messages/message_edit.php +++ b/pandora_console/operation/messages/message_edit.php @@ -1,6 +1,6 @@ '', + 'label' => __('Workspace'), + ], + [ + 'link' => '', + 'label' => __('Messages'), + ], + ] ); // Read a message. @@ -381,4 +391,4 @@ html_print_div( ); echo ''; -echo $jsOutput; \ No newline at end of file +echo $jsOutput; diff --git a/pandora_console/operation/messages/message_list.php b/pandora_console/operation/messages/message_list.php index 9b25b9da9c..fe96a811a5 100644 --- a/pandora_console/operation/messages/message_list.php +++ b/pandora_console/operation/messages/message_list.php @@ -1,9 +1,8 @@ $active_list, @@ -67,14 +67,25 @@ $buttons['create_message'] = [ ).'', ]; -if (!is_ajax()) { - ui_print_page_header( - __('Messages'), +if (is_ajax() === false) { + // Header. + ui_print_standard_header( + $tabSelectedMessage, 'images/email_mc.png', false, '', false, - $buttons + $buttons, + [ + [ + 'link' => '', + 'label' => __('Workspace'), + ], + [ + 'link' => '', + 'label' => __('Messages'), + ], + ] ); } @@ -86,7 +97,7 @@ if ($mark_unread) { if ($delete_msg) { $id = (int) get_parameter('id'); - if ($show_sent) { + if ($show_sent === true) { $result = messages_delete_message_sent($id); } else { $result = messages_delete_message($id); @@ -104,7 +115,7 @@ if ($multiple_delete) { $ids = (array) get_parameter('delete_multiple_messages', []); foreach ($ids as $id) { - if ($show_sent) { + if ($show_sent === true) { $result = messages_delete_message_sent($id); } else { $result = messages_delete_message($id); @@ -122,7 +133,7 @@ if ($multiple_delete) { ); } -if ($show_sent) { +if ($show_sent === true) { // Sent view. $num_messages = messages_get_count_sent($config['id_user']); if ($num_messages > 0 && !is_ajax()) { @@ -142,7 +153,7 @@ if ($show_sent) { } } -if (empty($messages)) { +if (empty($messages) === true) { ui_print_info_message( [ 'no_close' => true, @@ -175,7 +186,7 @@ if (empty($messages)) { $table->head[5] = html_print_checkbox('all_delete_messages', 0, false, true, false); $table->head[0] = __('Status'); - if ($show_sent) { + if ($show_sent === true) { $table->head[1] = __('Destination'); } else { $table->head[1] = __('Sender'); @@ -194,7 +205,7 @@ if (empty($messages)) { $data[0] = ''; if ($message['read'] == 1) { - if ($show_sent) { + if ($show_sent === true) { $data[0] .= ''; $data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Click to read'), 'class' => 'invert_filter']); $data[0] .= ''; @@ -204,7 +215,7 @@ if (empty($messages)) { $data[0] .= ''; } } else { - if ($show_sent) { + if ($show_sent === true) { $data[0] .= ''; $data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Message unread - click to read'), 'class' => 'invert_filter']); $data[0] .= ''; @@ -215,7 +226,7 @@ if (empty($messages)) { } } - if ($show_sent) { + if ($show_sent === true) { $dest_user = get_user_fullname($message['dest']); if (!$dest_user) { $dest_user = $message['dest']; @@ -231,7 +242,7 @@ if (empty($messages)) { $data[1] = $orig_user; } - if ($show_sent) { + if ($show_sent === true) { $data[2] = ''; } else { $data[2] = ''; @@ -252,7 +263,7 @@ if (empty($messages)) { ); $table->cellclass[][4] = 'action_buttons'; - if ($show_sent) { + if ($show_sent === true) { $data[4] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).''; } else { @@ -264,8 +275,8 @@ if (empty($messages)) { } } -if (!empty($messages)) { - if ($show_sent) { +if (empty($messages) === false) { + if ($show_sent === true) { echo '
'; } else { echo ''; diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 7dfecce0b9..34f3b7819c 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -173,16 +173,24 @@ if (is_metaconsole()) { // Print header ui_meta_print_header(__('Reporting'), '', $options); } else { - ui_print_page_header( + // Header. + ui_print_standard_header( reporting_get_name($id_report), 'images/op_reporting.png', false, '', false, $options, - false, - '', - 55 + [ + [ + 'link' => '', + 'label' => __('Reporting'), + ], + [ + 'link' => '', + 'label' => __('Custom reports'), + ], + ] ); } diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index dc2b373e82..39451616e7 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -1,9 +1,8 @@ '; } -ui_print_page_header( +// Header. +ui_print_standard_header( __('SNMP Browser'), 'images/op_snmp.png', false, 'snmp_browser_view', false, - [$link] + [$link], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('SMNP'), + ], + ] ); // SNMP tree container. diff --git a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php index 8b21420fb0..53bc811268 100644 --- a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php +++ b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php @@ -1,17 +1,32 @@ '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('SMNP'), + ], + ] +); + if (isset($config['filemanager']['message'])) { echo $config['filemanager']['message']; diff --git a/pandora_console/operation/snmpconsole/snmp_statistics.php b/pandora_console/operation/snmpconsole/snmp_statistics.php index a240c7d6a6..ca1a3ce6e7 100755 --- a/pandora_console/operation/snmpconsole/snmp_statistics.php +++ b/pandora_console/operation/snmpconsole/snmp_statistics.php @@ -81,8 +81,8 @@ $statistics['text'] = ''; $options['view']['active'] = true; -if (!is_metaconsole()) { +if (is_metaconsole() === false) { if (!$config['pure']) { $options['pure']['text'] = ''.html_print_image( 'images/full_screen.png', @@ -208,13 +208,25 @@ if (!is_metaconsole()) { 'class' => 'invert_filter', ] ).''; - ui_print_page_header( + + // Header. + ui_print_standard_header( $visualConsoleName, 'images/visual_console.png', false, 'visual_console_view', false, - $options + $options, + [ + [ + 'link' => '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Visual console'), + ], + ] ); } @@ -465,7 +477,7 @@ if ($pure === true) { // Check groups can access user. $aclUserGroups = []; -if (!users_can_manage_group_all('AR')) { +if (users_can_manage_group_all('AR') === false) { $aclUserGroups = array_keys(users_get_groups(false, 'AR')); } diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index ae26406065..86e48653f6 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210527 +%define release 210528 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 7b344e9745..e5dcbf63ce 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210527 +%define release 210528 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 8f9f40c163..38ea611d43 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210527 +%define release 210528 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_plugins/message_app_connectors/.vscode/settings.json b/pandora_plugins/message_app_connectors/.vscode/settings.json deleted file mode 100644 index cf160325ad..0000000000 --- a/pandora_plugins/message_app_connectors/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.pythonPath": "slack/venv/bin/python" -} diff --git a/pandora_plugins/message_app_connectors/discord/pandora_discord_cli.py b/pandora_plugins/message_app_connectors/discord/pandora_discord_cli.py index 5a278a0e6b..522f5fb75e 100644 --- a/pandora_plugins/message_app_connectors/discord/pandora_discord_cli.py +++ b/pandora_plugins/message_app_connectors/discord/pandora_discord_cli.py @@ -21,7 +21,7 @@ parser.add_argument('--author_icon_url', help='Alert custom author icon url ', d parser.add_argument('--thumb', help='Custom thumbnail url', default='') parser.add_argument('--api_conf', help='Api configuration parameters in coma separate keypairs. EX "user=admin,pass=pandora,api_pass=1234,api_url=http://test.artica.es/pandora_console/include/api.php"') parser.add_argument('--module_graph', help='Uses pandora API to generate a module graph and attach it to the alert needs module_id and interval parameters in coma separate keypairs. EX "module_id=55,interval=3600"') -parser.add_argument('--tmp_dir', help='Temporary path to store grph images', default='/tmp') +parser.add_argument('--tmp_dir', help='Temporary path to store graph images', default='/tmp') args = parser.parse_args() @@ -50,15 +50,15 @@ def parse_api_conf(cConf): apid = parse_dic(cConf) if apid.get("user") is None: - print ("Error no user defined in api_conf keypairs, skiping graph generation.") + print ("Error no user defined in api_conf keypairs, skipping graph generation.") return if apid.get("pass") is None: - print ("Error no password defined in api_conf keypairs, skiping graph generation.") + print ("Error no password defined in api_conf keypairs, skipping graph generation.") return if apid.get("api_pass") is None: - print ("Error no Api pass defined in api_conf keypairs, skiping graph generation.") + print ("Error no Api pass defined in api_conf keypairs, skipping graph generation.") return if apid.get("api_url") is None: @@ -78,7 +78,7 @@ def parse_graph_conf(cGraph): # Parse Api config graphd = parse_dic(cGraph) if graphd.get("module_id") is None: - print ("error no module_id defined in module_graph keypairs, skiping graph generation.") + print ("error no module_id defined in module_graph keypairs, skipping graph generation.") return if graphd.get("interval") is None: @@ -91,19 +91,19 @@ def parse_graph_conf(cGraph): def get_graph_by_moduleid (baseUrl,pUser, pPass, apiPass, moduleId, graphInterval) : sep="url_encode_separator_%7C" try: - url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}C&apipass={apiPass}&api=1&user={pUser}&pass={pPass}" + url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}&apipass={apiPass}&api=1&user={pUser}&pass={pPass}" graph = requests.get(url) if graph.status_code != 200: - print (f"Error requested api url, status code: {graph.status_code}. Skiping graph generation") + print (f"Error requested api url, status code: {graph.status_code}. skipping graph generation") return None if graph.text == "auth error": - print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation") + print (f"Error requested Pandora api url, status code: {graph.text}. skipping graph generation") return None if graph.text == "Id does not exist in database.": - print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation") + print (f"Error requested Pandora api url, status code: {graph.text}. skipping graph generation") return None except: - print("Error requested api url. Skiping graph generation") + print("Error requested api url. skipping graph generation") return None return graph diff --git a/pandora_plugins/message_app_connectors/gchat/pandora-gchat-cli.py b/pandora_plugins/message_app_connectors/gchat/pandora-gchat-cli.py index 5e2a47b3f8..4584768ec7 100644 --- a/pandora_plugins/message_app_connectors/gchat/pandora-gchat-cli.py +++ b/pandora_plugins/message_app_connectors/gchat/pandora-gchat-cli.py @@ -88,9 +88,9 @@ def sendMessage(url, message): header = {'Content-Type': 'application/json; charset: UTF-8'} response = requests.post(url, headers=header, data=message) - print(f"Mesage sent succefuly: {response.status_code}") + print(f"Message sent successfully: {response.status_code}") except: - print("Error requested api url. Skiping graph generation") + print("Error requested api url. skipping graph generation") return None return response diff --git a/pandora_plugins/message_app_connectors/slack/pandora-slack-cli.py b/pandora_plugins/message_app_connectors/slack/pandora-slack-cli.py index 31cfa97811..b09938b885 100644 --- a/pandora_plugins/message_app_connectors/slack/pandora-slack-cli.py +++ b/pandora_plugins/message_app_connectors/slack/pandora-slack-cli.py @@ -21,7 +21,7 @@ parser.add_argument('-D', '--desc', help='Slack description message', default='' parser.add_argument('-F','--footer', help='Custom footer, default: PandoraFMS', default='PandoraFMS') parser.add_argument('--api_conf', help='Api configuration parameters in coma separate keypairs. EX "user=admin,pass=pandora,api_pass=1234,api_url=http://test.artica.es/pandora_console/include/api.php"') parser.add_argument('--module_graph', help='Uses pandora API to generate a module graph and attach it to the alert needs module_id and interval parameters in coma separate keypairs. EX "module_id=55,interval=3600"') -parser.add_argument('--tmp_dir', help='Temporary path to store grph images', default='/tmp') +parser.add_argument('--tmp_dir', help='Temporary path to store graph images', default='/tmp') args = parser.parse_args() filename = None @@ -49,22 +49,22 @@ def compose_message (values, tittle, emoji, message, footer): return m def parse_api_conf(cConf): - """Check apiconfiguration parameters """ + """Check api configuration parameters """ if args.api_conf : # Parse Api config print ("Api config enable") apid = parse_dic(cConf) if apid.get("user") is None: - print ("Warning. no user defined in api_conf keypairs, skiping graph generation.") + print ("Warning. no user defined in api_conf keypairs, skipping graph generation.") return None if apid.get("pass") is None: - print ("Warning. no password defined in api_conf keypairs, skiping graph generation.") + print ("Warning. no password defined in api_conf keypairs, skipping graph generation.") return None if apid.get("api_pass") is None: - print ("Warning. no api pass defined in api_conf keypairs, skiping graph generation.") + print ("Warning. no api pass defined in api_conf keypairs, skipping graph generation.") return None if apid.get("api_url") is None: @@ -81,7 +81,7 @@ def parse_graph_conf(cGraph): # Parse Api config graphd = parse_dic(cGraph) if graphd.get("module_id") is None: - print ("Warning. no module_id defined in module_graph keypairs, skiping graph generation.") + print ("Warning. no module_id defined in module_graph keypairs, skipping graph generation.") return if graphd.get("interval") is None: @@ -89,26 +89,26 @@ def parse_graph_conf(cGraph): return graphd else: - print("Warning. no module_graph keypairs defined, skiping graph generation") + print("Warning. no module_graph keypairs defined, skipping graph generation") return None def get_graph_by_moduleid (baseUrl,pUser, pPass, apiPass, moduleId, graphInterval, sep="url_encode_separator_%7C") : """Call Pandorafms api to get graph""" try: - url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}C&apipass={apiPass}&api=1&user={pUser}&pass={pPass}" + url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}&apipass={apiPass}&api=1&user={pUser}&pass={pPass}" graph = requests.get(url) if graph.status_code != 200: - print (f"Error requested api url, status code: {graph.status_code}. Skiping graph generation") + print (f"Error requested api url, status code: {graph.status_code}. skipping graph generation") return None if graph.text == "auth error": - print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation") + print (f"Error requested Pandora api url, status code: {graph.text}. skipping graph generation") return None if graph.text == "Id does not exist in database.": - print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation") + print (f"Error requested Pandora api url, status code: {graph.text}. skipping graph generation") return None except: - print("Error requested api url. Skiping graph generation") + print("Error requested api url. skipping graph generation") return None return graph @@ -166,7 +166,7 @@ if args.api_conf : else: filename = None # Send message -send_message(messageString, args.channel, client, "> Mesage sent succefuly") +send_message(messageString, args.channel, client, "> Message sent successfully") if filename is not None: if os.path.isfile(filename): send_image(filename, args.channel, client) if args.footer: send_message(args.footer, args.channel, client) diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index dcd18d1004..abc97a4a1f 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210527 +Version: 7.0NG.754-210528 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 861dcea8df..338f41f060 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210527" +pandora_version="7.0NG.754-210528" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index a270cb9d34..85c2fd20f8 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210527"; +my $pandora_build = "210528"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index e54ad48fe6..ba539d94e6 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210527"; +my $pandora_build = "210528"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index a72bdc6256..e0c3bd5aab 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.754 -%define release 210527 +%define release 210528 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 12c3a8577b..1597fac0db 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.754 -%define release 210527 +%define release 210528 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3ac49eb4ad..d896afab15 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210527" +PI_BUILD="210528" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a8a231fbb3..32ff1f6268 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 Build 210527"; +my $version = "7.0NG.754 Build 210528"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f5ac53a2d9..ab5f85af33 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.754 Build 210527"; +my $version = "7.0NG.754 Build 210528"; # save program name for logging my $progname = basename($0);
'.alerts_get_alert_action_name($action['alert_type']).' '.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).' '.html_print_image( + 'images/cross.png', + true, + [ + 'border' => '0', + 'alt' => __('Delete'), + ] + ).'