'; $sec = (string) get_parameter('sec'); $sec2 = (string) get_parameter('sec2'); if ($sec2 === 'operation/agentes/ver_agente') { $sec2 = 'operation/agentes/estado_agente'; } else if ($sec2 === 'godmode/alerts/configure_alert_template') { $sec2 = 'godmode/alerts/alert_templates'; } else if ($sec2 === 'godmode/alerts/configure_alert_action') { $sec2 = 'godmode/alerts/alert_actions'; } else if ($sec2 === 'godmode/alerts/configure_alert_command') { $sec2 = 'godmode/alerts/alert_commands'; } else if ($sec2 === 'enterprise/godmode/setup/edit_skin') { $sec2 = 'enterprise/godmode/setup/setup_skins'; } else if ($sec2 === 'operation/agentes/networkmap.dinamic') { $sec2 = 'operation/agentes/pandora_networkmap'; } else if ($sec2 === 'godmode/gis_maps/configure_gis_map') { $map_id = (string) get_parameter('map_id'); if (empty($map_id) === false) { $sec2 = 'operation/gis_maps/render_view&map_id='.$map_id; } else { $sec2 = 'operation/gis_maps/gis_map'; } } else if ($sec2 === 'enterprise/godmode/servers/manage_export_form') { $sec2 = 'enterprise/godmode/servers/manage_export'; } else if ($sec2 === 'godmode/setup/gis_step_2') { $sec2 = 'godmode/setup/setup§ion=gis'; } else if ($sec2 === 'enterprise/godmode/agentes/agent_autoconfiguration.definition') { $sec2 = 'enterprise/godmode/agentes/agent_autoconfiguration'; } else if ($sec2 === 'enterprise/godmode/reporting/graph_template_list') { $sec2 = 'godmode/reporting/graphs'; } else if ($sec2 === 'enterprise/godmode/reporting/graph_template_wizard') { $sec2 = 'godmode/reporting/graphs'; } else if ($sec2 === 'godmode/reporting/graph_container') { $sec2 = 'godmode/reporting/graphs'; } else if ($sec2 === 'operation/gis_maps/render_view') { $map_id = (int) get_parameter('map_id'); if (empty($map_id) === false) { $sec2 .= '&map_id='.$map_id; } } else if ($sec2 === 'godmode/servers/discovery') { $wiz = (string) get_parameter('wiz'); $sec2 = 'godmode/servers/discovery&wiz='.$wiz; $mode = (string) get_parameter('mode', ''); if (empty($mode) === false) { $sec2 .= '&mode='.$mode; } } else if ($sec2 === 'godmode/groups/group_list') { $tab = (string) get_parameter('tab'); if ($tab === 'credbox') { $sec2 = 'godmode/groups/group_list&tab='.$tab; } } else if ($sec2 === 'godmode/setup/setup') { $section = (string) get_parameter('section'); $sec2 = 'godmode/setup/setup§ion='.$section; } else if ($sec2 === 'godmode/massive/massive_operations') { $tab = (string) get_parameter('tab'); $sec2 = 'godmode/massive/massive_operations&tab='.$tab; } else if ($sec2 === 'godmode/events/events') { $section = (string) get_parameter('section'); $sec2 = 'godmode/events/events§ion='.$section; } else if ($sec2 === 'operation/dashboard/dashboard') { $id = (int) get_parameter('dashboardId', 0); if (empty($id) === false) { $sec2 = 'operation/dashboard/dashboard&dashboardId='.$id; } } else if ($sec2 === 'enterprise/operation/services/services') { $tab = (string) get_parameter('tab', ''); $action = (string) get_parameter('action', ''); $id_service = (int) get_parameter('id_service', 0); if (empty($tab) === false && empty($action) === false && empty($id_service) === false ) { $sec2 = sprintf( 'enterprise/operation/services/services&tab=%s&action=%s&id_service=%d', $tab, $action, $id_service ); } } else if ($sec2 === 'operation/visual_console/render_view') { $id = (int) get_parameter('id', 0); if (empty($id) === false) { $sec2 = 'operation/visual_console/render_view&id='.$id; } } else if ($sec2 === 'operation/messages/message_edit') { $new_msg = (int) get_parameter('new_msg', 0); if (empty($new_msg) === false) { $sec2 = 'operation/messages/message_edit&new_msg='.$new_msg; } } else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite' || $sec2 === 'enterprise/godmode/servers/manage_credential_boxes' ) { $sec2 = 'enterprise/godmode/servers/list_satellite'; } else if ($sec2 === 'operation/ITSM/itsm') { $sec2 = (string) get_parameter('sec2'); $operation = (string) get_parameter('operation', ''); if (empty($operation) === false) { $sec2 = $sec2.'&operation='.$operation; } } else if ($sec2 === 'godmode/users/configure_user') { $sec2 = 'godmode/users/user_list'; } else if ($sec2 === 'godmode/modules/manage_inventory_modules_form') { $sec2 = 'godmode/modules/manage_inventory_modules'; } else if ($sec2 === 'godmode/groups/configure_group') { $sec2 = 'godmode/groups/group_list'; } else if ($sec2 === 'godmode/users/configure_profile') { $sec2 = 'godmode/users/profile_list'; } else { $sec2 = (string) get_parameter('sec2'); } $menu_selected = false; $allsec2 = explode('sec2=', $_SERVER['REQUEST_URI']); if (isset($allsec2[1]) === true) { $allsec2 = $allsec2[1]; } else { $allsec2 = $sec2; } // Open list of menu. echo '
'; // Invisible UL for adding border-top. echo ''; } /** * Get all the data structure of menu. Operation and Godmode * * @return array Menu structure. */ function menu_get_full_sec() { global $menu_operation; global $menu_godmode; if ($menu_godmode == null || $menu_operation == null) { return []; } else { $menu = ($menu_operation + $menu_godmode); } unset($menu['class']); menu_add_extras($menu); return $menu; } /** * Build an extra access pages array and merge it with menu * * @param menu array (pass by reference) */ function menu_add_extras(&$menu) { global $config; $menu_extra = []; $menu_extra['gusuarios']['sub']['godmode/users/configure_user']['text'] = __('Configure user'); $menu_extra['gusuarios']['sub']['godmode/users/configure_profile']['text'] = __('Configure profile'); $menu_extra['gmodules']['sub']['godmode/modules/manage_network_templates_form']['text'] = __('Module templates management'); $menu_extra['gmodules']['sub']['godmode/modules/manage_inventory_modules_form']['text'] = __('Inventory modules management'); $menu_extra['gagente']['sub']['godmode/agentes/configurar_agente']['text'] = __('Agents management'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_template']['text'] = __('Configure alert template'); $menu_extra['network']['sub']['operation/visual_console/render_view']['text'] = __('View visual console'); $menu_extra['network']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Builder visual console'); $menu_extra['reporting']['sub']['operation/reporting/reporting_viewer']['text'] = __('View reporting'); $menu_extra['reporting']['sub']['operation/reporting/graph_viewer']['text'] = __('Graph viewer'); $menu_extra['reporting']['sub']['godmode/reporting/graph_builder']['text'] = __('Manage custom graphs'); $menu_extra['reporting']['sub']['godmode/reporting/graph_container']['text'] = __('View graph containers'); $menu_extra['reporting']['sub']['godmode/reporting/create_container']['text'] = __('Manage graph containers'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_list']['text'] = __('View graph templates'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_editor']['text'] = __('Manage graph templates'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_item_editor']['text'] = __('Graph template items'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_wizard']['text'] = __('Graph template wizard'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard&action=wizard']['text'] = __('Templates wizard'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=template&action=list_template']['text'] = __('Templates'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&action=new']['text'] = __('New custom reports'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&action=edit']['text'] = __('Edit custom reports'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&action=delete_report']['text'] = __('Remove custom reports'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=list_items&action=edit']['text'] = __('List items'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=item_editor&action=new']['text'] = __('Edit item'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard&action=edit']['text'] = __('Wizard'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard_sla&action=edit']['text'] = __('Wizard sla'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=global&action=edit']['text'] = __('Global custom reports'); $menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=advanced&action=edit']['text'] = __('Avanced options'); if ($config['activate_gis']) { $menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps'); } $menu_extra['workspace']['sub']['operation/messages/message_edit']['text'] = __('Manage messages'); $menu_extra['gagente']['sub']['godmode/groups/configure_modu_group']['text'] = __('Manage module groups'); $menu_extra['gagente']['sub']['godmode/agentes/configure_field']['text'] = __('Manage custom field'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_action']['text'] = __('Manage alert actions'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_command']['text'] = __('Manage commands'); $menu_extra['gservers']['sub']['enterprise/godmode/servers/manage_export_form']['text'] = __('Manage export targets'); $menu_extra['estado']['sub']['snmpconsole']['sub2']['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator'); $menu_extra['estado']['sub']['snmpconsole']['sub2']['operation/snmpconsole/snmp_view']['text'] = __('SNMP console'); $menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident'); $menu_extra['gusuarios']['sub']['godmode/groups/configure_group']['text'] = __('Manage groups'); $menu_extra['gusuarios']['sub']['godmode/tag/edit_tag']['text'] = __('Tags management'); // Duplicate extensions as sec=extension to check it from url. foreach ($menu as $k => $m) { if (!isset($m['sub'])) { continue; } foreach ($m['sub'] as $kk => $mm) { if (isset($mm['sec'])) { if (empty($menu[$mm['sec']]['sub'][$kk]['text']) === true) { $menu_extra[$mm['sec']]['sub'][$kk]['text'] = $mm['text']; } } } } $menu = array_merge_recursive($menu, $menu_extra); // Remove the duplicate the text entries. foreach ($menu as $k => $m) { if (!empty($m['text'])) { if (is_array($m['text'])) { $menu[$k]['text'] = reset($m['text']); } } } } /** * Get the sec list built in menu * * @param bool If true, the array returned will have the structure * to combo categories (optgroup) * * @return array Sections list */ function menu_get_sec($with_categories=false) { $menu = menu_get_full_sec(); unset($menu['class']); $in_godmode = false; foreach ($menu as $k => $v) { if ($with_categories) { if (!$in_godmode && $k[0] == 'g') { // Hack to dont confuse with gis activated because godmode // sec starts with g (like gismaps). if ($k != 'gismaps') { $in_godmode = true; } } if ($k === 'discovery') { $in_godmode = true; } if ($in_godmode) { $category = __('Administration'); } else { $category = __('Operation'); } $sec_array[$k]['optgroup'] = $category; $sec_array[$k]['name'] = $v['text']; } else { $sec_array[$k] = $v['text']; } } return $sec_array; } /** * Get the sec list built in menu * * @param bool If true, the array returned will have the structure * to combo categories (optgroup) * * @return array Sections list */ function get_sec($sec=false) { $menu = menu_get_full_sec(); unset($menu['class']); $in_godmode = false; foreach ($menu as $k => $v) { if (isset($v['sub'][$sec])) { return $k; } } return false; } /** * Get the pages in a section * * @param string sec code * @param string menu hash. All the menu structure (For example * returned by menu_get_full_sec(), json encoded and after that * base64 encoded. If this value is false this data is obtained from * menu_get_full_sec(); * * @return array Sections list */ function menu_get_sec_pages($sec, $menu_hash=false) { if (!$menu_hash) { $menu = menu_get_full_sec(); } else { $menu = json_decode(base64_decode($menu_hash), true); } $sec2_array = []; if (isset($sec)) { // Get the sec2 of the main section. $sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text']; // Get the sec2 of the subsections. foreach ($menu[$sec]['sub'] as $k => $v) { // Avoid special cases of standalone windows. if (preg_match('/^javascript:/', $k) || preg_match('/\.php/', $k)) { if ($sec !== 'links' && $sec !== 'eventos') { continue; } } $sec2_array[$k] = $v['text']; } } $sec2_array = array_unique($sec2_array); return $sec2_array; } /** * Get the pages in a section2 * $menu * * @param string sec code * @param string menu hash. All the menu structure (For example * returned by menu_get_full_sec(), json encoded and after that * base64 encoded. If this value is false this data is obtained from * menu_get_full_sec(); * * @return array Sections list */ function menu_get_sec2_pages($sec, $sec2, $menu_hash=false) { if ($menu_hash === false) { $menu = menu_get_full_sec(); } else { $menu = json_decode(base64_decode($menu_hash), true); } $sec3_array = []; $sec2 = io_safe_output($sec2); if (isset($menu[$sec]['sub']) && isset($menu[$sec]['sub'][$sec2]['sub2'])) { // Get the sec2 of the subsections. foreach ($menu[$sec]['sub'][$sec2]['sub2'] as $k => $v) { $sec3_array[$k] = $v['text']; } } return $sec3_array; } /** * Check if a page (sec2) is in a section (sec) * * @param string section (sec) code * @param string page (sec2)code * * @return true if the page is in section, false otherwise */ function menu_sec2_in_sec($sec, $sec2) { $sec2_array = menu_get_sec_pages($sec); if ($sec2_array != null && in_array($sec2, array_keys($sec2_array))) { return true; } return false; } function menu_sec3_in_sec2($sec, $sec2, $sec3) { $sec3_array = menu_get_sec2_pages($sec, $sec2, $menu_hash = false); if ($sec3_array != null && in_array($sec3, array_keys($sec3_array))) { return true; } return false; } /** * Prepare menu data for enterprise acl conf. * * @param array $pages * @param string $sec * @return string $pages */ function menu_pepare_acl_select_data($pages, $sec) { $exclude_pages = [ 'estado' => 'operation/agentes/tactical', 'network' => 'operation/agentes/networkmap_list', 'extensions' => [ 'operation/extensions', 'enterprise/extensions/vmware', 'extensions/users_connected', ], 'gmodules' => 'godmode/modules/manage_network_templates', 'geventos' => 'godmode/events/events§ion=filter', 'gsetup' => 'godmode/setup/setup§ion=general', ]; foreach ($exclude_pages as $exclude_sec => $sec2) { if ($sec === $exclude_sec) { if (is_array($sec2) === true) { foreach ($sec2 as $value) { unset($pages[$value]); } } unset($pages[$sec2]); } } return $pages; } if (is_ajax()) { $about = (bool) get_parameter('about'); $about_operation = (bool) get_parameter('about_operation'); $why_enterprise = (bool) get_parameter('why_enterprise'); if ($about) { global $config; global $pandora_version; global $build_version; $product_name = io_safe_output(get_product_name()); $license_expiry_date = substr($config['license_expiry_date'], 0, 4).'/'.substr($config['license_expiry_date'], 4, 2).'/'.substr($config['license_expiry_date'], 6, 2); $license_expired = false; $timestamp = strtotime($license_expiry_date); if ($timestamp < time() || enterprise_installed() === false) { $license_expired = true; } include_once $config['homedir'].'/include/class/Diagnostics.class.php'; $d = new Diagnostics; $db_health = json_decode($d->getDatabaseHealthStatus()); $db_info = json_decode($d->getDatabaseStatusInfo()); $db_fragmentation = json_decode($d->getTablesFragmentation()); $sys_info = json_decode($d->getSystemInfo()); $php_sys = json_decode($d->getPHPSetup()); $system_date = json_decode($d->getSystemDate()); $lts_name = ''; if (empty($config['lts_name']) === false) { $lts_name = ' '.$config['lts_name'].''; } $fragmentation_status = ''; if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) { $fragmentation_status = html_print_image( 'images/validate.svg', true, [ 'title' => __('Successfully'), 'style' => 'width:15px;', ] ); } else { $fragmentation_status = html_print_image( 'images/fail@svg.svg', true, [ 'title' => __('Error'), 'style' => 'width:15px;', ] ); } $image_about = ui_get_full_url('/images/custom_logo/logo-default-pandorafms-collapsed.svg', false, false, false); $dialog = '
'.$product_name.''.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').' '.__('Current package').' '.$config['current_package'].' '.__('MR version').' MR'.$config['MR'].' Build'.$build_version.' '; if (enterprise_installed() === true) { $dialog .= ''.__('Support expires').''.$license_expiry_date.' '; } if ($license_expired === false) { $dialog .= ''.__('This system has official support, warranty and official updates.').' '; } else if (enterprise_installed() === true) { $dialog .= ''.__('This system has no active support contract, and has no support, upgrades or warranty.').' '; $dialog .= ''.__('Contact Pandora FMS for expand your support contract.').' '; } else { $dialog .= ''.__('The OpenSource version has no support or warranty of any kind.').' '; $dialog .= ''.__('Contact Pandora FMS for official support contract.').' '; } if (((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) && (is_metaconsole() === false)) { $dialogButtons = []; $dialogButtons[] = html_print_button( __('Warp update'), 'update_manager', false, 'location.href="'.ui_get_full_url('/index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=history', false, false, false).'"', [ 'icon' => 'cog', 'mode' => 'secondary', ], true ); $dialogButtons[] = html_print_button( __('System report'), 'system_report', false, 'location.href="'.ui_get_full_url('/index.php?sec=gextensions&sec2=tools/diagnostics', false, false, false).'"', [ 'icon' => 'info', 'mode' => 'secondary', ], true ); $dialog .= html_print_div( [ 'style' => 'flex-direction: row;', 'class' => 'action-buttons', 'content' => implode('', $dialogButtons), ], true ); } $dialog .= ' |
---|
Trademark and copyright 2004 - '.date('Y').' Pandora FMS. All rights reserved
- '.__('Database health status').' |
|
---|---|
'.$db_health->data->unknownAgents->name.' |
'.$db_health->data->unknownAgents->value.' |
'.$db_health->data->notInitAgents->name.' |
'.$db_health->data->notInitAgents->value.' |
'.$db_health->data->pandoraDbLastRun->name.' |
'.$db_health->data->pandoraDbLastRun->value.' |
- '.__('Database status info').' |
|
'.$db_info->data->dbSchemeFirstVersion->name.' |
'.$db_info->data->dbSchemeFirstVersion->value.' |
'.$db_info->data->dbSchemeVersion->name.' |
'.$db_info->data->dbSchemeVersion->value.' |
'.$db_info->data->dbSchemeBuild->name.' |
'.$db_info->data->dbSchemeBuild->value.' |
'.$db_info->data->dbVersion->name.' |
'.$db_info->data->dbVersion->value.' |
- '.__('Tables fragmentation in the %s database', $product_name).' |
|
'.$db_fragmentation->data->tablesFragmentationMax->name.' |
'.$db_fragmentation->data->tablesFragmentationMax->value.' |
'.$db_fragmentation->data->tablesFragmentationValue->name.' |
'.$db_fragmentation->data->tablesFragmentationValue->value.' |
'.$db_fragmentation->data->tablesFragmentationStatus->name.' |
'.$fragmentation_status.' |
- '.__('System Info').' |
|
---|---|
'.$sys_info->data->cpuInfo->name.' |
'.$sys_info->data->cpuInfo->value.' |
'.$sys_info->data->ramInfo->name.' |
'.$sys_info->data->ramInfo->value.' |
'.$sys_info->data->distroInfo->name.' |
'.$sys_info->data->distroInfo->value.' |
'.$sys_info->data->osInfo->name.' |
'.$sys_info->data->osInfo->value.' |
'.$sys_info->data->hostnameInfo->name.' |
'.$sys_info->data->hostnameInfo->value.' |
'.$sys_info->data->ipInfo->name.' |
'.$sys_info->data->ipInfo->value.' |
'.$system_date->data->date->name.' |
'.$system_date->data->date->value.' |
- '.__('PHP system').' |
|
---|---|
'.$php_sys->data->phpVersion->name.' |
'.$php_sys->data->phpVersion->value.' |
'.$php_sys->data->maxExecutionTime->name.' |
'.$php_sys->data->maxExecutionTime->value.' |
'.$php_sys->data->maxInputTime->name.' |
'.$php_sys->data->maxInputTime->value.' |
'.$php_sys->data->memoryLimit->name.' |
'.$php_sys->data->memoryLimit->value.' |
'.$php_sys->data->postMaxSize->name.' |
'.$php_sys->data->postMaxSize->value.' |
'.$php_sys->data->uploadMaxFilesize->name.' |
'.$php_sys->data->uploadMaxFilesize->value.' |
'.$php_sys->data->sessionLifetime->name.' |
'.$php_sys->data->sessionLifetime->value.' |
'.$product_name.''.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').' '.__('MR version').' MR'.$config['MR'].' Build'.$build_version.' '; if (enterprise_installed() === true) { $dialog .= ''.__('Support expires').''.$license_expiry_date.' '; } if ($license_expired === false) { $dialog .= ''.__('This system has official support, warranty and official updates.').' '; } else if (enterprise_installed() === true) { $dialog .= ''.__('This system has no active support contract, and has no support, upgrades or warranty.').' '; $dialog .= ''.__('Contact Pandora FMS for expand your support contract.').' '; } else { $dialog .= ''.__('The OpenSource version has no support or warranty of any kind.').' '; $dialog .= ''.__('Contact Pandora FMS for official support contract.').' '; } $dialog .= ' |
---|
Trademark and copyright 2004 - '.date('Y').' Pandora FMS. All rights reserved
Trademark and copyright 2004 - '.date('Y').' Pandora FMS. All rights reserved