diff --git a/extras/bin/gotty b/extras/bin/gotty new file mode 100755 index 0000000000..1a1de33cf6 Binary files /dev/null and b/extras/bin/gotty differ diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ce165fde19..2f579d46f1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.740-191029 +Version: 7.0NG.740-191113 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 a4a8dce448..f28fdab114 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.740-191029" +pandora_version="7.0NG.740-191113" 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 4bbac522b1..a3c40e50f0 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.740'; -use constant AGENT_BUILD => '191029'; +use constant AGENT_BUILD => '191113'; # 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 79f2310c11..f5ed96e5d9 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.740 -%define release 191029 +%define release 191113 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 392fa174ce..ea8efb582c 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.740 -%define release 191029 +%define release 191113 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 cc4b78b51c..316e2a03c2 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.740" -PI_BUILD="191029" +PI_BUILD="191113" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 730edbe5de..be5a498d11 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191029} +{191113} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 823b486b0e..b268f7f436 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.740(Build 191029)") +#define PANDORA_VERSION ("7.0NG.740(Build 191113)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d714543482..e2707bff53 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.740(Build 191029))" + VALUE "ProductVersion", "(7.0NG.740(Build 191113))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index cab514f37e..45e4ec20f1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.740-191029 +Version: 7.0NG.740-191113 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 64140d02ad..cf617bb4e3 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.740-191029" +pandora_version="7.0NG.740-191113" package_pear=0 package_pandora=1 diff --git a/pandora_console/DEBIAN/postinst b/pandora_console/DEBIAN/postinst index eb8e4872f3..a899c6bf0a 100755 --- a/pandora_console/DEBIAN/postinst +++ b/pandora_console/DEBIAN/postinst @@ -11,4 +11,11 @@ echo Restart the apache. /etc/init.d/apache2 restart fi +# Install pandora_websocket_engine service. +cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/ +chmod +x /etc/init.d/pandora_websocket_engine + +echo "You can now start the Pandora FMS Websocket service by executing" +echo " /etc/init.d/pandora_websocket_engine start" + echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it." diff --git a/pandora_console/composer.json b/pandora_console/composer.json index 208e2d3d14..4138dc77c2 100644 --- a/pandora_console/composer.json +++ b/pandora_console/composer.json @@ -1,5 +1,5 @@ { - "name": "Pandora FMS", + "name": "pandorafms/console", "description": "Pandora Flexible Monitoring System ", "authors": [ { @@ -14,7 +14,9 @@ "autoload": { "psr-4": { "Models\\": "include/rest-api/models", - "Enterprise\\Models\\": "enterprise/include/rest-api/models" + "Enterprise\\Models\\": "enterprise/include/rest-api/models", + "PandoraFMS\\": "include/lib", + "PandoraFMS\\Enterprise\\": "enterprise/include/lib" } }, "autoload-dev": { diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php new file mode 100644 index 0000000000..13924f56e2 --- /dev/null +++ b/pandora_console/extensions/quick_shell.php @@ -0,0 +1,529 @@ +printForm( + [ + 'form' => [ + 'method' => 'POST', + 'action' => '#', + ], + 'inputs' => [ + [ + 'class' => 'w100p', + 'arguments' => [ + 'name' => 'submit', + 'label' => __('Retry'), + 'type' => 'submit', + 'attributes' => 'class="sub next"', + 'return' => true, + ], + ], + ], + ] + ); + + return; + } + + $wiz->printForm( + [ + 'form' => [ + 'action' => '#', + 'class' => 'wizard', + 'method' => 'post', + ], + 'inputs' => [ + [ + 'label' => __('Username'), + 'arguments' => [ + 'type' => 'text', + 'name' => 'username', + ], + ], + [ + 'label' => __('Port'), + 'arguments' => [ + 'type' => 'text', + 'id' => 'port', + 'name' => 'port', + 'value' => 22, + ], + ], + [ + 'label' => __('Method'), + 'arguments' => [ + 'type' => 'select', + 'name' => 'method', + 'fields' => [ + 'ssh' => __('SSH'), + 'telnet' => __('Telnet'), + ], + 'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);", + ], + ], + [ + 'arguments' => [ + 'type' => 'submit', + 'label' => __('Connect'), + 'attributes' => 'class="sub next"', + ], + ], + ], + ], + false, + true + ); + + return; + } + + // Initialize Gotty Client. + $host = $config['gotty_host']; + if ($method == 'ssh') { + // SSH. + $port = $config['gotty_ssh_port']; + $command_arguments = "var args = '?arg=".$username.'@'.$address; + $command_arguments .= '&arg=-p '.$method_port."';"; + } else if ($method == 'telnet') { + // Telnet. + $port = $config['gotty_telnet_port']; + $command_arguments = "var args = '?arg=-l ".$username; + $command_arguments .= '&arg='.$address; + $command_arguments .= '&arg='.$method_port."';"; + } else { + ui_print_error_message(__('Please use SSH or Telnet.')); + return; + } + + // If rediretion is enabled, we will try to connect to http:// or https:// endpoint. + $test = get_headers($ws_url); + if ($test === false) { + if (empty($wiz) === true) { + $wiz = new Wizard(); + } + + ui_print_error_message(__('WebService engine has not been started, please check documentation.')); + echo $wiz->printGoBackButton('#'); + return; + } + + // Check credentials. + $auth_str = ''; + $gotty_url = $host.':'.$port; + if (empty($config['gotty_user']) === false + && empty($config['gotty_pass']) === false + ) { + $auth_str = $config['gotty_user'].':'.$config['gotty_pass']; + $gotty_url = $auth_str.'@'.$host.':'.$port; + } + + $r = file_get_contents('http://'.$gotty_url.'/js/hterm.js'); + if (empty($r) === true) { + if (empty($wiz) === true) { + $wiz = new Wizard(); + } + + ui_print_error_message(__('WebService engine is not working properly, please check documentation.')); + echo $wiz->printGoBackButton('#'); + return; + } + + // Override gotty client settings. + if (empty($auth_str) === true) { + $r .= "var gotty_auth_token = '';"; + } else { + $r .= "var gotty_auth_token = '"; + $r .= $auth_str."';"; + } + + // Set websocket target and method. + $gotty = file_get_contents('http://'.$gotty_url.'/js/gotty.js'); + $url = "var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';"; + if (empty($config['ws_proxy_url']) === true) { + $new = "var url = (httpsEnabled ? 'wss://' : 'ws://')"; + $new .= " + window.location.host + ':"; + $new .= $config['ws_port'].'/'.$method."';"; + } else { + $new = "var url = '"; + $new .= $config['ws_proxy_url'].'/'.$method."';"; + } + + // Update url. + $gotty = str_replace($url, $new, $gotty); + + // Update websocket arguments. + $args = 'var args = window.location.search;'; + $new = $command_arguments; + + // Update arguments. + $gotty = str_replace($args, $new, $gotty); + + ?> + +
+ + + 0) { + $msg = __('%d Updated', $changes); + if ($critical > 0) { + $msg = __( + '%d Updated, please restart WebSocket engine service', + $changes + ); + } + + ui_print_success_message($msg); + } + + // Form. + $wiz = new Wizard(); + + $wiz->printForm( + [ + 'form' => [ + 'action' => '#', + 'class' => 'wizard', + 'method' => 'post', + ], + 'inputs' => [ + [ + 'label' => __('Gotty path').ui_print_help_tip( + __('Leave blank if using an external Gotty service'), + true + ), + 'arguments' => [ + 'type' => 'text', + 'name' => 'gotty', + 'value' => $config['gotty'], + ], + ], + [ + 'label' => __('Gotty host'), + 'arguments' => [ + 'type' => 'text', + 'name' => 'gotty_host', + 'value' => $config['gotty_host'], + ], + ], + [ + 'label' => __('Gotty ssh port'), + 'arguments' => [ + 'type' => 'text', + 'name' => 'gotty_ssh_port', + 'value' => $config['gotty_ssh_port'], + ], + ], + [ + 'label' => __('Gotty telnet port'), + 'arguments' => [ + 'type' => 'text', + 'name' => 'gotty_telnet_port', + 'value' => $config['gotty_telnet_port'], + ], + ], + [ + 'label' => __('Gotty user').ui_print_help_tip( + __('Optional, set a user to access gotty service'), + true + ), + 'arguments' => [ + 'type' => 'text', + 'name' => 'gotty_user', + 'value' => $config['gotty_user'], + ], + ], + [ + 'label' => __('Gotty password').ui_print_help_tip( + __('Optional, set a password to access gotty service'), + true + ), + 'arguments' => [ + 'type' => 'password', + 'name' => 'gotty_pass', + 'value' => io_output_password($config['gotty_pass']), + ], + ], + [ + 'arguments' => [ + 'type' => 'hidden', + 'name' => 'qs_update', + 'value' => 1, + ], + ], + [ + 'arguments' => [ + 'type' => 'submit', + 'label' => __('Update'), + 'attributes' => 'class="sub next"', + ], + ], + ], + ], + false, + true + ); + +} + + +// This extension is usefull only if the agent has associated IP. +$agent_id = get_parameter('id_agente'); +if (empty($agent_id) === false + && get_parameter('sec2', '') == 'operation/agentes/ver_agente' +) { + $address = agents_get_address($agent_id); + if (empty($address) === false) { + // Extension registration. + extensions_add_opemode_tab_agent( + // TabId. + 'quick_shell', + // TabName. + __('QuickShell'), + // TabIcon. + 'images/ehorus/terminal.png', + // TabFunction. + 'quickShell', + // Version. + 'N/A', + // Acl. + 'PM' + ); + } +} + +extensions_add_godmode_menu_option( + // Name. + __('QuickShell settings'), + // Acl. + 'PM', + // FatherId. + 'gextensions', + // Icon. + 'images/ehorus/terminal.png', + // Version. + 'N/A', + // SubfatherId. + null +); + +extensions_add_godmode_function('quickShellSettings'); diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index ddfa9866ad..14384aaec3 100755 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -238,19 +238,6 @@ function output_xml_report($id) echo ''; echo ''; break; - - /* - case 'TTRT': - break; - - case 'TTO': - break; - - case 'MTBF': - break; - - case 'MTTR': - break;*/ } echo "\n"; diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index ea9a5f50e8..dae61e3a78 100755 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -375,19 +375,6 @@ function process_upload_xml_report($xml, $group_filter=0) $values['line_separator'] = io_safe_input($item['line_separator']); $values['column_separator'] = io_safe_input($item['column_separator']); break; - - /* - case 'TTRT': - break; - - case 'TTO': - break; - - case 'MTBF': - break; - - case 'MTTR': - break;*/ } if (empty($agents_item)) { diff --git a/pandora_console/extensions/sample_agent.php b/pandora_console/extensions/sample_agent.php new file mode 100644 index 0000000000..ba92debae9 --- /dev/null +++ b/pandora_console/extensions/sample_agent.php @@ -0,0 +1,66 @@ + $id_agente], 'id_agente_modulo'); + $count_modules = count($modules); + + // Update of layout 1 (Rack sample). + $images_rack_server = [ + 'rack_server_rack', + 'rack_server', + 'rack_switch', + 'rack_firewall', + 'rack_double_server', + 'rack_frame', + 'rack_pdu', + ]; + $query = 'UPDATE `tlayout_data` SET `id_agent` = '.$id_agente.', `id_agente_modulo` = CASE '; + for ($i = 0; $i < $count_modules; $i++) { + $query .= 'WHEN `image` = "'.$images_rack_server[$i].'" THEN '.$modules[$i]['id_agente_modulo'].' '; + } + + $query .= 'END WHERE `id_layout` = 1 AND `image` IN ("'.implode('","', $images_rack_server).'");'; + + db_process_sql($query); + // Update of layout 2 (Dashboard). + $query = 'UPDATE `tlayout_data` SET `id_agent`= '.$id_agente.', `id_agente_modulo` = CASE '; + $query .= 'WHEN `id` = 107 THEN '.$modules[0]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 108 THEN '.$modules[1]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 109 THEN '.$modules[2]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 110 THEN '.$modules[2]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 111 THEN '.$modules[3]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 112 THEN '.$modules[4]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 113 THEN '.$modules[5]['id_agente_modulo'].' '; + $query .= 'WHEN `id` = 114 THEN '.$modules[6]['id_agente_modulo'].' '; + $query .= 'END WHERE `id_layout` = 2 AND `id` IN (107,108,109,110,111,112,113,114);'; + + db_process_sql($query); + + // This setting will avoid regenerate all the times the visual consoles. + config_update_value('sample_agent_deployed', 1); +} + +extensions_add_main_function('sample_agent_deployment'); diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql new file mode 100644 index 0000000000..31af5570e4 --- /dev/null +++ b/pandora_console/extras/mr/33.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0; + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 6476e79e2b..d7e416c951 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1907,6 +1907,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0, `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0, `linked_layout_node_id` INT(10) NOT NULL default 0, + `cache_expiration` INTEGER UNSIGNED NOT NULL default 0, PRIMARY KEY(`id`), FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php index 69a09d2998..4cb4a29740 100644 --- a/pandora_console/general/alert_enterprise.php +++ b/pandora_console/general/alert_enterprise.php @@ -105,7 +105,7 @@ if (check_login()) { echo __( "This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.

- Download the official documentation", + Download the official documentation", get_product_name(), get_product_name(), get_product_name(), diff --git a/pandora_console/general/firts_task/planned_downtime.php b/pandora_console/general/firts_task/planned_downtime.php index dcd98fdebb..21bfb4b083 100644 --- a/pandora_console/general/firts_task/planned_downtime.php +++ b/pandora_console/general/firts_task/planned_downtime.php @@ -33,7 +33,7 @@ ui_require_css_file('firts_task'); ); ?>

-
+
diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 0996ed7521..3a355a8f69 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -349,19 +349,19 @@ if ($config['menu_type'] == 'classic') { // Support. if (enterprise_installed()) { - $header_support_link = 'https://support.artica.es/'; + $header_support_link = $config['custom_support_url']; } else { $header_support_link = 'https://pandorafms.com/forums/'; } $header_support = '
'; - $header_support .= ''; + $header_support .= ''; $header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']); $header_support .= '
'; // Documentation. $header_docu = '
'; - $header_docu .= ''; + $header_docu .= ''; $header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']); $header_docu .= '
'; diff --git a/pandora_console/general/login_help_dialog.php b/pandora_console/general/login_help_dialog.php index 323b465d5a..b02c47cea9 100644 --- a/pandora_console/general/login_help_dialog.php +++ b/pandora_console/general/login_help_dialog.php @@ -87,7 +87,7 @@ echo '
'; - echo ''.html_print_image( + echo ''.html_print_image( 'images/documentation.png', true, [ @@ -96,7 +96,7 @@ echo '
'; - echo ''.__('Documentation').''; + echo ''.__('Documentation').''; echo ''; echo ''; echo ''; diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 5aecfcc92c..7d4ebe7e04 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -88,6 +88,24 @@ if (!empty($config['login_background'])) { $login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\""; } +// Get alternative custom in case of db fail. +$custom_fields = [ + 'custom_logo_login', + 'custom_splash_login', + 'custom_title1_login', + 'custom_title2_login', + 'rb_product_name', +]; + +foreach ($custom_fields as $field) { + if (!isset($config[$field])) { + if (isset($config[$field.'_alt'])) { + $config[$field] = $config[$field.'_alt']; + $custom_conf_enabled = true; + } + } +} + // Get the custom icons. $docs_logo = ui_get_docs_logo(); $support_logo = ui_get_support_logo(); @@ -102,7 +120,7 @@ if ($docs_logo !== false) { echo '
  • '.__('Docs').'
  • '; if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if ($support_logo !== false) { - echo '
  • support
  • '; + echo '
  • support
  • '; } echo '
  • '.__('Support').'
  • '; @@ -133,7 +151,7 @@ if (defined('METACONSOLE')) { html_print_image('enterprise/images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); } } else { - if (!isset($config['custom_logo_login']) || $config['custom_logo_login'] == 0) { + if (!isset($config['custom_logo_login']) || $config['custom_logo_login'] === 0) { html_print_image('images/custom_logo_login/pandora_logo.png', false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); } else { html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); @@ -423,9 +441,14 @@ if ($login_screen == 'logout') { } switch ($login_screen) { - case 'error_authconfig': case 'error_dbconfig': - $title = __('Problem with %s database', get_product_name()); + case 'error_authconfig': + if (!isset($config['rb_product_name_alt'])) { + $title = __('Problem with %s database', get_product_name()); + } else { + $title = __('Problem with %s database', $config['rb_product_name_alt']); + } + $message = __( 'Cannot connect to the database, please check your database setup in the include/config.php file.

    Probably your database, hostname, user or password values are incorrect or diff --git a/pandora_console/general/mysqlerr.php b/pandora_console/general/mysqlerr.php index 40da530386..9abd62691f 100644 --- a/pandora_console/general/mysqlerr.php +++ b/pandora_console/general/mysqlerr.php @@ -83,7 +83,6 @@ background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%; -
    @@ -100,10 +99,29 @@ background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%; ?>
    -
    -
    - -
    + $value) { + if (preg_match('/._alt/i', $key)) { + $custom_conf_enabled = true; + break; + } + } + + if (!$custom_conf_enabled) { + echo ' +
    +
    + '.__('Documentation').' + +
    +
    + '; + } + + ?> + +
    diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index a383de35c4..3d2db9994a 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -14,7 +14,7 @@ // Load global vars check_login(); -// Take some parameters (GET) +// Take some parameters (GET). $offset = (int) get_parameter('offset'); $group_id = (int) get_parameter('group_id'); $ag_group = get_parameter('ag_group_refresh', -1); @@ -47,10 +47,10 @@ require_once 'include/functions_users.php'; $search = get_parameter('search', ''); -// Prepare the tab system to the future +// Prepare the tab system to the future. $tab = 'view'; -// Setup tab +// Setup tab. $viewtab['text'] = ''.html_print_image('images/operation.png', true, ['title' => __('View')]).''; $viewtab['operation'] = true; @@ -59,10 +59,10 @@ $viewtab['active'] = false; $onheader = ['view' => $viewtab]; -// Header +// Header. ui_print_page_header(__('Agents defined in %s', get_product_name()), 'images/agent_mc.png', false, '', true, $onheader); -// Perform actions +// Perform actions. $agent_to_delete = (int) get_parameter('borrar_agente'); $enable_agent = (int) get_parameter('enable_agent'); $disable_agent = (int) get_parameter('disable_agent'); @@ -99,7 +99,7 @@ if ($agent_to_delete) { ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.')); if (enterprise_installed()) { - // Check if the remote config file still exist + // Check if the remote config file still exist. if (isset($config['remote_config'])) { enterprise_include_once('include/functions_config_agents.php'); if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) { @@ -114,7 +114,7 @@ if ($enable_agent) { $alias = agents_get_alias($enable_agent); if ($result) { - // Update the agent from the metaconsole cache + // Update the agent from the metaconsole cache. enterprise_include_once('include/functions_agents.php'); $values = ['disabled' => 0]; enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]); @@ -136,7 +136,7 @@ if ($disable_agent) { $alias = agents_get_alias($disable_agent); if ($result) { - // Update the agent from the metaconsole cache + // Update the agent from the metaconsole cache. enterprise_include_once('include/functions_agents.php'); $values = ['disabled' => 1]; enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]); @@ -223,6 +223,10 @@ switch ($config['dbtype']) { case 'oracle': $order_collation = ''; break; + + default: + // Default. + break; } $selected = true; @@ -252,6 +256,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -274,6 +282,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -296,6 +308,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -318,6 +334,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -378,7 +398,7 @@ if ($os != 0) { } $user_groups_to_sql = ''; -// Show only selected groups +// Show only selected groups. if ($ag_group > 0) { $ag_groups = []; $ag_groups = (array) $ag_group; @@ -388,7 +408,7 @@ if ($ag_group > 0) { $user_groups_to_sql = implode(',', $ag_groups); } else { - // Concatenate AW and AD permisions to get all the possible groups where the user can manage + // Concatenate AW and AD permisions to get all the possible groups where the user can manage. $user_groupsAW = users_get_groups($config['id_user'], 'AW'); $user_groupsAD = users_get_groups($config['id_user'], 'AD'); @@ -431,24 +451,25 @@ $sql = sprintf( $agents = db_get_all_rows_sql($sql); -// Delete rnum row generated by oracle_recode_query() function +// Delete rnum row generated by oracle_recode_query() function. if (($config['dbtype'] == 'oracle') && ($agents !== false)) { for ($i = 0; $i < count($agents); $i++) { unset($agents[$i]['rnum']); } } -// Prepare pagination +// Prepare pagination. ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); if ($agents !== false) { // Urls to sort the table. - // Agent name size and description for Chinese and Japanese languages ​​are adjusted - $agent_font_size = '7'; - $description_font_size = '6.5'; - if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') { - $agent_font_size = '15'; - $description_font_size = '11'; + if ($config['language'] == 'ja' + || $config['language'] == 'zh_CN' + || $own_info['language'] == 'ja' + || $own_info['language'] == 'zh_CN' + ) { + // Adds a custom font size for Japanese and Chinese language. + $custom_font_size = 'custom_font_size'; } $url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled'; @@ -476,21 +497,21 @@ if ($agents !== false) { $rowPair = true; $iterator = 0; foreach ($agents as $agent) { - // Begin Update tagente.remote 0/1 with remote agent function return + // Begin Update tagente.remote 0/1 with remote agent function return. if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].''); } else { db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].''); } - // End Update tagente.remote 0/1 with remote agent function return + // End Update tagente.remote 0/1 with remote agent function return. $all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']); $check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW'); $check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD'); $cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']); - // Do not show the agent if there is not enough permissions + // Do not show the agent if there is not enough permissions. if (!$check_aw && !$check_ad) { continue; } @@ -512,7 +533,7 @@ if ($agents !== false) { $rowPair = !$rowPair; $iterator++; - // Agent name + // Agent name. echo ""; if ($agent['disabled']) { echo ''; @@ -537,7 +558,7 @@ if ($agents !== false) { } else { echo '".''.$agent['alias'].''.''; + id_agente=".$agent['id_agente']."'>".''.$agent['alias'].''.''; } echo ''; @@ -617,12 +638,12 @@ if ($agents !== false) { echo ''; - // Operating System icon + // Operating System icon. echo ""; ui_print_os_icon($agent['id_os'], false); echo ''; - // Type agent (Networt, Software or Satellite) + // Type agent (Networt, Software or Satellite). echo ""; echo ui_print_type_agent_icon( $agent['id_os'], @@ -634,10 +655,12 @@ if ($agents !== false) { echo ''; - // Group icon and name + // Group icon and name. echo "".ui_print_group_icon($agent['id_grupo'], true).''; - // Description - echo "".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]', 'font-size: '.$description_font_size.'pt;').''; + + // Description. + echo "".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]').''; + // Action // When there is only one element in page it's necesary go back page. if ((count($agents) == 1) && ($offset >= $config['block_size'])) { @@ -695,7 +718,7 @@ if ($agents !== false) { } if (check_acl($config['id_user'], 0, 'AW')) { - // Create agent button + // Create agent button. echo '
    '; echo '
    '; html_print_input_hidden('new_agent', 1); diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index eef8d5fbdf..ebf64a87c1 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -827,7 +827,7 @@ $table->data[5][1] = "
    '; -echo ''; +echo ''; if ($id_downtime > 0) { echo ''; @@ -929,7 +929,7 @@ if ($id_downtime > 0) { $disabled_add_button = true; } - echo ""; + echo ""; html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;'); html_print_checkbox('recursion', 1, $recursion, false, false, ''); @@ -939,7 +939,7 @@ if ($id_downtime > 0) { echo ''; // Show available agents to include into downtime echo '

    '.__('Available agents').':

    '; - echo ""; + echo ""; echo html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, false, true, true, '', false, 'width: 180px;'); @@ -1085,7 +1085,7 @@ if ($id_downtime > 0) { $data[5] = ''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).''; } - $data[5] .= ''.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).''; + $data[5] .= ''.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).''; } $table->data['agent_'.$downtime_agent['id_agente']] = $data; diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 49a72f125d..01f30afba6 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -357,7 +357,7 @@ if (!$downtimes && !$filter_performed) { // No downtimes cause the user performed a search. else if (!$downtimes) { // Filter form. - echo ""; + echo ""; html_print_table($table_form); echo ''; @@ -369,7 +369,7 @@ else if (!$downtimes) { // Create button. if ($write_permisson) { echo ' '; - echo ''; + echo ''; html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); echo ''; } @@ -378,11 +378,11 @@ else if (!$downtimes) { } // Has downtimes. else { - echo ""; + echo ""; html_print_table($table_form); echo ''; - ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset); + ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset); // User groups with AR, AD or AW permission. $groupsAD = users_get_groups($config['id_user'], $access); @@ -476,7 +476,7 @@ else { if (in_array($downtime['id_group'], $groupsAD)) { // Stop button if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) { - $data['stop'] = ''.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]); + $data['stop'] = ''.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]); } else { $data['stop'] = ''; } @@ -484,12 +484,12 @@ else { // Edit & delete buttons. if ($downtime['executed'] == 0) { // Edit. - $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; + $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; // Delete. - $data['delete'] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete')]); + $data['delete'] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete')]); } else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') { // Edit. - $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; + $data['edit'] = ''.html_print_image('images/config.png', true, ['title' => __('Update')]).''; // Delete. $data['delete'] = __('N/A'); } else { @@ -515,7 +515,7 @@ else { } html_print_table($table); - ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom'); + ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo '
    '; // CSV export button. @@ -532,7 +532,7 @@ else { // Create button. if ($write_permisson) { echo ' '; - echo '
    '; + echo ''; html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); echo ''; } @@ -559,7 +559,7 @@ $(document).ready (function () { if ( && ) { if (confirm("")) { - window.location.href = "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1"; + window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1"; } } }); diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 1fba644037..e9f1aef011 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -290,7 +290,7 @@ $table_aux = new stdClass(); foreach ($result_graphs as $graph) { $data = []; - $data[0] = ''.ui_print_truncate_text($graph['name'], 70).''; + $data[0] = ''.ui_print_truncate_text(io_safe_output($graph['name']), 70).''; $data[1] = ui_print_truncate_text($graph['description'], 70); diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index b59dbc2ee5..d06e17b12a 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -482,51 +482,6 @@ switch ($action) { $period = $item['period']; break; - /* - case 'TTRT': - $description = $item['description']; - $idAgentModule = $item['id_agent_module']; - $idAgent = db_get_value_filter( - 'id_agente', - 'tagente_modulo', - ['id_agente_modulo' => $idAgentModule] - ); - $period = $item['period']; - break; - - case 'TTO': - $description = $item['description']; - $idAgentModule = $item['id_agent_module']; - $idAgent = db_get_value_filter( - 'id_agente', - 'tagente_modulo', - ['id_agente_modulo' => $idAgentModule] - ); - $period = $item['period']; - break; - - case 'MTBF': - $description = $item['description']; - $idAgentModule = $item['id_agent_module']; - $idAgent = db_get_value_filter( - 'id_agente', - 'tagente_modulo', - ['id_agente_modulo' => $idAgentModule] - ); - $period = $item['period']; - break; - - case 'MTTR': - $description = $item['description']; - $idAgentModule = $item['id_agent_module']; - $idAgent = db_get_value_filter( - 'id_agente', - 'tagente_modulo', - ['id_agente_modulo' => $idAgentModule] - ); - $period = $item['period']; - break; - */ case 'alert_report_module': $description = $item['description']; $idAgentModule = $item['id_agent_module']; @@ -791,11 +746,6 @@ switch ($action) { case 'avg_value': case 'projection_graph': case 'prediction_date': - /* - case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'simple_baseline_graph': case 'event_report_log': case 'increment': @@ -3757,10 +3707,6 @@ $(document).ready (function () { case 'event_report_module': case 'simple_graph': case 'simple_baseline_graph': -/* case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'prediction_date': case 'projection_graph': case 'avg_value': @@ -3798,10 +3744,6 @@ $(document).ready (function () { case 'event_report_module': case 'simple_graph': case 'simple_baseline_graph': -/* case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'prediction_date': case 'projection_graph': case 'avg_value': @@ -3835,11 +3777,14 @@ $(document).ready (function () { }); $("#checkbox-checkbox_show_resume").change(function(){ - if($(this).is(":checked")){ + type = $("#type").val(); + if($(this).is(":checked") && type !== 'general'){ $("#row_select_fields2").show(); + $("#row_select_fields3").show(); } else{ $("#row_select_fields2").hide(); + $("#row_select_fields3").hide(); } }); @@ -4833,38 +4778,6 @@ function chooseType() { $("#row_period").show(); $("#row_historical_db_check").hide(); break; -/* - case 'TTRT': - $("#row_description").show(); - $("#row_agent").show(); - $("#row_module").show(); - $("#row_period").show(); - $("#row_historical_db_check").hide(); - break; - - case 'TTO': - $("#row_description").show(); - $("#row_agent").show(); - $("#row_module").show(); - $("#row_period").show(); - $("#row_historical_db_check").hide(); - break; - - case 'MTBF': - $("#row_description").show(); - $("#row_agent").show(); - $("#row_module").show(); - $("#row_period").show(); - $("#row_historical_db_check").hide(); - break; - - case 'MTTR': - $("#row_description").show(); - $("#row_agent").show(); - $("#row_module").show(); - $("#row_period").show(); - $("#row_historical_db_check").hide(); - break;*/ case 'alert_report_module': $("#row_description").show(); @@ -5218,10 +5131,6 @@ function chooseType() { case 'min_value': case 'max_value': case 'avg_value': - /* case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'simple_baseline_graph': $("#row_label").show(); break; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 40ce45b5bb..823713877b 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2006,11 +2006,6 @@ switch ($action) { case 'avg_value': case 'projection_graph': case 'prediction_date': - /* - case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'simple_baseline_graph': case 'nt_top_n': if ($label != '') { @@ -2613,11 +2608,6 @@ switch ($action) { case 'avg_value': case 'projection_graph': case 'prediction_date': - /* - case 'TTRT': - case 'TTO': - case 'MTBF': - case 'MTTR':*/ case 'simple_baseline_graph': case 'nt_top_n': if ($label != '') { diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 1385a9f193..46c2c00e44 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -63,9 +63,20 @@ if (is_ajax()) { $test_address = get_parameter('test_address', ''); - $res = enterprise_hook('send_email_attachment', [$test_address, __('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'), __('Testing Pandora FMS email'), null]); + $res = enterprise_hook( + 'send_email_attachment', + [ + $test_address, + __('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'), + __('Testing Pandora FMS email'), + null, + ] + ); echo $res; + + // Exit after ajax response. + exit(); } $table = new StdClass(); @@ -389,6 +400,52 @@ html_print_input_hidden('update_config', 1); html_print_table($table_mail_conf); +echo ''; + +echo '
    '; +echo ''.__('WebSocket settings').''; + +$t = new StdClass(); +$t->data = []; +$t->width = '100%'; +$t->class = 'databox filters'; +$t->data = []; +$t->style[0] = 'font-weight: bold'; + +$t->data[0][0] = __('Bind address'); +$t->data[0][1] = html_print_input_text( + 'ws_bind_address', + $config['ws_bind_address'], + '', + 30, + 100, + true +); + +$t->data[1][0] = __('Bind port'); +$t->data[1][2] = html_print_input_text( + 'ws_port', + $config['ws_port'], + '', + 30, + 100, + true +); + +$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true); +$t->data[2][2] = html_print_input_text( + 'ws_proxy_url', + $config['ws_proxy_url'], + '', + 30, + 100, + true +); + +html_print_input_hidden('update_config', 1); +html_print_table($t); + + echo '
    '; echo '
    '; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 0e7e41e7d6..fab43724b5 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -557,7 +557,7 @@ $row++; // For 5.1 Autohidden menu feature - $table_styles->data['autohidden'][0] = __('Autohidden menu'); + $table_styles->data['autohidden'][0] = __('Automatically hide submenu'); $table_styles->data['autohidden'][1] = html_print_checkbox_switch( 'autohidden_menu', 1, @@ -1032,6 +1032,12 @@ $row++; ); $row++; + + $table_other->data[$row][0] = __('Font size for items reports'); + $table_other->data[$row][1] = ""; + + $row++; + // ---------------------------------------------------------------------- $dirItems = scandir($config['homedir'].'/images/custom_logo'); foreach ($dirItems as $entryDir) { diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 6a02f4bb57..04ac8a22b6 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -418,7 +418,7 @@ if ($own_info['is_admin']) { else { foreach ($info1 as $key => $usr) { $u = get_user_info($key); - $g = users_get_groups($key, 'AR', $u['is_admin']); + $g = users_get_groups($key, false, $u['is_admin']); $result = array_intersect($g, $own_groups); // Show users without profile too. diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 013a7e967f..e6b2720dd8 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -2354,26 +2354,52 @@ class ConsoleSupervisor public function checkConsoleServerVersions() { global $config; - // List all servers except satellite server + // List all servers except satellite server. $server_version_list = db_get_all_rows_sql( - 'SELECT name, version FROM tserver WHERE server_type != '.SERVER_TYPE_ENTERPRISE_SATELLITE + sprintf( + 'SELECT `name`, `version` + FROM tserver + WHERE server_type != %d + GROUP BY `version`', + SERVER_TYPE_ENTERPRISE_SATELLITE + ) ); - foreach ($server_version_list as $server) { - if (strpos($server['version'], $config['current_package_enterprise']) === false) { - $title_ver_misaligned = $server['name'].' version misaligned with Console'; - $message_ver_misaligned = 'Server '.$server['name'].' and this console have different versions. This might cause several malfunctions. Please, update this server.'; + $missed = 0; - $this->notify( - [ - 'type' => 'NOTIF.SERVER.MISALIGNED', - 'title' => __($title_ver_misaligned), - 'message' => __($message_ver_misaligned), - 'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'), - ] - ); + if (is_array($server_version_list) === true) { + foreach ($server_version_list as $server) { + if (strpos( + $server['version'], + $config['current_package_enterprise'] + ) === false + ) { + $missed++; + $title_ver_misaligned = __( + '%s version misaligned with Console', + $server['name'] + ); + $message_ver_misaligned = __( + 'Server %s and this console have different versions. This might cause several malfunctions. Please, update this server.', + $server['name'] + ); + + $this->notify( + [ + 'type' => 'NOTIF.SERVER.MISALIGNED', + 'title' => __($title_ver_misaligned), + 'message' => __($message_ver_misaligned), + 'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'), + ] + ); + } } } + + // Cleanup notifications if exception is recovered. + if ($missed == 0) { + $this->cleanNotifications('NOTIF.SERVER.MISALIGNED'); + } } diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 0011167308..505d057665 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -2642,8 +2642,17 @@ class NetworkMap */ public function loadMapData() { + global $config; + $networkmap = $this->map; + // ACL. + $networkmap_write = check_acl( + $config['id_user'], + $networkmap['id_group'], + 'MW' + ); + $simulate = false; if (isset($networkmap['__simulated']) === false) { $networkmap['filter'] = json_decode( @@ -2711,6 +2720,7 @@ class NetworkMap $output .= 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n"; $output .= 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n"; $output .= 'var enterprise_installed = '.((int) enterprise_installed()).";\n"; + $output .= 'var networkmap_write = '.$networkmap_write.";\n"; $output .= 'var node_radius = '.$networkmap['filter']['node_radius'].";\n"; $output .= 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n"; $output .= "var networkmap = {'nodes': [], 'links': []};\n"; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 484f8dd138..ff5f365d5e 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 = 'PC191029'; +$build_version = 'PC191113'; $pandora_version = 'v7.0NG.740'; // Do not overwrite default timezone set if defined. @@ -148,8 +148,6 @@ if (!isset($config['homeurl_static'])) { } } -db_select_engine(); -$config['dbconnection'] = db_connect(); if (! defined('EXTENSIONS_DIR')) { @@ -160,6 +158,9 @@ if (! defined('ENTERPRISE_DIR')) { define('ENTERPRISE_DIR', 'enterprise'); } +db_select_engine(); +$config['dbconnection'] = db_connect(); + require_once $ownDir.'functions_config.php'; date_default_timezone_set('Europe/Madrid'); diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 8c5b1364f1..7c0e9ee552 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -147,7 +147,7 @@ define('COL_UNKNOWN', '#B2B2B2'); define('COL_DOWNTIME', '#976DB1'); define('COL_IGNORED', '#DDD'); define('COL_ALERTFIRED', '#F36201'); -define('COL_MINOR', '#B2B2B2'); +define('COL_MINOR', '#F099A2'); define('COL_MAJOR', '#C97A4A'); define('COL_INFORMATIONAL', '#E4E4E4'); define('COL_MAINTENANCE', '#4a83f3'); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4ce47bac09..a7d94d43bc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -4092,6 +4092,18 @@ function mask2cidr($mask) } +/** + * convert the cidr prefix to subnet mask + * + * @param int cidr prefix + * @return string subnet mask + */ +function cidr2mask($int) +{ + return long2ip(-1 << (32 - (int) $int)); +} + + function get_help_info($section_name) { global $config; diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 5aa1020214..ed50e4952a 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1905,7 +1905,7 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3) * * @param $thrash1 Don't use. * @param $thrash2 Don't use. - * @param array $other it's array, $other as param are the filters available ;;;;; in this order + * @param array $other it's array, $other as param are the filters available ;;;;; in this order * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) * example for CSV: * @@ -1934,17 +1934,25 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) } if (isset($other['data'][0])) { - // Filter by SO + // Filter by SO. if ($other['data'][0] != '') { $where .= ' AND tconfig_os.id_os = '.$other['data'][0]; } } if (isset($other['data'][1])) { - // Filter by group + // Filter by group. if ($other['data'][1] != '') { - $where .= ' AND id_grupo = '.$other['data'][1]; + $ag_groups = $other['data'][1]; + // Recursion. + if ($other['data'][6] === '1') { + $ag_groups = groups_get_id_recursive($ag_groups, true); + } + + $ag_groups = implode(',', (array) $ag_groups); } + + $where .= ' AND (id_grupo IN ('.$ag_groups.') OR id_group IN ('.$ag_groups.'))'; } if (isset($other['data'][3])) { @@ -1974,24 +1982,27 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) // Initialization of array $result_agents = []; // Filter by state - if (defined('METACONSOLE')) { - $sql = "SELECT id_agente, alias, direccion, comentarios, - tconfig_os.name, url_address, nombre - FROM tconfig_os, tmetaconsole_agent - LEFT JOIN tagent_secondary_group - ON tmetaconsole_agent.id_agente = tagent_secondary_group.id_agent - WHERE tmetaconsole_agent.id_os = tconfig_os.id_os - AND disabled = 0 $where AND $groups"; + if (is_metaconsole()) { + $sql = 'SELECT id_agente, alias, direccion, comentarios, + tconfig_os.name, url_address, nombre + FROM tconfig_os, tmetaconsole_agent + LEFT JOIN tmetaconsole_agent_secondary_group + ON tmetaconsole_agent.id_agente = tmetaconsole_agent_secondary_group.id_agent + WHERE tmetaconsole_agent.id_os = tconfig_os.id_os + AND disabled = 0 '.$where.' AND '.$groups; } else { - $sql = "SELECT id_agente, alias, direccion, comentarios, + $sql = 'SELECT id_agente, alias, direccion, comentarios, tconfig_os.name, url_address, nombre FROM tconfig_os, tagente LEFT JOIN tagent_secondary_group ON tagente.id_agente = tagent_secondary_group.id_agent WHERE tagente.id_os = tconfig_os.id_os - AND disabled = 0 $where AND $groups"; + AND disabled = 0 '.$where.' AND '.$groups; } + // Group by agent + $sql .= ' GROUP BY id_agente'; + $all_agents = db_get_all_rows_sql($sql); // Filter by status: unknown, warning, critical, without modules @@ -9080,7 +9091,9 @@ function api_set_delete_module($id, $id2, $other, $trash1) function api_set_module_data($id, $thrash2, $other, $trash1) { - if (defined('METACONSOLE')) { + global $config; + + if (is_metaconsole()) { return; } @@ -9129,8 +9142,9 @@ function api_set_module_data($id, $thrash2, $other, $trash1) ); if (false === @file_put_contents($config['remote_config'].'/'.io_safe_output($agent['nombre']).'.'.$time.'.data', $xml)) { - returnError('error_file', 'Can save agent data xml.'); + returnError('error_file', 'XML file could not be generated in path: '.$config['remote_config']); } else { + echo __('XML file was generated successfully in path: ').$config['remote_config']; returnData('string', ['type' => 'string', 'data' => $xml]); return; } @@ -14226,6 +14240,46 @@ function api_get_agents_id_name_by_cluster_name($cluster_name, $trash1, $trash2, } +/** + * Get agents alias, id and server id (if Metaconsole) given agent alias + * matching part of it. + * + * @param string $alias + * @param $trash1 + * @param $trash2 + * @param string $returnType + * Example: + * api.php?op=get&op2=agents_id_name_by_alias&return_type=json&apipass=1234&user=admin&pass=pandora&id=pandrora&id2=strict + */ +function api_get_agents_id_name_by_alias($alias, $strict, $trash2, $returnType) +{ + global $config; + + if ($strict == 'strict') { + $where_clause = " alias = '$alias'"; + } else { + $where_clause = " upper(alias) LIKE upper('%$alias%')"; + } + + if (is_metaconsole()) { + $all_agents = db_get_all_rows_sql("SELECT alias, id_agente, id_tagente,id_tmetaconsole_setup as 'id_server', server_name FROM tmetaconsole_agent WHERE $where_clause"); + } else { + $all_agents = db_get_all_rows_sql("SELECT alias, id_agente from tagente WHERE $where_clause"); + } + + if ($all_agents !== false) { + $data = [ + 'type' => 'json', + 'data' => $all_agents, + ]; + + returnData('json', $data, JSON_FORCE_OBJECT); + } else { + returnError('error_agents', 'Alias did not match any agent.'); + } +} + + function api_get_modules_id_name_by_cluster_id($cluster_id) { global $config; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 6563a6def2..4fe9900222 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -353,6 +353,18 @@ function config_update_config() if (!config_update_value('email_password', get_parameter('email_password'))) { $error_update[] = __('Email password'); } + + if (!config_update_value('ws_bind_address', get_parameter('ws_bind_address'))) { + $error_update[] = __('WebSocket bind address'); + } + + if (!config_update_value('ws_port', get_parameter('ws_port'))) { + $error_update[] = __('WebSocket port'); + } + + if (!config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'))) { + $error_update[] = __('WebSocket proxy url'); + } break; case 'enterprise': @@ -1269,6 +1281,10 @@ function config_update_config() } // Juanma (06/05/2014) New feature: Custom front page for reports. + if (!config_update_value('font_size_item_report', get_parameter('font_size_item_report', 2))) { + $error_update[] = __('Font size for items reports'); + } + if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) { $error_update[] = __('Custom report front'); } @@ -2793,6 +2809,10 @@ function config_process_config() config_update_value('custom_report_front', 0); } + if (!isset($config['font_size_item_report'])) { + config_update_value('font_size_item_report', 2); + } + if (!isset($config['custom_report_front_font'])) { config_update_value('custom_report_front_font', 'FreeSans.ttf'); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1d0355cf97..a5e76eabf3 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -179,6 +179,10 @@ function reporting_make_reporting_data( $report['group_name'] = groups_get_name($report['id_group']); $report['contents'] = []; + if (empty($report['period'])) { + $report['period'] = $period; + } + if (empty($contents)) { return reporting_check_structure_report($report); } @@ -224,7 +228,12 @@ function reporting_make_reporting_data( // General reports with 0 period means last value // Avoid to overwrite it by template value. - if (!empty($period) && ($content['type'] !== 'general' && $content['period'] != 0)) { + $general_last_value = false; + if ($content['type'] === 'general' && $content['period'] == 0) { + $general_last_value = true; + } + + if (!empty($period) && $general_last_value === false) { $content['period'] = $period; } @@ -506,43 +515,6 @@ function reporting_make_reporting_data( ); break; - /* - case 'MTTR': - $report['contents'][] = reporting_value( - $report, - $content, - 'MTTR', - $pdf - ); - break; - - case 'MTBF': - $report['contents'][] = reporting_value( - $report, - $content, - 'MTBF', - $pdf - ); - break; - - case 'TTO': - $report['contents'][] = reporting_value( - $report, - $content, - 'TTO', - $pdf - ); - break; - - case 'TTRT': - $report['contents'][] = reporting_value( - $report, - $content, - 'TTRT', - $pdf - ); - break; - */ case 'agent_configuration': $report['contents'][] = io_safe_output( reporting_agent_configuration( @@ -3276,6 +3248,7 @@ function reporting_database_serialized($report, $content) } $return['keys'] = $keys; + $return['agent_name_db'] = agents_get_name($id_agent); $return['agent_name'] = $agent_alias; $return['module_name'] = $module_name; @@ -4303,6 +4276,7 @@ function reporting_monitor_report($report, $content) ); } + $return['agent_name_db'] = agents_get_name($id_agent); $return['agent_name'] = $agent_alias; $return['module_name'] = $module_name; @@ -4475,6 +4449,7 @@ function reporting_prediction_date($report, $content) $agent_name = io_safe_output( modules_get_agentmodule_agent_alias($content['id_agent_module']) ); + $agent_name_db = io_safe_output(modules_get_agentmodule_agent_name($content['id_agent_module'])); $return['title'] = $content['name']; $return['subtitle'] = $agent_name.' - '.$module_name; @@ -4482,6 +4457,7 @@ function reporting_prediction_date($report, $content) $return['date'] = reporting_get_date_text($report, $content); $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; + $return['agent_name_db'] = $agent_name_db; $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; @@ -4526,12 +4502,14 @@ function reporting_projection_graph( $module_name = io_safe_output(modules_get_agentmodule_name($content['id_agent_module'])); $agent_name = io_safe_output(modules_get_agentmodule_agent_alias($content['id_agent_module'])); + $agent_name_db = io_safe_output(modules_get_agentmodule_agent_name($content['id_agent_module'])); $return['title'] = $content['name']; $return['subtitle'] = $agent_name.' - '.$module_name; $return['description'] = $content['description']; $return['date'] = reporting_get_date_text($report, $content); $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; + $return['agent_name_db'] = $agent_name_db; $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; @@ -4727,23 +4705,6 @@ function reporting_value($report, $content, $type, $pdf=false) case 'sum': $return['type'] = 'sumatory'; break; - - /* - case 'MTTR': - $return['type'] = 'MTTR'; - break; - - case 'MTBF': - $return['type'] = 'MTBF'; - break; - - case 'TTO': - $return['type'] = 'TTO'; - break; - - case 'TTRT': - $return['type'] = 'TTRT'; - break;*/ } if (empty($content['name'])) { @@ -4763,23 +4724,6 @@ function reporting_value($report, $content, $type, $pdf=false) case 'sum': $content['name'] = __('Summatory'); break; - - /* - case 'MTTR': - $content['name'] = __('MTTR'); - break; - - case 'MTBF': - $content['name'] = __('MTBF'); - break; - - case 'TTO': - $content['name'] = __('TTO'); - break; - - case 'TTRT': - $content['name'] = __('TTRT'); - break;*/ } } @@ -4796,6 +4740,9 @@ function reporting_value($report, $content, $type, $pdf=false) $agent_name = io_safe_output( modules_get_agentmodule_agent_alias($content['id_agent_module']) ); + $agent_name_db = io_safe_output( + modules_get_agentmodule_agent_name($content['id_agent_module']) + ); $unit = db_get_value( 'unit', 'tagente_modulo', @@ -4812,6 +4759,7 @@ function reporting_value($report, $content, $type, $pdf=false) $return['id_agent'] = $content['id_agent']; $return['id_agent_module'] = $content['id_agent_module']; + $return['agent_name_db'] = $agent_name_db; $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; @@ -4952,51 +4900,6 @@ function reporting_value($report, $content, $type, $pdf=false) $formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit; } break; - - /* - case 'MTTR': - $value = reporting_get_agentmodule_mttr( - $content['id_agent_module'], - $content['period'], - $report['datetime'] - ); - $formated_value = null; - break; - - case 'MTBF': - $value = reporting_get_agentmodule_mtbf( - $content['id_agent_module'], - $content['period'], - $report['datetime'] - ); - $formated_value = null; - break; - - case 'TTO': - $value = reporting_get_agentmodule_tto( - $content['id_agent_module'], - $content['period'], - $report['datetime'] - ); - if ($value == 0) { - $formated_value = null; - } else { - $formated_value = human_time_description_raw($value); - } - break; - - case 'TTRT': - $value = reporting_get_agentmodule_ttr( - $content['id_agent_module'], - $content['period'], - $report['datetime'] - ); - if ($value == 0) { - $formated_value = null; - } else { - $formated_value = human_time_description_raw($value); - } - break;*/ } $return['data'] = [ @@ -7755,6 +7658,7 @@ function reporting_simple_graph( $return['title'] = $content['name']; $return['subtitle'] = $agent_alias.' - '.$module_name; + $return['agent_name_db'] = agents_get_name($id_agent); $return['agent_name'] = $agent_alias; $return['module_name'] = $module_name; $return['description'] = $content['description']; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index cf1fa60e70..cd31b765b6 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -121,12 +121,9 @@ function html_do_report_info($report)
    '; - if (isset($report['period'])) { - if (is_numeric($report['datetime']) && is_numeric($report['period'])) { - $html .= ''; - } - - $html .= ''; + if (is_numeric($report['datetime']) && is_numeric($report['period']) && ($report['period'] != 0)) { + $html .= ''; + $html .= ''; } else { $html .= ''; } @@ -288,23 +285,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) reporting_html_sum_value($table, $item, $mini); break; - /* - case 'MTTR': - reporting_html_MTTR_value($table, $item, $mini, true, true); - break; - - case 'MTBF': - reporting_html_MTBF_value($table, $item, $mini, true, true); - break; - - case 'TTO': - reporting_html_TTO_value($table, $item, $mini, false, true); - break; - - case 'TTRT': - reporting_html_TTRT_value($table, $item, $mini, false, true); - break; - */ case 'agent_configuration': reporting_html_agent_configuration($table, $item); break; @@ -467,7 +447,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) if ($mini) { $font_size = '1.5'; } else { - $font_size = '3'; + $font_size = $config['font_size_item_report']; } $metaconsole_on = is_metaconsole(); @@ -2513,7 +2493,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0) if ($mini) { $font_size = '1.5'; } else { - $font_size = '3'; + $font_size = $config['font_size_item_report']; } $table->colspan['module']['cell'] = 3; @@ -2729,31 +2709,6 @@ function reporting_html_agent_configuration( } -/* - function reporting_html_TTRT_value(&$table, $item, $mini, $only_value=false, $check_empty=false) - { - reporting_html_value($table, $item, $mini, $only_value, $check_empty); - } - - - function reporting_html_TTO_value(&$table, $item, $mini, $only_value=false, $check_empty=false) - { - reporting_html_value($table, $item, $mini, $only_value, $check_empty); - } - - - function reporting_html_MTBF_value(&$table, $item, $mini, $only_value=false, $check_empty=false) - { - reporting_html_value($table, $item, $mini, $only_value, $check_empty); - } - - - function reporting_html_MTTR_value(&$table, $item, $mini, $only_value=false, $check_empty=false) - { - reporting_html_value($table, $item, $mini, $only_value, $check_empty); - } -*/ - function reporting_html_sum_value(&$table, $item, $mini) { reporting_html_value($table, $item, $mini); @@ -2780,10 +2735,12 @@ function reporting_html_min_value(&$table, $item, $mini) function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_empty=false) { + global $config; + if ($mini) { $font_size = '1.5'; } else { - $font_size = '3'; + $font_size = $config['font_size_item_report']; } if (isset($item['visual_format']) && $item['visual_format'] != 0 @@ -3625,10 +3582,10 @@ function reporting_html_general($table, $item, $pdf=0) } $table1->head[3] = __('Value'); - $table1->style[0] = 'text-align: left'; - $table1->style[1] = 'text-align: left'; - $table1->style[2] = 'text-align: left'; - $table1->style[3] = 'text-align: left'; + $table1->style[0] = 'text-align: center'; + $table1->style[1] = 'text-align: center'; + $table1->style[2] = 'text-align: center'; + $table1->style[3] = 'text-align: center'; // Begin - Order by agent. foreach ($item['data'] as $key => $row) { @@ -3759,12 +3716,16 @@ function reporting_html_general($table, $item, $pdf=0) $table_summary->head = []; $table_summary->head_colspan = []; $table_summary->align = []; + $table_summary->headstyle = []; + $table_summary->headstyle[0] = 'text-align: center;'; + $table_summary->headstyle[1] = 'text-align: center;'; + $table_summary->headstyle[2] = 'text-align: center;'; - $table_summary->align[0] = 'left'; - $table_summary->align[1] = 'right'; - $table_summary->align[2] = 'right'; - $table_summary->align[3] = 'left'; - $table_summary->align[4] = 'right'; + $table_summary->align[0] = 'center'; + $table_summary->align[1] = 'center'; + $table_summary->align[2] = 'center'; + $table_summary->align[3] = 'center'; + $table_summary->align[4] = 'center'; $table_summary->head_colspan[0] = 2; $table_summary->head[0] = __('Min Value'); @@ -3772,11 +3733,11 @@ function reporting_html_general($table, $item, $pdf=0) $table_summary->head_colspan[2] = 2; $table_summary->head[2] = __('Max Value'); - $table_summary->data[0][0] = $item['min']['agent'].' - '.$item['min']['module']; - $table_summary->data[0][1] = $item['min']['formated_value']; + $table_summary->data[0][0] = $item['min']['agent'].' - '.$item['min']['module'].str_repeat(' ', 20).$item['min']['formated_value']; + $table_summary->data[0][1] = ''; $table_summary->data[0][2] = format_for_graph($item['avg_value'], 2); - $table_summary->data[0][3] = $item['max']['agent'].' - '.$item['max']['module']; - $table_summary->data[0][4] = $item['max']['formated_value']; + $table_summary->data[0][3] = $item['max']['agent'].' - '.$item['max']['module'].str_repeat(' ', 20).$item['max']['formated_value']; + $table_summary->data[0][4] = ''; if ($pdf !== 0) { $return_pdf .= html_print_table($table_summary, true); diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 319690946e..e20fdd01fa 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -679,24 +679,6 @@ function reports_get_report_types($template=false, $not_editor=false) 'name' => __('Module Histogram graph'), ]; - /* - $types['TTRT'] = [ - 'optgroup' => __('ITIL'), - 'name' => __('TTRT'), - ]; - $types['TTO'] = [ - 'optgroup' => __('ITIL'), - 'name' => __('TTO'), - ]; - $types['MTBF'] = [ - 'optgroup' => __('ITIL'), - 'name' => __('MTBF'), - ]; - $types['MTTR'] = [ - 'optgroup' => __('ITIL'), - 'name' => __('MTTR'), - ]; - */ $types['SLA'] = [ 'optgroup' => __('SLA'), 'name' => __('S.L.A.'), diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ccaba4e42b..7f454adb04 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3243,6 +3243,8 @@ function ui_print_datatable(array $parameters) { extend: "csv", text : "'.__('Export current page to CSV').'", + title: "export_'.$parameters['id'].'_current_page_'.date('Y-m-d').'", + fieldSeparator: "'.$config['csv_divider'].'", exportOptions : { modifier : { // DataTables core @@ -5751,3 +5753,23 @@ function ui_print_comments($comments) return io_safe_output($comentario); } + + +/** + * Get complete external pandora url. + * + * @param string $url Url to be parsed. + * + * @return string Full url. + */ +function ui_get_full_external_url(string $url) +{ + $url_parsed = parse_url($url); + if ($url_parsed) { + if (!isset($url_parsed['scheme'])) { + $url = 'http://'.$url; + } + } + + return $url; +} diff --git a/pandora_console/include/help/en/help_alert_macros.php b/pandora_console/include/help/en/help_alert_macros.php index 9d730cfcc9..2a16e0b182 100644 --- a/pandora_console/include/help/en/help_alert_macros.php +++ b/pandora_console/include/help/en/help_alert_macros.php @@ -77,6 +77,7 @@ Besides the defined module macros, the following macros are available:
  • _policy_: Name of the policy that the module belongs to (if applies).
  • _prevdata_: Module previous data before the alert has been triggered.
  • _rca_: Root cause analysis chain (only for services).
  • +
  • _secondarygroups_: List of all secondary groups of the agent.
  • _server_ip_: Ip of server assigned to agent.
  • _server_name_: Name of server assigned to agent.
  • _target_ip_: IP address for the module’s target.
  • diff --git a/pandora_console/include/help/es/help_alert_macros.php b/pandora_console/include/help/es/help_alert_macros.php index 75e627f19a..e4fa442b2c 100644 --- a/pandora_console/include/help/es/help_alert_macros.php +++ b/pandora_console/include/help/es/help_alert_macros.php @@ -77,6 +77,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
  • _policy_: Nombre de la política a la que pertenece el módulo (si aplica).
  • _prevdata_: Dato previo antes de disparase la alerta.
  • _rca_: Cadena de análasis de causa raíz (sólo para servicios).
  • +
  • _secondarygroups_: Lista de todos los grupos secundarios del agente.
  • _server_ip_: Ip del servidor al que el agente está asignado.
  • _server_name_: Nombre del servidor al que el agente está asignado.
  • _target_ip_: Dirección IP del objetivo del módulo.
  • diff --git a/pandora_console/include/help/ja/help_alert_macros.php b/pandora_console/include/help/ja/help_alert_macros.php index 36ff609741..86bf24ad59 100644 --- a/pandora_console/include/help/ja/help_alert_macros.php +++ b/pandora_console/include/help/ja/help_alert_macros.php @@ -77,6 +77,7 @@
  • _policy_ : モジュールが属するポリシー名 (存在する場合)
  • _prevdata_ : アラートを発報する前のモジュールデータ
  • _rca_: Root cause analysis chain (only for services).
  • +
  • _secondarygroups_: エージェントのすべてのセカンダリグループのリスト
  • _server_ip_ : エージェントが割り当てられているサーバ IP。
  • _server_name_ : エージェントが割り当てられているサーバ名。
  • _target_ip_ : モジュールの対象IPアドレス
  • diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index e5a0b87f7e..5d3477dca1 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -14,6 +14,7 @@ /* global holding_area_dimensions */ /* global networkmap_id */ /* global enterprise_installed */ +/* global networkmap_write */ /* global force */ /* global layer_graph_nodes */ /* global layer_graph_links */ @@ -2087,7 +2088,12 @@ function show_menu(item, data) { icon: "add_node", disabled: function() { if (enterprise_installed) { - return false; + // Check if user can write network maps. + if (networkmap_write) { + return false; + } else { + return true; + } } else { return true; } @@ -2099,6 +2105,14 @@ function show_menu(item, data) { items_list["center"] = { name: set_center_menu, icon: "center", + disabled: function() { + // Check if user can write network maps. + if (networkmap_write) { + return false; + } else { + return true; + } + }, callback: function(key, options) { set_center(networkmap_id); } @@ -2136,7 +2150,12 @@ function show_menu(item, data) { icon: "restart_map", disabled: function() { if (enterprise_installed) { - return false; + // Check if user can write network maps. + if (networkmap_write) { + return false; + } else { + return true; + } } else { return true; } diff --git a/pandora_console/include/lib/WSManager.php b/pandora_console/include/lib/WSManager.php new file mode 100644 index 0000000000..f1e4fc6524 --- /dev/null +++ b/pandora_console/include/lib/WSManager.php @@ -0,0 +1,440 @@ + + * Compatible with PHP >= 7.0 + * + * @category External library + * @package Pandora FMS + * @subpackage WebSocketServer + * @version 1.0.0 + * @license See below + * @filesource https://github.com/ghedipunk/PHP-Websockets + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of PHP WebSockets nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// Begin. +namespace PandoraFMS\WebSockets; + +use \PandoraFMS\Websockets\WebSocketServer; +use \PandoraFMS\Websockets\WebSocketUser; +use \PandoraFMS\User; + + +require_once __DIR__.'/../functions.php'; + +/** + * Redirects ws communication between two endpoints. + */ +class WSManager extends WebSocketServer +{ + + /** + * Target host. + * + * @var string + */ + private $intHost = '127.0.0.1'; + + /** + * Target port + * + * @var integer + */ + private $intPort = 8080; + + /** + * Internal URL. + * + * @var string + */ + private $intUrl = '/ws'; + + /** + * 1MB... overkill for an echo server, but potentially plausible for other + * applications. + * + * @var integer + */ + public $maxBufferSize = 1048576; + + /** + * Interactive mode. + * + * @var boolean + */ + public $interative = true; + + /** + * Use a timeout of 100 milliseconds to search for messages.. + * + * @var integer + */ + public $timeout = 250; + + /** + * Handlers for connected step: + * 'protocol' => 'function'; + * + * @var array + */ + public $handlerConnected = []; + + /** + * Handlers for process step: + * 'protocol' => 'function'; + * + * @var array + */ + public $handlerProcess = []; + + /** + * Handlers for processRaw step: + * 'protocol' => 'function'; + * + * @var array + */ + public $handlerProcessRaw = []; + + /** + * Handlers for tick step: + * 'protocol' => 'function'; + * + * @var array + */ + public $handlerTick = []; + + /** + * Allow only one connection per user session. + * + * @var boolean + */ + public $socketPerSession = false; + + + /** + * Builder. + * + * @param string $listen_addr Target address (external). + * @param integer $listen_port Target port (external). + * @param array $connected Handlers for step. + * @param array $process Handlers for step. + * @param array $processRaw Handlers for step. + * @param array $tick Handlers for step. + * @param integer $bufferLength Max buffer size. + * @param boolean $debug Enable traces. + */ + public function __construct( + $listen_addr, + $listen_port, + $connected=[], + $process=[], + $processRaw=[], + $tick=[], + $bufferLength=1048576, + $debug=false + ) { + $this->maxBufferSize = $bufferLength; + $this->debug = $debug; + + // Configure handlers. + $this->handlerConnected = $connected; + $this->handlerProcess = $process; + $this->handlerProcessRaw = $processRaw; + $this->handlerTick = $tick; + + $this->userClass = '\\PandoraFMS\\Websockets\\WebSocketUser'; + parent::__construct($listen_addr, $listen_port, $bufferLength); + } + + + /** + * Call a target handler function. + * + * @param User $user User. + * @param array $handler Internal handler. + * @param array $arguments Arguments for handler function. + * + * @return mixed handler return or null. + */ + public function callHandler($user, $handler, $arguments) + { + if (isset($user->headers['sec-websocket-protocol'])) { + $proto = $user->headers['sec-websocket-protocol']; + if (isset($handler[$proto]) + && function_exists($handler[$proto]) + ) { + // Launch configured handler. + $this->stderr('Calling '.$handler[$proto]); + return call_user_func_array( + $handler[$proto], + $arguments + ); + } + } + + return null; + } + + + /** + * Read from user's socket. + * + * @param object $user Target user connection. + * + * @return string Buffer. + */ + public function readSocket($user) + { + $buffer; + + $numBytes = socket_recv( + $user->socket, + $buffer, + $this->maxBufferSize, + 0 + ); + if ($numBytes === false) { + // Failed. Disconnect. + $this->handleSocketError($user->socket); + return false; + } else if ($numBytes == 0) { + $this->disconnect($user->socket); + $this->stderr( + 'Client disconnected. TCP connection lost: '.$user->socket + ); + return false; + } + + $user->lastRawPacket = $buffer; + return $buffer; + } + + + /** + * Write to socket. + * + * @param object $user Target user connection. + * @param string $message Target message to be sent. + * + * @return void + */ + public function writeSocket($user, $message) + { + if (is_resource($user->socket)) { + if (!socket_write($user->socket, $message)) { + $this->disconnect($user->socket); + } + } else { + // Failed. Disconnect all. + $this->disconnect($user->socket); + $this->disconnect($user->redirect->socket); + } + + } + + + /** + * User already connected. + * + * @param object $user User. + * + * @return void + */ + public function connected($user) + { + global $config; + + $php_session_id = \str_replace( + 'PHPSESSID=', + '', + $user->headers['cookie'] + ); + + // If being redirected from proxy. + if (isset($user->headers['x-forwarded-for']) === true) { + $user->address = $user->headers['x-forwarded-for']; + } + + $user->account = new User(['phpsessionid' => $php_session_id]); + $_SERVER['REMOTE_ADDR'] = $user->address; + + // Ensure user is allowed to connect. + if (\check_login(false) === false) { + $this->disconnect($user->socket); + \db_pandora_audit( + 'WebSockets engine', + 'Trying to access websockets engine without a valid session', + 'N/A' + ); + return; + } + + // User exists, and session is valid. + \db_pandora_audit( + 'WebSockets engine', + 'WebSocket connection started', + $user->account->idUser + ); + $this->stderr('ONLINE '.$user->address.'('.$user->account->idUser.')'); + + if ($this->socketPerSession === true) { + // Disconnect previous sessions. + $this->cleanupSocketByCookie($user); + } + + // Launch registered handler. + $this->callHandler( + $user, + $this->handlerConnected, + [ + $this, + $user, + ] + ); + } + + + /** + * Protocol. + * + * @param string $protocol Protocol. + * + * @return string + */ + public function processProtocol($protocol): string + { + return 'Sec-Websocket-Protocol: '.$protocol."\r\n"; + } + + + /** + * Process programattic function + * + * @return void + */ + public function tick() + { + foreach ($this->users as $user) { + // Launch registered handler. + $this->callHandler( + $user, + $this->handlerTick, + [ + $this, + $user, + ] + ); + } + + } + + + /** + * Process undecoded user message. + * + * @param object $user User. + * @param string $buffer Message. + * + * @return boolean + */ + public function processRaw($user, $buffer) + { + // Launch registered handler. + return $this->callHandler( + $user, + $this->handlerProcessRaw, + [ + $this, + $user, + $buffer, + ] + ); + } + + + /** + * Process user message. Implement. + * + * @param object $user User. + * @param string $message Message. + * @param boolean $str_message String message or not. + * + * @return void + */ + public function process($user, $message, $str_message) + { + if ($str_message === true) { + $remmitent = $user->address.'('.$user->account->idUser.')'; + $this->stderr($remmitent.': '.$message); + } + + // Launch registered handler. + $this->callHandler( + $user, + $this->handlerProcess, + [ + $this, + $user, + $message, + $str_message, + ] + ); + } + + + /** + * Also close internal socket. + * + * @param object $user User. + * + * @return void + */ + public function closed($user) + { + if ($user->account) { + $_SERVER['REMOTE_ADDR'] = $user->address; + \db_pandora_audit( + 'WebSockets engine', + 'WebSocket connection finished', + $user->account->idUser + ); + + $this->stderr('OFFLINE '.$user->address.'('.$user->account->idUser.')'); + } + + // Ensure both sockets are disconnected. + $this->disconnect($user->socket); + if ($user->redirect) { + $this->disconnect($user->redirect->socket); + } + } + + +} diff --git a/pandora_console/include/lib/WebSocketServer.php b/pandora_console/include/lib/WebSocketServer.php new file mode 100644 index 0000000000..2d9eb1d9fd --- /dev/null +++ b/pandora_console/include/lib/WebSocketServer.php @@ -0,0 +1,1533 @@ + + * Compatible with PHP >= 7.0 + * + * @category External library + * @package Pandora FMS + * @subpackage WebSocketServer + * @version 1.0.0 + * @license See below + * @filesource https://github.com/ghedipunk/PHP-Websockets + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of PHP WebSockets nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// Begin. +namespace PandoraFMS\Websockets; + +/** + * Abstract class to be implemented. + */ +abstract class WebSocketServer +{ + + /** + * Bae class to be created. + * + * @var string + */ + public $userClass = 'WebSocketUser'; + + /** + * Redefine this if you want a custom user class. The custom user class + * should inherit from WebSocketUser. + * + * @var integer + */ + public $maxBufferSize; + + /** + * Max. concurrent connections. + * + * @var integer + */ + public $maxConnections = 20; + + /** + * Undocumented variable + * + * @var [type] + */ + public $master; + + /** + * Incoming sockets. + * + * @var array + */ + public $sockets = []; + + /** + * Outgoing sockets. + * + * @var array + */ + public $remoteSockets = []; + + /** + * Client list. + * + * @var array + */ + public $users = []; + + /** + * Servers list. + * + * @var array + */ + public $remoteUsers = []; + + /** + * Undocumented variable + * + * @var array + */ + public $heldMessages = []; + + /** + * Show output. + * + * @var boolean + */ + public $interactive = true; + + /** + * Debug. + * + * @var boolean + */ + public $debug = false; + + /** + * Undocumented variable + * + * @var array + */ + public $headerOriginRequired = false; + + /** + * Undocumented variable + * + * @var array + */ + public $headerSecWebSocketProtocolRequired = false; + + /** + * Undocumented variable + * + * @var array + */ + public $headerSecWebSocketExtensionsRequired = false; + + /** + * Stored raw headers for redirection. + * + * @var array + */ + public $rawHeaders = []; + + /** + * Use a timeout of 1 second to search for messages.. + * + * @var integer + */ + public $timeout = 1; + + /** + * Do not call tick every iteration, use a minimum time lapse. + * Measure: seconds. + * + * @var integer + */ + public $tickInterval = 1; + + /** + * Last tick call. (unix timestamp). + * + * @var integer + */ + public $lastTickTimestamp = 0; + + + /** + * Builder. + * + * @param string $addr Address where websocketserver will listen. + * @param integer $port Port where listen. + * @param integer $bufferLength Max buffer length. + * @param integer $maxConnections Max concurrent connections. + */ + public function __construct( + $addr, + int $port, + int $bufferLength=2048, + int $maxConnections=20 + ) { + if (isset($this->maxBufferSize) + && $this->maxBufferSize < $bufferLength + ) { + $this->maxBufferSize = $bufferLength; + } + + if (is_numeric($maxConnections) && $maxConnections > 0) { + $this->maxConnections = $maxConnections; + } + + $this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + $this->master || die('Failed: socket_create()'); + + $__tmp = socket_set_option($this->master, SOL_SOCKET, SO_REUSEADDR, 1); + $__tmp || die('Failed: socket_option()'); + + $__tmp = socket_bind($this->master, $addr, $port); + $__tmp || die('Failed: socket_bind()'); + + $__tmp = socket_listen($this->master, $this->maxConnections); + $__tmp || die('Failed: socket_listen()'); + + $this->sockets['m'] = $this->master; + $this->stderr('Listening on: '.$addr.':'.$port); + $this->stderr('Master socket: '.$this->master."\n"); + + } + + + /** + * Process user message. Implement. + * + * @param object $user User. + * @param string $message Message. + * @param boolean $str_message String message or not. + * + * @return void + */ + abstract public function process($user, $message, $str_message); + + + /** + * Process undecoded user message. + * + * @param object $user User. + * @param string $buffer Message. + * + * @return void + */ + public function processRaw($user, $buffer) + { + + } + + + /** + * Called immediately when the data is recieved. + * + * @param object $user User. + * + * @return void + */ + abstract public function connected($user); + + + /** + * Called after the handshake response is sent to the client. + * + * @param object $user User. + * + * @return void + */ + abstract public function closed($user); + + + /** + * Called after the connection is closed. + * Override to handle a connecting user, after the instance of the User + * is created, but before the handshake has completed. + * + * @param object $user User. + * + * @return void + */ + public function connecting($user) + { + // Optional implementation. + } + + + /** + * Send a message to target user. + * + * @param object $user User. + * @param string $message Message. + * + * @return void + */ + public function send($user, $message) + { + if ($user->handshake) { + $message = $this->frame($message, $user); + $result = socket_write($user->socket, $message, strlen($message)); + } else { + // User has not yet performed their handshake. + // Store for sending later. + $holdingMessage = [ + 'user' => $user, + 'message' => $message, + ]; + $this->heldMessages[] = $holdingMessage; + } + } + + + /** + * Override this for any process that should happen periodically. + * Will happen at least once per second, but possibly more often. + * + * @return void + */ + public function tick() + { + // Optional implementation. + } + + + /** + * Internal backend for tick. + * + * @return void + */ + public function pTick() + { + // Core maintenance processes, such as retrying failed messages. + foreach ($this->heldMessages as $key => $hm) { + $found = false; + foreach ($this->users as $currentUser) { + if ($hm['user']->socket == $currentUser->socket) { + $found = true; + if ($currentUser->handshake) { + unset($this->heldMessages[$key]); + $this->send($currentUser, $hm['message']); + } + } + } + + if (!$found) { + // If they're no longer in the list of connected users, + // drop the message. + unset($this->heldMessages[$key]); + } + } + } + + + /** + * Manage behaviour on socket error. + * + * @param socket $socket Target socket. + * + * @return void + */ + public function handleSocketError($socket) + { + $sockErrNo = socket_last_error($socket); + switch ($sockErrNo) { + case 102: + // ENETRESET + // Network dropped connection because of reset. + case 103: + // ECONNABORTED + // Software caused connection abort. + case 104: + // ECONNRESET + // Connection reset by peer. + case 108: + // ESHUTDOWN + // Cannot send after transport endpoint shutdown + // Probably more of an error on our side, + // if we're trying to write after the socket is + // closed. Probably not a critical error, + // though. + case 110: + // ETIMEDOUT + // Connection timed out. + case 111: + // ECONNREFUSED + // Connection refused + // We shouldn't see this one, since we're + // listening... Still not a critical error. + case 112: + // EHOSTDOWN + // Host is down. + // Again, we shouldn't see this, and again, + // not critical because it's just one connection + // and we still want to listen to/for others. + case 113: + // EHOSTUNREACH + // No route to host. + case 121: + // EREMOTEIO + // Rempte I/O error + // Their hard drive just blew up. + case 125: + // ECANCELED + // Operation canceled. + $this->stderr( + 'Unusual disconnect on socket '.$socket + ); + // Disconnect before clearing error, in case + // someone with their own implementation wants + // to check for error conditions on the socket. + $this->disconnect($socket, true, $sockErrNo); + break; + + default: + $this->stderr( + 'Socket error: '.socket_strerror($sockErrNo) + ); + break; + } + } + + + /** + * Main processing loop + * + * @return void + */ + public function run() + { + while (true) { + if (empty($this->sockets) === true) { + $this->sockets['m'] = $this->master; + } + + $read = $this->sockets; + $except = null; + $write = null; + $this->pTick(); + + if ((time() - $this->lastTickTimestamp) > $this->tickInterval) { + $this->lastTickTimestamp = time(); + $this->tick(); + } + + socket_select($read, $write, $except, 0, $this->timeout); + foreach ($read as $socket) { + if ($socket == $this->master) { + // External to master connection. New client. + $client = socket_accept($socket); + if ($client < 0) { + $this->stderr('Failed: socket_accept()'); + continue; + } else { + $this->connect($client); + $this->stderr('Client connected. '.$client); + } + } else { + if (!$socket) { + $this->disconnect($socket); + continue; + } + + // Updates on 'read' socket. + $numBytes = socket_recv( + $socket, + $buffer, + $this->maxBufferSize, + 0 + ); + if ($numBytes === false) { + $this->handleSocketError($socket); + } else if ($numBytes == 0) { + $this->disconnect($socket); + $this->stderr( + 'Client disconnected. TCP connection lost: '.$socket + ); + } else { + $user = $this->getUserBySocket($socket); + if (!$user->handshake) { + $tmp = str_replace("\r", '', $buffer); + if (strpos($tmp, "\n\n") === false) { + continue; + // If the client has not finished sending the + // header, then wait before sending our upgrade + // response. + } + + $this->doHandshake($user, $buffer); + } else { + if ($this->processRaw($user, $buffer)) { + // Split packet into frame and send it to deframe. + $this->splitPacket( + $numBytes, + $buffer, + $user + ); + } + } + } + } + } + + // Remote updates. + $remotes = $this->remoteSockets; + if (count($remotes) > 0) { + socket_select($remotes, $write, $except, 0, $this->timeout); + foreach ($remotes as $socket) { + // Remote updates - internal. We're client of this sockets. + if (!$socket) { + continue; + } + + $numBytes = socket_recv( + $socket, + $buffer, + $this->maxBufferSize, + 0 + ); + if ($numBytes === false) { + $this->handleSocketError($socket); + } else if ($numBytes == 0) { + $this->disconnect($socket); + $this->stderr( + 'Client disconnected. TCP connection lost: '.$socket + ); + } else { + $user = $this->getUserBySocket($socket); + if (!$user) { + $this->disconnect($socket); + $this->stderr( + 'User was not connected: '.$socket + ); + } else if (!$this->processRaw($user, $buffer)) { + // Split packet into frame and send it to deframe. + $this->splitPacket( + $numBytes, + $buffer, + $user + ); + } + } + } + } + } + } + + + /** + * Register user (and its socket) into master. + * + * @param Socket $socket Socket. + * + * @return void + */ + public function connect($socket) + { + $user = new $this->userClass( + uniqid('u'), + $socket + ); + $this->users[$user->id] = $user; + $this->sockets[$user->id] = $socket; + $this->connecting($user); + } + + + /** + * Disconnect socket from master. + * + * @param Socket $socket Socket. + * @param boolean $triggerClosed Also close. + * @param integer $sockErrNo Clear error. + * + * @return void + */ + public function disconnect( + $socket, + bool $triggerClosed=true, + $sockErrNo=null + ) { + $user = $this->getUserBySocket($socket); + if ($user !== null) { + if (array_key_exists($user->id, $this->users)) { + unset($this->users[$user->id]); + } + + if (array_key_exists($user->id, $this->remoteUsers)) { + unset($this->remoteUsers[$user->id]); + } + + if (array_key_exists($user->id, $this->sockets)) { + unset($this->sockets[$user->id]); + } + + if (array_key_exists($user->id, $this->remoteSockets)) { + unset($this->remoteSockets[$user->id]); + } + + if ($sockErrNo !== null) { + socket_clear_error($socket); + } + + if ($triggerClosed) { + $this->closed($user); + $this->stderr( + 'Client disconnected. '.$user->socket + ); + socket_close($user->socket); + } else { + $message = $this->frame('', $user, 'close'); + socket_write( + $user->socket, + $message, + strlen($message) + ); + } + } + } + + + /** + * Perform a handshake. + * + * @param object $user User. + * @param string $buffer Buffer. + * + * @return void + */ + public function doHandshake($user, $buffer) + { + $magicGUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; + $headers = []; + $lines = explode("\n", $buffer); + foreach ($lines as $line) { + if (strpos($line, ':') !== false) { + $header = explode(':', $line, 2); + $headers[strtolower(trim($header[0]))] = trim($header[1]); + $this->rawHeaders[trim($header[0])] = trim($header[1]); + } else if (stripos($line, 'get ') !== false) { + preg_match('/GET (.*) HTTP/i', $buffer, $reqResource); + $headers['get'] = trim($reqResource[1]); + } + } + + if (isset($headers['get'])) { + $user->requestedResource = $headers['get']; + } else { + // TODO: fail the connection. + $handshakeResponse = "HTTP/1.1 405 Method Not Allowed\r\n\r\n"; + } + + if (!isset($headers['host']) + || !$this->checkHost($headers['host']) + ) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + if (!isset($headers['upgrade']) + || strtolower($headers['upgrade']) != 'websocket' + ) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + if (!isset($headers['connection']) + || strpos(strtolower($headers['connection']), 'upgrade') === false + ) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + if (!isset($headers['sec-websocket-key'])) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + if (!isset($headers['sec-websocket-version']) + || strtolower($headers['sec-websocket-version']) != 13 + ) { + $handshakeResponse = "HTTP/1.1 426 Upgrade Required\r\nSec-WebSocketVersion: 13"; + } + + if (($this->headerOriginRequired + && !isset($headers['origin']) ) + || ($this->headerOriginRequired + && !$this->checkOrigin($headers['origin'])) + ) { + $handshakeResponse = 'HTTP/1.1 403 Forbidden'; + } + + if (($this->headerSecWebSocketProtocolRequired + && !isset($headers['sec-websocket-protocol'])) + || ($this->headerSecWebSocketProtocolRequired + && !$this->checkWebsocProtocol( + $headers['sec-websocket-protocol'] + )) + ) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + if (($this->headerSecWebSocketExtensionsRequired + && !isset($headers['sec-websocket-extensions'])) + || ($this->headerSecWebSocketExtensionsRequired + && !$this->checkWebsocExtensions( + $headers['sec-websocket-extensions'] + )) + ) { + $handshakeResponse = 'HTTP/1.1 400 Bad Request'; + } + + // Done verifying the _required_ headers and optionally required headers. + if (isset($handshakeResponse)) { + socket_write( + $user->socket, + $handshakeResponse, + strlen($handshakeResponse) + ); + $this->disconnect($user->socket); + return; + } + + $user->headers = $headers; + $user->handshake = $buffer; + + $webSocketKeyHash = sha1($headers['sec-websocket-key'].$magicGUID); + + $rawToken = ''; + for ($i = 0; $i < 20; $i++) { + $rawToken .= chr(hexdec(substr($webSocketKeyHash, ($i * 2), 2))); + } + + $handshakeToken = base64_encode($rawToken)."\r\n"; + + $subProtocol = ''; + if (isset($headers['sec-websocket-protocol'])) { + $subProtocol = $this->processProtocol( + $headers['sec-websocket-protocol'] + ); + } + + $extensions = ''; + if (isset($headers['sec-websocket-extensions'])) { + $extensions = $this->processExtensions( + $headers['sec-websocket-extensions'] + ); + } + + $handshakeResponse = "HTTP/1.1 101 Switching Protocols\r\n"; + $handshakeResponse .= "Upgrade: websocket\r\nConnection: Upgrade\r\n"; + $handshakeResponse .= 'Sec-WebSocket-Accept: '; + $handshakeResponse .= $handshakeToken.$subProtocol.$extensions."\r\n"; + socket_write( + $user->socket, + $handshakeResponse, + strlen($handshakeResponse) + ); + $this->connected($user); + } + + + /** + * Check target host. + * + * @param string $hostName Target hostname to be checked. + * + * @return boolean Ok or not. + */ + public function checkHost($hostName): bool + { + // Override and return false if host is not one that you would expect. + // Ex: You only want to accept hosts from the my-domain.com domain, + // but you receive a host from malicious-site.com instead. + return true; + } + + + /** + * Check origin. + * + * @param string $origin Origin of connections. + * + * @return boolean Allowed or not. + */ + public function checkOrigin($origin): bool + { + // Override and return false if origin is not one that you would expect. + return true; + } + + + /** + * Check websocket protocol. + * + * @param string $protocol Protocol received. + * + * @return boolean Expected or not. + */ + public function checkWebsocProtocol($protocol): bool + { + // Override and return false if a protocol is not found that you + // would expect. + return true; + } + + + /** + * Check websocket extension. + * + * @param string $extensions Extension. + * + * @return boolean Allowed or not. + */ + public function checkWebsocExtensions($extensions): bool + { + // Override and return false if an extension is not found that you + // would expect. + return true; + } + + + /** + * Return either + * * "Sec-WebSocket-Protocol: SelectedProtocolFromClientList\r\n" + * or return an empty string. + * + * The carriage return/newline combo must appear at the end of a non-empty + * string, and must not appear at the beginning of the string nor in an + * otherwise empty string, or it will be considered part of the response + * body, which will trigger an error in the client as it will not be + * formatted correctly. + * + * @param string $protocol Selected protocol. + * + * @return string + */ + public function processProtocol($protocol): string + { + return ''; + } + + + /** + * Return either + * * "Sec-WebSocket-Extensions: SelectedExtensions\r\n" + * or return an empty string. + * + * @param string $extensions Selected extensions. + * + * @return string + */ + public function processExtensions($extensions): string + { + return ''; + } + + + /** + * Return user associated to target socket. + * + * @param Socket $socket Socket. + * + * @return object + */ + public function getUserBySocket($socket) + { + foreach ($this->users as $user) { + if ($user->socket == $socket) { + return $user; + } + } + + foreach ($this->remoteUsers as $user) { + if ($user->socket == $socket) { + return $user; + } + } + + return null; + } + + + /** + * Disconnects all users matching target cookie but given one. + * + * @param object $user Latest user. + * + * @return void + */ + public function cleanupSocketByCookie($user) + { + $cookie = $user->headers['cookie']; + foreach ($this->users as $u) { + if ($u->id != $user->id + && $u->headers['cookie'] == $cookie + ) { + $this->disconnect($u->socket); + } + } + + } + + + /** + * Return INT user associated to target socket. + * + * @param Socket $socket Socket. + * + * @return object + */ + public function getIntUserBySocket($socket) + { + foreach ($this->users as $user) { + if ($user->intSocket == $socket) { + return [ + 'ext' => $user, + 'int' => $user->intUser, + ]; + } + } + + return null; + } + + + /** + * Dump to stdout. + * + * @param string $message Message. + * + * @return void + */ + public function stdout($message=null) + { + if ((bool) $this->interactive === true) { + echo $message."\n"; + } + } + + + /** + * Dump to stderr. + * + * @param string $message Message. + * + * @return void + */ + public function stderr($message=null) + { + if ($this->interactive === true + && $this->debug === true + ) { + echo date('D M j G:i:s').' - '.$message."\n"; + } + } + + + /** + * Process a frame message. + * + * @param string $message Message. + * @param object $user User. + * @param string $messageType MessageType. + * @param boolean $messageContinues MessageContinues. + * + * @return string Framed message. + */ + public function frame( + $message, + $user, + $messageType='text', + bool $messageContinues=false + ) { + switch ($messageType) { + case 'continuous': + $b1 = 0; + break; + + case 'text': + $b1 = ($user->sendingContinuous) ? 0 : 1; + break; + + case 'binary': + $b1 = ($user->sendingContinuous) ? 0 : 2; + break; + + case 'close': + $b1 = 8; + break; + + case 'ping': + $b1 = 9; + break; + + case 'pong': + $b1 = 10; + break; + + default: + // Ignore. + break; + } + + if ($messageContinues) { + $user->sendingContinuous = true; + } else { + $b1 += 128; + $user->sendingContinuous = false; + } + + $length = strlen($message); + $lengthField = ''; + if ($length < 126) { + $b2 = $length; + } else if ($length < 65536) { + $b2 = 126; + $hexLength = dechex($length); + // $this->stdout("Hex Length: $hexLength"); + if ((strlen($hexLength) % 2) == 1) { + $hexLength = '0'.$hexLength; + } + + $n = (strlen($hexLength) - 2); + + for ($i = $n; $i >= 0; $i = ($i - 2)) { + $lengthField = chr( + hexdec(substr($hexLength, $i, 2)) + ).$lengthField; + } + + $len = strlen($lengthField); + while ($len < 2) { + $lengthField = chr(0).$lengthField; + $len = strlen($lengthField); + } + } else { + $b2 = 127; + $hexLength = dechex($length); + if ((strlen($hexLength) % 2) == 1) { + $hexLength = '0'.$hexLength; + } + + $n = (strlen($hexLength) - 2); + + for ($i = $n; $i >= 0; $i = ($i - 2)) { + $lengthField = chr( + hexdec(substr($hexLength, $i, 2)) + ).$lengthField; + } + + $len = strlen($lengthField); + while ($length < 8) { + $lengthField = chr(0).$lengthField; + $len = strlen($lengthField); + } + } + + $out = chr($b1).chr($b2).$lengthField.$message; + return $out; + } + + + /** + * Check packet if he have more than one frame and process each frame + * individually. + * + * @param integer $length Length. + * @param string $packet Packet. + * @param object $user User. + * + * @return void + */ + public function splitPacket( + int $length, + $packet, + $user + ) { + // Add PartialPacket and calculate the new $length. + if ($user->handlingPartialPacket) { + $packet = $user->partialBuffer.$packet; + $user->handlingPartialPacket = false; + $length = strlen($packet); + } + + $user->lastRawPacket = $packet; + $fullpacket = $packet; + $frame_pos = 0; + $frame_id = 1; + + while ($frame_pos < $length) { + $headers = $this->extractHeaders($packet); + $headers_size = $this->calcOffset($headers); + $framesize = ($headers['length'] + $headers_size); + + // Split frame from packet and process it. + $frame = substr($fullpacket, $frame_pos, $framesize); + + $message = $this->deframe($frame, $user, $headers); + + if ($message !== false) { + if ($user->hasSentClose) { + $this->disconnect($user->socket); + } else { + $str_message = false; + if ((preg_match('//u', $message)) + || ($headers['opcode'] == 2) + ) { + $str_message = true; + } else { + $this->stderr("not UTF-8\n"); + $str_message = false; + } + + $this->process($user, $message, $str_message); + } + } + + // Get the new position also modify packet data. + $frame_pos += $framesize; + $packet = substr($fullpacket, $frame_pos); + $frame_id++; + } + } + + + /** + * Calculate offset. + * + * @param array $headers Headers received. + * + * @return integer Calculated offset. + */ + public function calcOffset(array $headers): int + { + $offset = 2; + if ($headers['hasmask']) { + $offset += 4; + } + + if ($headers['length'] > 65535) { + $offset += 8; + } else if ($headers['length'] > 125) { + $offset += 2; + } + + return $offset; + } + + + /** + * Parse frame. + * + * @param string $message Message received. + * @param object $user Origin. + * + * @return boolean Process ok or not. + */ + public function deframe( + $message, + &$user + ) { + /* + * Debug purposes. + * echo $this->strtohex($message); + */ + + $headers = $this->extractHeaders($message); + $pongReply = false; + $willClose = false; + + switch ($headers['opcode']) { + case 0: + case 1: + case 2: + case 10: + $willClose = false; + break; + + case 8: + // TODO: close the connection. + $user->hasSentClose = true; + return ''; + + case 9: + $pongReply = true; + break; + + default: + /* + * TODO: fail connection. + * $this->disconnect($user->socket); + */ + + $willClose = true; + break; + } + + /* + * Deal by splitPacket() as now deframe() do only one frame at a time. + * if ($user->handlingPartialPacket) { + * $message = $user->partialBuffer . $message; + * $user->handlingPartialPacket = false; + * return $this->deframe($message, $user); + * } + */ + + if ($this->checkRSVBits($headers, $user)) { + return false; + } + + if ($willClose) { + // TODO: fail the connection. + return false; + } + + $payload = $user->partialMessage.$this->extractPayload( + $message, + $headers + ); + + if ($pongReply) { + $reply = $this->frame($payload, $user, 'pong'); + socket_write($user->socket, $reply, strlen($reply)); + return false; + } + + if ($headers['length'] > strlen($this->applyMask($headers, $payload))) { + $user->handlingPartialPacket = true; + $user->partialBuffer = $message; + return false; + } + + $payload = $this->applyMask($headers, $payload); + + if ($headers['fin']) { + $user->partialMessage = ''; + return $payload; + } + + $user->partialMessage = $payload; + + return false; + } + + + /** + * Extract headers from message. + * + * @param string $message Message. + * + * @return array Headers. + */ + public function extractHeaders($message): array + { + $header = [ + 'fin' => ($message[0] & chr(128)), + 'rsv1' => ($message[0] & chr(64)), + 'rsv2' => ($message[0] & chr(32)), + 'rsv3' => ($message[0] & chr(16)), + 'opcode' => (ord($message[0]) & 15), + 'hasmask' => ($message[1] & chr(128)), + 'length' => 0, + 'mask' => '', + ]; + + $header['length'] = ord($message[1]); + if (ord($message[1]) >= 128) { + $header['length'] = (ord($message[1]) - 128); + } + + if ($header['length'] == 126) { + if ($header['hasmask']) { + $header['mask'] = $message[4].$message[5]; + $header['mask'] .= $message[6].$message[7]; + } + + $header['length'] = (ord($message[2]) * 256 + ord($message[3])); + } else if ($header['length'] == 127) { + if ($header['hasmask']) { + $header['mask'] = $message[10].$message[11]; + $header['mask'] .= $message[12].$message[13]; + } + + $header['length'] = (ord($message[2]) * 65536 * 65536 * 65536 * 256); + $header['length'] += (ord($message[3]) * 65536 * 65536 * 65536); + $header['length'] += (ord($message[4]) * 65536 * 65536 * 256); + $header['length'] += (ord($message[5]) * 65536 * 65536); + $header['length'] += (ord($message[6]) * 65536 * 256); + $header['length'] += (ord($message[7]) * 65536); + $header['length'] += (ord($message[8]) * 256); + $header['length'] += ord($message[9]); + } else if ($header['hasmask']) { + if (!isset($message[2])) { + $message[2] = 0x00; + } + + if (!isset($message[3])) { + $message[3] = 0x00; + } + + if (!isset($message[4])) { + $message[4] = 0x00; + } + + if (!isset($message[5])) { + $message[5] = 0x00; + } + + $header['mask'] = $message[2].$message[3].$message[4].$message[5]; + } + + /* + * Debug purposes. + * echo $this->strtohex($message); + * + * $this->printHeaders($header); + */ + + return $header; + } + + + /** + * Get payload from message using headers. + * + * @param string $message Message. + * @param array $headers Headers. + * + * @return string + */ + public function extractPayload( + $message, + array $headers + ) { + $offset = 2; + if ($headers['hasmask']) { + $offset += 4; + } + + if ($headers['length'] > 65535) { + $offset += 8; + } else if ($headers['length'] > 125) { + $offset += 2; + } + + return substr($message, $offset); + } + + + /** + * Apply mask. + * + * @param array $headers Headers. + * @param string $payload Payload. + * + * @return string Xor. + */ + public function applyMask( + array $headers, + $payload + ) { + $effectiveMask = ''; + if ($headers['hasmask']) { + $mask = $headers['mask']; + } else { + return $payload; + } + + $len_mask = strlen($effectiveMask); + $len_payload = strlen($payload); + + // Enlarge. + while ($len_mask < $len_payload) { + $effectiveMask .= $mask; + $len_mask = strlen($effectiveMask); + $len_payload = strlen($payload); + } + + // Decrease. + while ($len_mask > $len_payload) { + $effectiveMask = substr($effectiveMask, 0, -1); + $len_mask = strlen($effectiveMask); + $len_payload = strlen($payload); + } + + return ($effectiveMask ^ $payload); + } + + + /** + * Check RSV bits. + * Override this method if you are using an extension where RSV bits are + * being used. + * + * @param array $headers Headers. + * @param object $user User. + * + * @return boolean OK or not. + */ + public function checkRSVBits( + array $headers, + $user + ): bool { + $len = ord($headers['rsv1']); + $len += ord($headers['rsv2']); + $len += ord($headers['rsv3']); + if ($len > 0) { + /* + * TODO: fail connection. + * $this->disconnect($user->socket); + */ + + return true; + } + + return false; + } + + + /** + * Transforms string into HEX string. + * + * @param string $str String. + * + * @return string HEX string. + */ + public function strtohex( + $str='' + ): string { + $strout = ''; + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + if (ord($str[$i]) < 16) { + $strout .= '0'.dechex(ord($str[$i])); + } else { + $strout .= dechex(ord($str[$i])); + } + + $strout .= ' '; + if (($i % 32) == 7) { + $strout .= ': '; + } + + if (($i % 32) == 15) { + $strout .= ': '; + } + + if (($i % 32) == 23) { + $strout .= ': '; + } + + if (($i % 32) == 31) { + $strout .= "\n"; + } + } + + return $strout."\n"; + } + + + /** + * Debug purposes. Print headers. + * + * @param array $headers Headers. + * + * @return void + */ + public function printHeaders($headers) + { + echo "Array\n(\n"; + foreach ($headers as $key => $value) { + if ($key == 'length' || $key == 'opcode') { + echo "\t[".$key.'] => '.$value."\n\n"; + } else { + echo "\t[".$key.'] => '.$this->strtohex($value)."\n"; + } + } + + echo ")\n"; + } + + + /** + * View any string as a hexdump. + * + * @param string $data The string to be dumped. + * + * @return string + */ + public function dump($data) + { + // Init. + $hexi = ''; + $ascii = ''; + $dump = "Hex Message:\n"; + $offset = 0; + $len = strlen($data); + + // Iterate string. + for ($i = 0, $j = 0; $i < $len; $i++) { + // Convert to hexidecimal. + $hexi .= sprintf('%02x ', ord($data[$i])); + // Replace non-viewable bytes with '.'. + if (ord($data[$i]) >= 32 && ord($data[$i]) <= 255) { + $ascii .= $data[$i]; + } else { + $ascii .= '.'; + } + + // Add extra column spacing. + if ($j === 7 && $i !== ($len - 1)) { + $hexi .= ' '; + $ascii .= ' '; + } + + // Add row. + if (++$j === 16 || $i === ($len - 1)) { + // Join the hexi / ascii output. + $dump .= sprintf('%04x %-49s %s', $offset, $hexi, $ascii); + // Reset vars. + $hexi = ''; + $ascii = ''; + $offset += 16; + $j = 0; + // Add newline. + if ($i !== ($len - 1)) { + $dump .= "\n"; + } + } + } + + // Finish dump. + $dump .= "\n"; + return $dump; + } + + +} diff --git a/pandora_console/include/lib/WebSocketUser.php b/pandora_console/include/lib/WebSocketUser.php new file mode 100644 index 0000000000..bcbe30cc17 --- /dev/null +++ b/pandora_console/include/lib/WebSocketUser.php @@ -0,0 +1,161 @@ + + * Compatible with PHP >= 7.0 + * + * @category External library + * @package Pandora FMS + * @subpackage WebSocketUser + * @version 1.0.0 + * @license See below + * @filesource https://github.com/ghedipunk/PHP-Websockets + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of PHP WebSockets nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// Begin. +namespace PandoraFMS\Websockets; + + +/** + * Parent class for WebSocket User. + */ +class WebSocketUser +{ + + /** + * Socket. + * + * @var Socket + */ + public $socket; + + /** + * Id. + * + * @var string + */ + public $id; + + /** + * Headers. + * + * @var array + */ + public $headers = []; + + /** + * Handshake. + * + * @var boolean + */ + public $handshake = false; + + /** + * HandlingPartialPacket. + * + * @var boolean + */ + public $handlingPartialPacket = false; + + /** + * PartialBuffer. + * + * @var string + */ + public $partialBuffer = ''; + + /** + * SendingContinuous. + * + * @var boolean + */ + public $sendingContinuous = false; + + /** + * PartialMessage. + * + * @var string + */ + public $partialMessage = ''; + + /** + * HasSentClose. + * + * @var boolean + */ + public $hasSentClose = false; + + /** + * Raw packet for redirection. + * + * @var string + */ + public $lastRawPacket; + + /** + * Pair resend packages. + * + * @var WebSocketUser + */ + public $redirect; + + /** + * Pandora FMS user account. + * + * @var User + */ + public $account; + + /** + * Remote address. + * + * @var string + */ + public $address; + + + /** + * Initializes a websocket user. + * + * @param string $id Id of the new user. + * @param Socket $socket Socket where communication is stablished. + */ + public function __construct($id, $socket) + { + socket_getpeername($socket, $this->address); + $this->id = $id; + $this->socket = $socket; + } + + +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 61626c2e67..ef1d250759 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5896,6 +5896,12 @@ table.table_modal_alternate tr td:first-child { width: 100%; } +/* + * --------------------------------------------------------------------- + * - VISUAL STYLES FOR HISTOGRAM GRAPHS + * --------------------------------------------------------------------- + */ + .slicebar-box-hover-styles { position: absolute; background-color: #fff; @@ -5911,6 +5917,7 @@ table.table_modal_alternate tr td:first-child { width: 101%; } +/*Font header feedback*/ form#modal_form_feedback { padding: 10px; } @@ -5951,3 +5958,23 @@ form#modal_form_feedback ul.wizard li > textarea { display: inline-block; font-family: monospace; } +/* + * --------------------------------------------------------------------- + * - FONT SIZES IN AGENT VIEW. This changes the font size of the agent + * name and the description when the language is Japanese or Chinese + * --------------------------------------------------------------------- + */ + +.custom_font_size { + font-size: 14px; + font-weight: bold; +} + +/* Generic classes to reuse and facilitate the creation of custom themes */ +.pandora_green_text { + color: #82b92e; +} + +.pandora_green_bg { + background-color: #82b92e; +} diff --git a/pandora_console/include/websocket_registrations.php b/pandora_console/include/websocket_registrations.php new file mode 100644 index 0000000000..24f9d9560c --- /dev/null +++ b/pandora_console/include/websocket_registrations.php @@ -0,0 +1,189 @@ +userClass('INTERNAL-'.uniqid('u'), $intSocket); + + $intUser->headers = [ + 'get' => $to_url.' HTTP/1.1', + 'host' => $to_addr, + 'origin' => $to_addr, + 'sec-websocket-protocol' => 'gotty', + ]; + $ws_object->writeSocket($intUser, $c_str); + + return $intUser; +} + + +/** + * Process a connected step on proxied protocols. + * + * @param WSManager $ws_object Main WebSocket manager object. + * @param User $user WebSocketUser. + * + * @return void + */ +function proxyConnected( + $ws_object, + $user +) { + global $config; + + /* + * $user->redirect is connected to internal (reflexive). + * $user->socket is connected to external. + */ + + // Gotty. Based on the command selected, redirect to a target port. + if ($user->requestedResource == '/ssh') { + $port = $config['gotty_ssh_port']; + } else if ($user->requestedResource == '/telnet') { + $port = $config['gotty_telnet_port']; + } else { + $ws_object->disconnect($user->socket); + return; + } + + // Switch between ports... + // Create a new socket connection (internal). + $intUser = connectInt( + $ws_object, + $ws_object->rawHeaders, + $config['gotty_host'], + $port, + '/ws' + ); + + if ($intUser === null) { + $ws_object->disconnect($user->socket); + return; + } + + // Map user. + $user->intUser = $intUser; + // And socket. + $user->intSocket = $intUser->socket; + $user->redirect = $intUser; + $intUser->redirect = $user; + + // Keep an eye on changes. + $ws_object->remoteSockets[$intUser->id] = $intUser->socket; + $ws_object->remoteUsers[$intUser->id] = $intUser; + + // Ignore. Cleanup socket. + $response = $ws_object->readSocket($user->intUser); +} + + +/** + * Redirects input from user to redirection stabished. + * + * @param WSManager $ws_object Main WebSocket manager object. + * @param WebSocketUser $user WebSocket user. + * @param string $buffer Buffer. + * + * @return boolean Ok or not. + */ +function proxyProcessRaw($ws_object, $user, $buffer) +{ + if (isset($user->redirect) !== true) { + $ws_object->disconnect($user->socket); + return false; + } + + $ws_object->stderr($user->id.' >> '.$user->redirect->id); + $ws_object->stderr($ws_object->dump($buffer)); + $ws_object->writeSocket($user->redirect, $buffer); + + return true; +} + + +/* + * ============================================================================ + * * ENDS: GOTTY PROTOCOL: PROXY + * ============================================================================ + */ diff --git a/pandora_console/install.php b/pandora_console/install.php index 4f668fcd81..094f4b3393 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    '.html_print_image('images/setup.png', true, ['title' => __('Setup')]).''; $setuptab['godmode'] = true; @@ -193,7 +193,7 @@ if (!$strict_user) { } } -// User is deleting agent +// User is deleting agent. if (isset($result_delete)) { if ($result_delete) { ui_print_success_message(__('Sucessfully deleted agent')); @@ -283,7 +283,7 @@ $order = null; $order_collation = ''; switch ($config['dbtype']) { case 'mysql': - // $order_collation = " COLLATE utf8_general_ci"; + // $order_collation = " COLLATE utf8_general_ci";. $order_collation = ''; break; @@ -314,6 +314,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -336,6 +340,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -358,6 +366,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -380,6 +392,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -402,6 +418,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -424,6 +444,10 @@ switch ($sortField) { 'order' => 'ASC', ]; break; + + default: + // Default. + break; } break; @@ -446,6 +470,10 @@ switch ($sortField) { 'order' => 'ASC', ]; break; + + default: + // Default. + break; } break; @@ -505,7 +533,7 @@ if (!empty($search_custom)) { $search_sql_custom = ''; } -// Show only selected groups +// Show only selected groups. if ($group_id > 0) { $groups = [$group_id]; if ($recursion) { @@ -624,11 +652,13 @@ if (empty($agents)) { $agents = []; } -$agent_font_size = 'font-size: 7px'; -$description_font_size = 'font-size: 6.5px'; -if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') { - $agent_font_size = 'font-size: 15px'; - $description_font_size = 'font-size: 11px'; +if ($config['language'] == 'ja' + || $config['language'] == 'zh_CN' + || $own_info['language'] == 'ja' + || $own_info['language'] == 'zh_CN' +) { + // Adds a custom font size for Japanese and Chinese language. + $custom_font_size = 'custom_font_size'; } // Urls to sort the table. @@ -648,7 +678,7 @@ $url_up_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente& $url_down_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_contact&sort=down'; -// Prepare pagination +// Prepare pagination. ui_pagination( $total_agents, ui_get_url_refresh(['group_id' => $group_id, 'recursion' => $recursion, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status]) @@ -744,10 +774,8 @@ foreach ($agents as $agent) { $data = []; $data[0] = '
    '; - $data[0] .= ''; - $data[0] .= ' '.$agent['alias'].''; - $data[0] .= ''; + $data[0] .= ''.$agent['alias'].''; if ($agent['quiet']) { $data[0] .= ' '; @@ -779,7 +807,7 @@ foreach ($agents as $agent) { $data[0] .= '
    '; - $data[1] = ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]', $description_font_size); + $data[1] = ''.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]').''; $data[10] = ''; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 24aa44e098..4e7e668924 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -432,7 +432,7 @@ if (!empty($addresses)) { // $data_opcional = []; $data_opcional[] = ''.__('Other IP addresses').''; if (!empty($addresses)) { - $data_opcional[] = '
    '.implode('
    ', $addresses).'
    '; + $data_opcional[] = '
    '.implode('
    ', $addresses).'
    '; } } @@ -825,7 +825,15 @@ $table_events = '
    $agent_contact = html_print_table($table_contact, true); -$agent_info = empty($table_data->data) ? '' : html_print_table($table_data, true); +if (empty($table_data->data)) { + $agent_info = ''; +} else { + if (count($table_data->data) === 1 && $config['activate_gis'] && $dataPositionAgent === false) { + $agent_info = ''; + } else { + $agent_info = html_print_table($table_data, true); + } +} $agent_incidents = !isset($table_incident) ? '' : html_print_table($table_incident, true); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index bc9c59eda5..527cef8ec5 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1018,7 +1018,7 @@ $adv_inputs[] = $in; $user_users = users_get_user_users( $config['id_user'], $access, - users_can_manage_group_all() + true ); $data = html_print_select( @@ -1539,7 +1539,7 @@ function process_datatables_callback(table, settings) { // Agent id. target = i; } - if(label == '') { + if(label == '') { // Agent id. target = i; break; @@ -1619,15 +1619,13 @@ function process_datatables_item(item) { // Show comments events. item.user_comment = item.comments - - if(item.comments.length > 80){ - item.user_comment += '  '; - item.user_comment += ' __('Show more')]); ?>'; - + if(typeof item.comments !== 'undefined' && item.comments.length > 80) { + item.user_comment += '  '; + item.user_comment += ' __('Show more')]); ?>'; } - + // Grouped events. if(item.max_id_evento) { item.id_evento = item.max_id_evento diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 298310a845..fc16470e37 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -767,7 +767,7 @@ $data[0] = __('User ack.').$jump; $user_users = users_get_user_users( $config['id_user'], $access, - users_can_manage_group_all() + users_can_manage_group_all($access) ); $data[0] .= html_print_select( diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index 0c16a16f9d..8f564bbb92 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -118,7 +118,7 @@ $now = date('Y-m-d'); // Download header. header('Content-type: text/txt'); -header('Content-Disposition: attachment; filename="pandora_export_event'.$now.'.csv"'); +header('Content-Disposition: attachment; filename="export_events_'.$now.'.csv"'); try { $fb64 = get_parameter('fb64', null); diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index 4cd5a8508e..75bb3001db 100755 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -91,10 +91,6 @@ check_login(); $id_report = (int) get_parameter('id'); $filename = (string) get_parameter('filename'); -if (empty($filename)) { - $filename = 'pandorafms_report_'.date('Y-m-d_His'); -} - $date_mode = get_parameter('date_mode', 'none'); $period = null; @@ -132,6 +128,10 @@ $report = reporting_make_reporting_data( 'static' ); +if (empty($filename)) { + $filename = $report['name'].'_report_'.date('Y-m-d_His'); +} + reporting_xml_get_report($report, $filename); exit; diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 72f24e0575..649a3814c5 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -430,15 +430,38 @@ if ($date_to_trap != '') { } if ($filter_severity != -1) { - // Test if install the enterprise to search oid in text or oid field in ttrap. - if ($config['enterprise_installed']) { - $whereSubquery .= ' AND ( - (alerted = 0 AND severity = '.$filter_severity.') OR - (alerted = 1 AND priority = '.$filter_severity.'))'; - } else { - $whereSubquery .= ' AND ( - (alerted = 0 AND 1 = '.$filter_severity.') OR - (alerted = 1 AND priority = '.$filter_severity.'))'; + // There are two special severity values aimed to match two different trap standard severities in database: warning/critical and critical/normal. + if ($filter_severity != EVENT_CRIT_OR_NORMAL && $filter_severity != EVENT_CRIT_WARNING_OR_CRITICAL) { + // Test if enterprise is installed to search oid in text or oid field in ttrap. + if ($config['enterprise_installed']) { + $whereSubquery .= ' AND ( + (alerted = 0 AND severity = '.$filter_severity.') OR + (alerted = 1 AND priority = '.$filter_severity.'))'; + } else { + $whereSubquery .= ' AND ( + (alerted = 0 AND 1 = '.$filter_severity.') OR + (alerted = 1 AND priority = '.$filter_severity.'))'; + } + } else if ($filter_severity === EVENT_CRIT_WARNING_OR_CRITICAL) { + // Test if enterprise is installed to search oid in text or oid field in ttrap. + if ($config['enterprise_installed']) { + $whereSubquery .= ' AND ( + (alerted = 0 AND (severity = '.EVENT_CRIT_WARNING.' OR severity = '.EVENT_CRIT_CRITICAL.')) OR + (alerted = 1 AND (priority = '.EVENT_CRIT_WARNING.' OR priority = '.EVENT_CRIT_CRITICAL.')))'; + } else { + $whereSubquery .= ' AND ( + (alerted = 1 AND (priority = '.EVENT_CRIT_WARNING.' OR priority = '.EVENT_CRIT_CRITICAL.')))'; + } + } else if ($filter_severity === EVENT_CRIT_OR_NORMAL) { + // Test if enterprise is installed to search oid in text or oid field in ttrap. + if ($config['enterprise_installed']) { + $whereSubquery .= ' AND ( + (alerted = 0 AND (severity = '.EVENT_CRIT_NORMAL.' OR severity = '.EVENT_CRIT_CRITICAL.')) OR + (alerted = 1 AND (priority = '.EVENT_CRIT_NORMAL.' OR priority = '.EVENT_CRIT_CRITICAL.')))'; + } else { + $whereSubquery .= ' AND ( + (alerted = 1 AND (priority = '.EVENT_CRIT_NORMAL.' OR priority = '.EVENT_CRIT_CRITICAL.')))'; + } } } diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index a662559b87..e5ae6c5f33 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.740 -%define release 191029 +%define release 191113 # User and Group under which Apache is running %define httpd_name httpd @@ -57,6 +57,13 @@ install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/l rm -rf $RPM_BUILD_ROOT %post +# Install pandora_websocket_engine service. +cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/ +chmod +x /etc/init.d/pandora_websocket_engine + +echo "You can now start the Pandora FMS Websocket service by executing" +echo " /etc/init.d/pandora_websocket_engine start" + # Has an install already been done, if so we only want to update the files # push install.php aside so that the console works immediately using existing # configuration. diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 91f5bebedf..26987ff319 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.740 -%define release 191029 +%define release 191113 # User and Group under which Apache is running %define httpd_name httpd @@ -57,6 +57,13 @@ install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/l rm -rf $RPM_BUILD_ROOT %post +# Install pandora_websocket_engine service. +cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/ +chmod +x /etc/init.d/pandora_websocket_engine + +echo "You can now start the Pandora FMS Websocket service by executing" +echo " /etc/init.d/pandora_websocket_engine start" + # Has an install already been done, if so we only want to update the files # push install.php aside so that the console works immediately using existing # configuration. diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 1aa902495e..6aeac2389f 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.740 -%define release 191029 +%define release 191113 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 @@ -58,6 +58,13 @@ fi rm -rf $RPM_BUILD_ROOT %post +# Install pandora_websocket_engine service. +cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/ +chmod +x /etc/init.d/pandora_websocket_engine + +echo "You can now start the Pandora FMS Websocket service by executing" +echo " /etc/init.d/pandora_websocket_engine start" + # Has an install already been done, if so we only want to update the files # push install.php aside so that the console works immediately using existing # configuration. diff --git a/pandora_console/pandora_websocket_engine b/pandora_console/pandora_websocket_engine new file mode 100755 index 0000000000..871009eb9d --- /dev/null +++ b/pandora_console/pandora_websocket_engine @@ -0,0 +1,175 @@ +#!/bin/bash +# Copyright (c) 2005-2019 Artica ST +# +# /etc/init.d/websocket +# +# System startup script for Pandora FMS Console websocket engine +# +# Comments to support chkconfig on RedHat Linux +# chkconfig: 2345 90 10 +# description: Pandora FMS Console webscoket engine startup script +# +# Comments to support LSB init script conventions +### BEGIN INIT INFO +# Provides: websocket +# Required-Start: $syslog cron +# Should-Start: $network cron mysql +# Required-Stop: $syslog +# Should-Stop: $network +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 +# Short-Description: Pandora FMS Console websocket engine startup script +# Description: Pandora FMS Console websocket engine startup script +### END INIT INFO + +if [ -x /lib/lsb/init-functions ]; then +. /lib/lsb/init-functions +fi + +# If you want to run several pandora Console Websocket engines in this machine, just copy +# this script to another name, editing PANDORA_HOME to the new .conf + +export WS_ENGINE="/var/www/html/pandora_console/ws.php" +export PHP=/usr/bin/php +export WS_LOG="/var/www/html/pandora_console/pandora_console.log" +export GOTTY="/tmp/" + +# Environment variables +if [[ -z ${PANDORA_RB_PRODUCT_NAME} ]]; then + PANDORA_RB_PRODUCT_NAME="Pandora FMS" +fi +if [[ -z ${PANDORA_RB_COPYRIGHT_NOTICE} ]]; then + PANDORA_RB_COPYRIGHT_NOTICE="Artica ST" +fi + +export PANDORA_RB_PRODUCT_NAME=$PANDORA_RB_PRODUCT_NAME +export PANDORA_RB_COPYRIGHT_NOTICE=$PANDORA_RB_COPYRIGHT_NOTICE + +# Uses a wait limit before sending a KILL signal, before trying to stop +# Pandora FMS Console Websocket engine nicely. Some big systems need some time before close +# all pending tasks / threads. + +export MAXWAIT=60 + +# Check for SUSE status scripts +if [ -f /etc/rc.status ] +then + . /etc/rc.status + rc_reset +else + # Define part of rc functions for non-suse systems + function rc_status () { + RETVAL=$? + case $1 in + -v) RETVAL=0;; + esac + } + function rc_exit () { exit $RETVAL; } + function rc_failed () { RETVAL=${1:-1}; } + RETVAL=0 +fi + +# This function replace pidof, not working in the same way in different linux distros + +function pidof_pandora () { + # This sets COLUMNS to XXX chars, because if command is run + # in a "strech" term, ps aux don't report more than COLUMNS + # characters and this will not work. + COLUMNS=300 + PANDORA_PID=`ps aux | grep "$PHP $WS_ENGINE" | grep -v grep | tail -1 | awk '{ print $2 }'` + echo $PANDORA_PID +} + +# Main script + +if [ ! -x $GOTTY ] +then + echo "Gotty not found in $GOTTY" + rc_failed 5 # program is not installed + rc_exit +fi + +if [ ! -f $PHP ] +then + echo "$PHP not found, please install version >= 7.0" + rc_failed 5 # program is not installed + rc_exit +fi + +case "$1" in + start) + PANDORA_PID=`pidof_pandora` + if [ ! -z "$PANDORA_PID" ] + then + echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is currently running on this machine with PID ($PANDORA_PID)." + rc_exit # running start on a service already running + fi + + export PERL_LWP_SSL_VERIFY_HOSTNAME=0 + $PHP $WS_ENGINE >> $WS_LOG 2>&1 & + sleep 1 + + PANDORA_PID=`pidof_pandora` + + if [ ! -z "$PANDORA_PID" ] + then + echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is now running with PID $PANDORA_PID" + rc_status -v + else + echo "Cannot start $PANDORA_RB_PRODUCT_NAME Console Websocket engine. Aborted." + echo "Check $PANDORA_RB_PRODUCT_NAME log files at $WS_LOG" + rc_failed 7 # program is not running + fi + ;; + + stop) + PANDORA_PID=`pidof_pandora` + if [ -z "$PANDORA_PID" ] + then + echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running, cannot stop it." + rc_exit # running stop on a service already stopped or not running + else + echo "Stopping $PANDORA_RB_PRODUCT_NAME Console Websocket engine" + kill $PANDORA_PID > /dev/null 2>&1 + COUNTER=0 + + while [ $COUNTER -lt $MAXWAIT ] + do + _PID=`pidof_pandora` + if [ "$_PID" != "$PANDORA_PID" ] + then + COUNTER=$MAXWAIT + fi + COUNTER=`expr $COUNTER + 1` + sleep 1 + done + + # Send a KILL -9 signal to process, if it's alive after 60secs, we need + # to be sure is really dead, and not pretending... + if [ "$_PID" = "$PANDORA_PID" ] + then + kill -9 $PANDORA_PID > /dev/null 2>&1 + fi + rc_status -v + fi + ;; + status) + PANDORA_PID=`pidof_pandora` + if [ -z "$PANDORA_PID" ] + then + echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running." + rc_failed 7 # program is not running + else + echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is running with PID $PANDORA_PID." + rc_status + fi + ;; + force-reload|restart) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 { start | stop | restart | status }" + exit 1 +esac +rc_exit diff --git a/pandora_console/pandora_websocket_engine.service b/pandora_console/pandora_websocket_engine.service new file mode 100644 index 0000000000..fe19ff1490 --- /dev/null +++ b/pandora_console/pandora_websocket_engine.service @@ -0,0 +1,19 @@ +[Unit] +Description=php webSocket +After=syslog.target network.target + +[Service] +User=apache + +Type=simple +ExecStart=php /var/www/html/pandora_console/ws.php >> /var/www/html/pandora_console/pandora_console.log 2>&1 +TimeoutStopSec=20 +KillMode=process +Restart=always +RestartSec=2 +StandardOutput=file:/var/www/html/pandora_console/pandora_console.log +StandardError=file:/var/www/html/pandora_console/pandora_console.log + +[Install] +WantedBy=multi-user.target +Alias=websocket.service \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 3786c4dad3..3b11dccb4d 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3522,6 +3522,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `time_format` varchar(60) NOT NULL default "time", `timezone` varchar(60) NOT NULL default "Europe/Madrid", `show_last_value` tinyint(1) UNSIGNED NULL default '0', + `cache_expiration` INTEGER UNSIGNED NOT NULL default 0, PRIMARY KEY(`id`), FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index aac7b708fb..4dd4f84f7f 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -138,7 +138,9 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_type', ''), ('cr_incident_status', ''), ('cr_incident_title', ''), -('cr_incident_content', ''); +('cr_incident_content', ''), +('sample_agent', '0'), +('gotty', '/usr/bin/gotty'); UNLOCK TABLES; -- diff --git a/pandora_console/vendor/composer/LICENSE b/pandora_console/vendor/composer/LICENSE index f27399a042..62ecfd8d00 100644 --- a/pandora_console/vendor/composer/LICENSE +++ b/pandora_console/vendor/composer/LICENSE @@ -1,4 +1,3 @@ - Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/pandora_console/vendor/composer/autoload_classmap.php b/pandora_console/vendor/composer/autoload_classmap.php index 45ec80bd52..47754b95f5 100644 --- a/pandora_console/vendor/composer/autoload_classmap.php +++ b/pandora_console/vendor/composer/autoload_classmap.php @@ -6,11 +6,321 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'DeepCopy\\DeepCopy' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php', + 'DeepCopy\\Exception\\CloneException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php', + 'DeepCopy\\Exception\\PropertyException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php', + 'DeepCopy\\Filter\\Filter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php', + 'DeepCopy\\Filter\\KeepFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php', + 'DeepCopy\\Filter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php', + 'DeepCopy\\Filter\\SetNullFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php', + 'DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php', + 'DeepCopy\\Matcher\\Matcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php', + 'DeepCopy\\Matcher\\PropertyMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php', + 'DeepCopy\\Matcher\\PropertyNameMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php', + 'DeepCopy\\Matcher\\PropertyTypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', + 'DeepCopy\\Reflection\\ReflectionHelper' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', + 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', + 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', + 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php', + 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php', + 'DeepCopy\\TypeFilter\\TypeFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php', + 'DeepCopy\\TypeMatcher\\TypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php', + 'Doctrine\\Common\\Lexer\\AbstractLexer' => $vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php', + 'Egulias\\EmailValidator\\EmailLexer' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailLexer.php', + 'Egulias\\EmailValidator\\EmailParser' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailParser.php', + 'Egulias\\EmailValidator\\EmailValidator' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailValidator.php', + 'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php', + 'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRLFAtTheEnd.php', + 'Egulias\\EmailValidator\\Exception\\CRLFX2' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRLFX2.php', + 'Egulias\\EmailValidator\\Exception\\CRNoLF' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRNoLF.php', + 'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CharNotAllowed.php', + 'Egulias\\EmailValidator\\Exception\\CommaInDomain' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CommaInDomain.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveAt.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveDot.php', + 'Egulias\\EmailValidator\\Exception\\DomainHyphened' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DomainHyphened.php', + 'Egulias\\EmailValidator\\Exception\\DotAtEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DotAtEnd.php', + 'Egulias\\EmailValidator\\Exception\\DotAtStart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DotAtStart.php', + 'Egulias\\EmailValidator\\Exception\\ExpectedQPair' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingQPair.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingAT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingAT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingATEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingCTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingDTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingDomainLiteralClose.php', + 'Egulias\\EmailValidator\\Exception\\InvalidEmail' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/InvalidEmail.php', + 'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoDNSRecord.php', + 'Egulias\\EmailValidator\\Exception\\NoDomainPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoDomainPart.php', + 'Egulias\\EmailValidator\\Exception\\NoLocalPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoLocalPart.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnclosedComment.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnclosedQuotedString.php', + 'Egulias\\EmailValidator\\Exception\\UnopenedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnopenedComment.php', + 'Egulias\\EmailValidator\\Parser\\DomainPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/DomainPart.php', + 'Egulias\\EmailValidator\\Parser\\LocalPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/LocalPart.php', + 'Egulias\\EmailValidator\\Parser\\Parser' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/Parser.php', + 'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php', + 'Egulias\\EmailValidator\\Validation\\EmailValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/EmailValidation.php', + 'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Error/RFCWarnings.php', + 'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Error/SpoofEmail.php', + 'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Exception/EmptyValidationList.php', + 'Egulias\\EmailValidator\\Validation\\MultipleErrors' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/MultipleErrors.php', + 'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php', + 'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php', + 'Egulias\\EmailValidator\\Validation\\RFCValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/RFCValidation.php', + 'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php', + 'Egulias\\EmailValidator\\Warning\\AddressLiteral' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php', + 'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php', + 'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php', + 'Egulias\\EmailValidator\\Warning\\Comment' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/Comment.php', + 'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php', + 'Egulias\\EmailValidator\\Warning\\DomainLiteral' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php', + 'Egulias\\EmailValidator\\Warning\\DomainTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php', + 'Egulias\\EmailValidator\\Warning\\EmailTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php', + 'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php', + 'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php', + 'Egulias\\EmailValidator\\Warning\\IPV6ColonStart' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php', + 'Egulias\\EmailValidator\\Warning\\IPV6Deprecated' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php', + 'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php', + 'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php', + 'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php', + 'Egulias\\EmailValidator\\Warning\\LabelTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php', + 'Egulias\\EmailValidator\\Warning\\LocalTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php', + 'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php', + 'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php', + 'Egulias\\EmailValidator\\Warning\\QuotedPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/QuotedPart.php', + 'Egulias\\EmailValidator\\Warning\\QuotedString' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/QuotedString.php', + 'Egulias\\EmailValidator\\Warning\\TLD' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/TLD.php', + 'Egulias\\EmailValidator\\Warning\\Warning' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/Warning.php', 'FPDF_TPL' => $vendorDir . '/setasign/fpdi/fpdf_tpl.php', 'FPDI' => $vendorDir . '/setasign/fpdi/fpdi.php', 'FilterASCII85' => $vendorDir . '/setasign/fpdi/filters/FilterASCII85.php', 'FilterASCIIHexDecode' => $vendorDir . '/setasign/fpdi/filters/FilterASCIIHexDecode.php', 'FilterLZW' => $vendorDir . '/setasign/fpdi/filters/FilterLZW.php', + 'Models\\CachedModel' => $baseDir . '/include/rest-api/models/CachedModel.php', + 'Models\\Model' => $baseDir . '/include/rest-api/models/Model.php', + 'Models\\VisualConsole\\Container' => $baseDir . '/include/rest-api/models/VisualConsole/Container.php', + 'Models\\VisualConsole\\Item' => $baseDir . '/include/rest-api/models/VisualConsole/Item.php', + 'Models\\VisualConsole\\Items\\BarsGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/BarsGraph.php', + 'Models\\VisualConsole\\Items\\Box' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Box.php', + 'Models\\VisualConsole\\Items\\Clock' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Clock.php', + 'Models\\VisualConsole\\Items\\ColorCloud' => $baseDir . '/include/rest-api/models/VisualConsole/Items/ColorCloud.php', + 'Models\\VisualConsole\\Items\\DonutGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/DonutGraph.php', + 'Models\\VisualConsole\\Items\\EventsHistory' => $baseDir . '/include/rest-api/models/VisualConsole/Items/EventsHistory.php', + 'Models\\VisualConsole\\Items\\Group' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Group.php', + 'Models\\VisualConsole\\Items\\Icon' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Icon.php', + 'Models\\VisualConsole\\Items\\Label' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Label.php', + 'Models\\VisualConsole\\Items\\Line' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Line.php', + 'Models\\VisualConsole\\Items\\ModuleGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/ModuleGraph.php', + 'Models\\VisualConsole\\Items\\Percentile' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Percentile.php', + 'Models\\VisualConsole\\Items\\SimpleValue' => $baseDir . '/include/rest-api/models/VisualConsole/Items/SimpleValue.php', + 'Models\\VisualConsole\\Items\\StaticGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/StaticGraph.php', + 'Mpdf\\Barcode' => $vendorDir . '/mpdf/mpdf/src/Barcode.php', + 'Mpdf\\Barcode\\AbstractBarcode' => $vendorDir . '/mpdf/mpdf/src/Barcode/AbstractBarcode.php', + 'Mpdf\\Barcode\\BarcodeException' => $vendorDir . '/mpdf/mpdf/src/Barcode/BarcodeException.php', + 'Mpdf\\Barcode\\BarcodeInterface' => $vendorDir . '/mpdf/mpdf/src/Barcode/BarcodeInterface.php', + 'Mpdf\\Barcode\\Codabar' => $vendorDir . '/mpdf/mpdf/src/Barcode/Codabar.php', + 'Mpdf\\Barcode\\Code11' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code11.php', + 'Mpdf\\Barcode\\Code128' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code128.php', + 'Mpdf\\Barcode\\Code39' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code39.php', + 'Mpdf\\Barcode\\Code93' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code93.php', + 'Mpdf\\Barcode\\EanExt' => $vendorDir . '/mpdf/mpdf/src/Barcode/EanExt.php', + 'Mpdf\\Barcode\\EanUpc' => $vendorDir . '/mpdf/mpdf/src/Barcode/EanUpc.php', + 'Mpdf\\Barcode\\I25' => $vendorDir . '/mpdf/mpdf/src/Barcode/I25.php', + 'Mpdf\\Barcode\\Imb' => $vendorDir . '/mpdf/mpdf/src/Barcode/Imb.php', + 'Mpdf\\Barcode\\Msi' => $vendorDir . '/mpdf/mpdf/src/Barcode/Msi.php', + 'Mpdf\\Barcode\\Postnet' => $vendorDir . '/mpdf/mpdf/src/Barcode/Postnet.php', + 'Mpdf\\Barcode\\Rm4Scc' => $vendorDir . '/mpdf/mpdf/src/Barcode/Rm4Scc.php', + 'Mpdf\\Barcode\\S25' => $vendorDir . '/mpdf/mpdf/src/Barcode/S25.php', + 'Mpdf\\Cache' => $vendorDir . '/mpdf/mpdf/src/Cache.php', + 'Mpdf\\Color\\ColorConverter' => $vendorDir . '/mpdf/mpdf/src/Color/ColorConverter.php', + 'Mpdf\\Color\\ColorModeConverter' => $vendorDir . '/mpdf/mpdf/src/Color/ColorModeConverter.php', + 'Mpdf\\Color\\ColorSpaceRestrictor' => $vendorDir . '/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php', + 'Mpdf\\Color\\NamedColors' => $vendorDir . '/mpdf/mpdf/src/Color/NamedColors.php', + 'Mpdf\\Config\\ConfigVariables' => $vendorDir . '/mpdf/mpdf/src/Config/ConfigVariables.php', + 'Mpdf\\Config\\FontVariables' => $vendorDir . '/mpdf/mpdf/src/Config/FontVariables.php', + 'Mpdf\\Conversion\\DecToAlpha' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToAlpha.php', + 'Mpdf\\Conversion\\DecToCjk' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToCjk.php', + 'Mpdf\\Conversion\\DecToHebrew' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToHebrew.php', + 'Mpdf\\Conversion\\DecToOther' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToOther.php', + 'Mpdf\\Conversion\\DecToRoman' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToRoman.php', + 'Mpdf\\CssManager' => $vendorDir . '/mpdf/mpdf/src/CssManager.php', + 'Mpdf\\Css\\Border' => $vendorDir . '/mpdf/mpdf/src/Css/Border.php', + 'Mpdf\\Css\\DefaultCss' => $vendorDir . '/mpdf/mpdf/src/Css/DefaultCss.php', + 'Mpdf\\Css\\TextVars' => $vendorDir . '/mpdf/mpdf/src/Css/TextVars.php', + 'Mpdf\\DirectWrite' => $vendorDir . '/mpdf/mpdf/src/DirectWrite.php', + 'Mpdf\\Exception\\InvalidArgumentException' => $vendorDir . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php', + 'Mpdf\\Fonts\\FontCache' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontCache.php', + 'Mpdf\\Fonts\\FontFileFinder' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontFileFinder.php', + 'Mpdf\\Fonts\\GlyphOperator' => $vendorDir . '/mpdf/mpdf/src/Fonts/GlyphOperator.php', + 'Mpdf\\Fonts\\MetricsGenerator' => $vendorDir . '/mpdf/mpdf/src/Fonts/MetricsGenerator.php', + 'Mpdf\\Form' => $vendorDir . '/mpdf/mpdf/src/Form.php', + 'Mpdf\\Gif\\ColorTable' => $vendorDir . '/mpdf/mpdf/src/Gif/ColorTable.php', + 'Mpdf\\Gif\\FileHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/FileHeader.php', + 'Mpdf\\Gif\\Gif' => $vendorDir . '/mpdf/mpdf/src/Gif/Gif.php', + 'Mpdf\\Gif\\Image' => $vendorDir . '/mpdf/mpdf/src/Gif/Image.php', + 'Mpdf\\Gif\\ImageHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/ImageHeader.php', + 'Mpdf\\Gif\\Lzw' => $vendorDir . '/mpdf/mpdf/src/Gif/Lzw.php', + 'Mpdf\\Gradient' => $vendorDir . '/mpdf/mpdf/src/Gradient.php', + 'Mpdf\\Hyphenator' => $vendorDir . '/mpdf/mpdf/src/Hyphenator.php', + 'Mpdf\\Image\\Bmp' => $vendorDir . '/mpdf/mpdf/src/Image/Bmp.php', + 'Mpdf\\Image\\ImageProcessor' => $vendorDir . '/mpdf/mpdf/src/Image/ImageProcessor.php', + 'Mpdf\\Image\\ImageTypeGuesser' => $vendorDir . '/mpdf/mpdf/src/Image/ImageTypeGuesser.php', + 'Mpdf\\Image\\Svg' => $vendorDir . '/mpdf/mpdf/src/Image/Svg.php', + 'Mpdf\\Image\\Wmf' => $vendorDir . '/mpdf/mpdf/src/Image/Wmf.php', + 'Mpdf\\Language\\LanguageToFont' => $vendorDir . '/mpdf/mpdf/src/Language/LanguageToFont.php', + 'Mpdf\\Language\\LanguageToFontInterface' => $vendorDir . '/mpdf/mpdf/src/Language/LanguageToFontInterface.php', + 'Mpdf\\Language\\ScriptToLanguage' => $vendorDir . '/mpdf/mpdf/src/Language/ScriptToLanguage.php', + 'Mpdf\\Language\\ScriptToLanguageInterface' => $vendorDir . '/mpdf/mpdf/src/Language/ScriptToLanguageInterface.php', + 'Mpdf\\Log\\Context' => $vendorDir . '/mpdf/mpdf/src/Log/Context.php', + 'Mpdf\\Mpdf' => $vendorDir . '/mpdf/mpdf/src/Mpdf.php', + 'Mpdf\\MpdfException' => $vendorDir . '/mpdf/mpdf/src/MpdfException.php', + 'Mpdf\\MpdfImageException' => $vendorDir . '/mpdf/mpdf/src/MpdfImageException.php', + 'Mpdf\\Otl' => $vendorDir . '/mpdf/mpdf/src/Otl.php', + 'Mpdf\\OtlDump' => $vendorDir . '/mpdf/mpdf/src/OtlDump.php', + 'Mpdf\\Output\\Destination' => $vendorDir . '/mpdf/mpdf/src/Output/Destination.php', + 'Mpdf\\PageFormat' => $vendorDir . '/mpdf/mpdf/src/PageFormat.php', + 'Mpdf\\Pdf\\Protection' => $vendorDir . '/mpdf/mpdf/src/Pdf/Protection.php', + 'Mpdf\\Pdf\\Protection\\UniqidGenerator' => $vendorDir . '/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php', + 'Mpdf\\QrCode\\QrCode' => $vendorDir . '/mpdf/mpdf/src/QrCode/QrCode.php', + 'Mpdf\\QrCode\\QrCodeException' => $vendorDir . '/mpdf/mpdf/src/QrCode/QrCodeException.php', + 'Mpdf\\Shaper\\Indic' => $vendorDir . '/mpdf/mpdf/src/Shaper/Indic.php', + 'Mpdf\\Shaper\\Myanmar' => $vendorDir . '/mpdf/mpdf/src/Shaper/Myanmar.php', + 'Mpdf\\Shaper\\Sea' => $vendorDir . '/mpdf/mpdf/src/Shaper/Sea.php', + 'Mpdf\\SizeConverter' => $vendorDir . '/mpdf/mpdf/src/SizeConverter.php', + 'Mpdf\\TTFontFile' => $vendorDir . '/mpdf/mpdf/src/TTFontFile.php', + 'Mpdf\\TTFontFileAnalysis' => $vendorDir . '/mpdf/mpdf/src/TTFontFileAnalysis.php', + 'Mpdf\\TableOfContents' => $vendorDir . '/mpdf/mpdf/src/TableOfContents.php', + 'Mpdf\\Tag' => $vendorDir . '/mpdf/mpdf/src/Tag.php', + 'Mpdf\\Tag\\A' => $vendorDir . '/mpdf/mpdf/src/Tag/A.php', + 'Mpdf\\Tag\\Acronym' => $vendorDir . '/mpdf/mpdf/src/Tag/Acronym.php', + 'Mpdf\\Tag\\Address' => $vendorDir . '/mpdf/mpdf/src/Tag/Address.php', + 'Mpdf\\Tag\\Annotation' => $vendorDir . '/mpdf/mpdf/src/Tag/Annotation.php', + 'Mpdf\\Tag\\Article' => $vendorDir . '/mpdf/mpdf/src/Tag/Article.php', + 'Mpdf\\Tag\\Aside' => $vendorDir . '/mpdf/mpdf/src/Tag/Aside.php', + 'Mpdf\\Tag\\B' => $vendorDir . '/mpdf/mpdf/src/Tag/B.php', + 'Mpdf\\Tag\\BarCode' => $vendorDir . '/mpdf/mpdf/src/Tag/BarCode.php', + 'Mpdf\\Tag\\Bdi' => $vendorDir . '/mpdf/mpdf/src/Tag/Bdi.php', + 'Mpdf\\Tag\\Bdo' => $vendorDir . '/mpdf/mpdf/src/Tag/Bdo.php', + 'Mpdf\\Tag\\Big' => $vendorDir . '/mpdf/mpdf/src/Tag/Big.php', + 'Mpdf\\Tag\\BlockQuote' => $vendorDir . '/mpdf/mpdf/src/Tag/BlockQuote.php', + 'Mpdf\\Tag\\BlockTag' => $vendorDir . '/mpdf/mpdf/src/Tag/BlockTag.php', + 'Mpdf\\Tag\\Bookmark' => $vendorDir . '/mpdf/mpdf/src/Tag/Bookmark.php', + 'Mpdf\\Tag\\Br' => $vendorDir . '/mpdf/mpdf/src/Tag/Br.php', + 'Mpdf\\Tag\\Caption' => $vendorDir . '/mpdf/mpdf/src/Tag/Caption.php', + 'Mpdf\\Tag\\Center' => $vendorDir . '/mpdf/mpdf/src/Tag/Center.php', + 'Mpdf\\Tag\\Cite' => $vendorDir . '/mpdf/mpdf/src/Tag/Cite.php', + 'Mpdf\\Tag\\Code' => $vendorDir . '/mpdf/mpdf/src/Tag/Code.php', + 'Mpdf\\Tag\\ColumnBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/ColumnBreak.php', + 'Mpdf\\Tag\\Columns' => $vendorDir . '/mpdf/mpdf/src/Tag/Columns.php', + 'Mpdf\\Tag\\Dd' => $vendorDir . '/mpdf/mpdf/src/Tag/Dd.php', + 'Mpdf\\Tag\\Del' => $vendorDir . '/mpdf/mpdf/src/Tag/Del.php', + 'Mpdf\\Tag\\Details' => $vendorDir . '/mpdf/mpdf/src/Tag/Details.php', + 'Mpdf\\Tag\\Div' => $vendorDir . '/mpdf/mpdf/src/Tag/Div.php', + 'Mpdf\\Tag\\Dl' => $vendorDir . '/mpdf/mpdf/src/Tag/Dl.php', + 'Mpdf\\Tag\\DotTab' => $vendorDir . '/mpdf/mpdf/src/Tag/DotTab.php', + 'Mpdf\\Tag\\Dt' => $vendorDir . '/mpdf/mpdf/src/Tag/Dt.php', + 'Mpdf\\Tag\\Em' => $vendorDir . '/mpdf/mpdf/src/Tag/Em.php', + 'Mpdf\\Tag\\FieldSet' => $vendorDir . '/mpdf/mpdf/src/Tag/FieldSet.php', + 'Mpdf\\Tag\\FigCaption' => $vendorDir . '/mpdf/mpdf/src/Tag/FigCaption.php', + 'Mpdf\\Tag\\Figure' => $vendorDir . '/mpdf/mpdf/src/Tag/Figure.php', + 'Mpdf\\Tag\\Font' => $vendorDir . '/mpdf/mpdf/src/Tag/Font.php', + 'Mpdf\\Tag\\Footer' => $vendorDir . '/mpdf/mpdf/src/Tag/Footer.php', + 'Mpdf\\Tag\\Form' => $vendorDir . '/mpdf/mpdf/src/Tag/Form.php', + 'Mpdf\\Tag\\FormFeed' => $vendorDir . '/mpdf/mpdf/src/Tag/FormFeed.php', + 'Mpdf\\Tag\\H1' => $vendorDir . '/mpdf/mpdf/src/Tag/H1.php', + 'Mpdf\\Tag\\H2' => $vendorDir . '/mpdf/mpdf/src/Tag/H2.php', + 'Mpdf\\Tag\\H3' => $vendorDir . '/mpdf/mpdf/src/Tag/H3.php', + 'Mpdf\\Tag\\H4' => $vendorDir . '/mpdf/mpdf/src/Tag/H4.php', + 'Mpdf\\Tag\\H5' => $vendorDir . '/mpdf/mpdf/src/Tag/H5.php', + 'Mpdf\\Tag\\H6' => $vendorDir . '/mpdf/mpdf/src/Tag/H6.php', + 'Mpdf\\Tag\\HGroup' => $vendorDir . '/mpdf/mpdf/src/Tag/HGroup.php', + 'Mpdf\\Tag\\Header' => $vendorDir . '/mpdf/mpdf/src/Tag/Header.php', + 'Mpdf\\Tag\\Hr' => $vendorDir . '/mpdf/mpdf/src/Tag/Hr.php', + 'Mpdf\\Tag\\I' => $vendorDir . '/mpdf/mpdf/src/Tag/I.php', + 'Mpdf\\Tag\\Img' => $vendorDir . '/mpdf/mpdf/src/Tag/Img.php', + 'Mpdf\\Tag\\IndexEntry' => $vendorDir . '/mpdf/mpdf/src/Tag/IndexEntry.php', + 'Mpdf\\Tag\\IndexInsert' => $vendorDir . '/mpdf/mpdf/src/Tag/IndexInsert.php', + 'Mpdf\\Tag\\InlineTag' => $vendorDir . '/mpdf/mpdf/src/Tag/InlineTag.php', + 'Mpdf\\Tag\\Input' => $vendorDir . '/mpdf/mpdf/src/Tag/Input.php', + 'Mpdf\\Tag\\Ins' => $vendorDir . '/mpdf/mpdf/src/Tag/Ins.php', + 'Mpdf\\Tag\\Kbd' => $vendorDir . '/mpdf/mpdf/src/Tag/Kbd.php', + 'Mpdf\\Tag\\Legend' => $vendorDir . '/mpdf/mpdf/src/Tag/Legend.php', + 'Mpdf\\Tag\\Li' => $vendorDir . '/mpdf/mpdf/src/Tag/Li.php', + 'Mpdf\\Tag\\Main' => $vendorDir . '/mpdf/mpdf/src/Tag/Main.php', + 'Mpdf\\Tag\\Mark' => $vendorDir . '/mpdf/mpdf/src/Tag/Mark.php', + 'Mpdf\\Tag\\Meter' => $vendorDir . '/mpdf/mpdf/src/Tag/Meter.php', + 'Mpdf\\Tag\\Nav' => $vendorDir . '/mpdf/mpdf/src/Tag/Nav.php', + 'Mpdf\\Tag\\NewColumn' => $vendorDir . '/mpdf/mpdf/src/Tag/NewColumn.php', + 'Mpdf\\Tag\\NewPage' => $vendorDir . '/mpdf/mpdf/src/Tag/NewPage.php', + 'Mpdf\\Tag\\Ol' => $vendorDir . '/mpdf/mpdf/src/Tag/Ol.php', + 'Mpdf\\Tag\\Option' => $vendorDir . '/mpdf/mpdf/src/Tag/Option.php', + 'Mpdf\\Tag\\P' => $vendorDir . '/mpdf/mpdf/src/Tag/P.php', + 'Mpdf\\Tag\\PageBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/PageBreak.php', + 'Mpdf\\Tag\\PageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/PageFooter.php', + 'Mpdf\\Tag\\PageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/PageHeader.php', + 'Mpdf\\Tag\\Pre' => $vendorDir . '/mpdf/mpdf/src/Tag/Pre.php', + 'Mpdf\\Tag\\Progress' => $vendorDir . '/mpdf/mpdf/src/Tag/Progress.php', + 'Mpdf\\Tag\\Q' => $vendorDir . '/mpdf/mpdf/src/Tag/Q.php', + 'Mpdf\\Tag\\S' => $vendorDir . '/mpdf/mpdf/src/Tag/S.php', + 'Mpdf\\Tag\\Samp' => $vendorDir . '/mpdf/mpdf/src/Tag/Samp.php', + 'Mpdf\\Tag\\Section' => $vendorDir . '/mpdf/mpdf/src/Tag/Section.php', + 'Mpdf\\Tag\\Select' => $vendorDir . '/mpdf/mpdf/src/Tag/Select.php', + 'Mpdf\\Tag\\SetHtmlPageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/SetHtmlPageFooter.php', + 'Mpdf\\Tag\\SetHtmlPageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/SetHtmlPageHeader.php', + 'Mpdf\\Tag\\SetPageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/SetPageFooter.php', + 'Mpdf\\Tag\\SetPageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/SetPageHeader.php', + 'Mpdf\\Tag\\Small' => $vendorDir . '/mpdf/mpdf/src/Tag/Small.php', + 'Mpdf\\Tag\\Span' => $vendorDir . '/mpdf/mpdf/src/Tag/Span.php', + 'Mpdf\\Tag\\Strike' => $vendorDir . '/mpdf/mpdf/src/Tag/Strike.php', + 'Mpdf\\Tag\\Strong' => $vendorDir . '/mpdf/mpdf/src/Tag/Strong.php', + 'Mpdf\\Tag\\Sub' => $vendorDir . '/mpdf/mpdf/src/Tag/Sub.php', + 'Mpdf\\Tag\\SubstituteTag' => $vendorDir . '/mpdf/mpdf/src/Tag/SubstituteTag.php', + 'Mpdf\\Tag\\Summary' => $vendorDir . '/mpdf/mpdf/src/Tag/Summary.php', + 'Mpdf\\Tag\\Sup' => $vendorDir . '/mpdf/mpdf/src/Tag/Sup.php', + 'Mpdf\\Tag\\TBody' => $vendorDir . '/mpdf/mpdf/src/Tag/TBody.php', + 'Mpdf\\Tag\\TFoot' => $vendorDir . '/mpdf/mpdf/src/Tag/TFoot.php', + 'Mpdf\\Tag\\THead' => $vendorDir . '/mpdf/mpdf/src/Tag/THead.php', + 'Mpdf\\Tag\\Table' => $vendorDir . '/mpdf/mpdf/src/Tag/Table.php', + 'Mpdf\\Tag\\Tag' => $vendorDir . '/mpdf/mpdf/src/Tag/Tag.php', + 'Mpdf\\Tag\\Td' => $vendorDir . '/mpdf/mpdf/src/Tag/Td.php', + 'Mpdf\\Tag\\TextArea' => $vendorDir . '/mpdf/mpdf/src/Tag/TextArea.php', + 'Mpdf\\Tag\\TextCircle' => $vendorDir . '/mpdf/mpdf/src/Tag/TextCircle.php', + 'Mpdf\\Tag\\Th' => $vendorDir . '/mpdf/mpdf/src/Tag/Th.php', + 'Mpdf\\Tag\\Time' => $vendorDir . '/mpdf/mpdf/src/Tag/Time.php', + 'Mpdf\\Tag\\Toc' => $vendorDir . '/mpdf/mpdf/src/Tag/Toc.php', + 'Mpdf\\Tag\\TocEntry' => $vendorDir . '/mpdf/mpdf/src/Tag/TocEntry.php', + 'Mpdf\\Tag\\TocPageBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/TocPageBreak.php', + 'Mpdf\\Tag\\Tr' => $vendorDir . '/mpdf/mpdf/src/Tag/Tr.php', + 'Mpdf\\Tag\\Tt' => $vendorDir . '/mpdf/mpdf/src/Tag/Tt.php', + 'Mpdf\\Tag\\Tta' => $vendorDir . '/mpdf/mpdf/src/Tag/Tta.php', + 'Mpdf\\Tag\\Tts' => $vendorDir . '/mpdf/mpdf/src/Tag/Tts.php', + 'Mpdf\\Tag\\Ttz' => $vendorDir . '/mpdf/mpdf/src/Tag/Ttz.php', + 'Mpdf\\Tag\\U' => $vendorDir . '/mpdf/mpdf/src/Tag/U.php', + 'Mpdf\\Tag\\Ul' => $vendorDir . '/mpdf/mpdf/src/Tag/Ul.php', + 'Mpdf\\Tag\\VarTag' => $vendorDir . '/mpdf/mpdf/src/Tag/VarTag.php', + 'Mpdf\\Tag\\WatermarkImage' => $vendorDir . '/mpdf/mpdf/src/Tag/WatermarkImage.php', + 'Mpdf\\Tag\\WatermarkText' => $vendorDir . '/mpdf/mpdf/src/Tag/WatermarkText.php', + 'Mpdf\\Ucdn' => $vendorDir . '/mpdf/mpdf/src/Ucdn.php', + 'Mpdf\\Utils\\Arrays' => $vendorDir . '/mpdf/mpdf/src/Utils/Arrays.php', + 'Mpdf\\Utils\\NumericString' => $vendorDir . '/mpdf/mpdf/src/Utils/NumericString.php', + 'Mpdf\\Utils\\PdfDate' => $vendorDir . '/mpdf/mpdf/src/Utils/PdfDate.php', + 'Mpdf\\Utils\\UtfString' => $vendorDir . '/mpdf/mpdf/src/Utils/UtfString.php', + 'PandoraFMS\\User' => $baseDir . '/include/lib/User.php', + 'PandoraFMS\\WebSockets\\WSManager' => $baseDir . '/include/lib/WSManager.php', + 'PandoraFMS\\Websockets\\WebSocketServer' => $baseDir . '/include/lib/WebSocketServer.php', + 'PandoraFMS\\Websockets\\WebSocketUser' => $baseDir . '/include/lib/WebSocketUser.php', + 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'fpdi_pdf_parser' => $vendorDir . '/setasign/fpdi/fpdi_pdf_parser.php', 'pdf_context' => $vendorDir . '/setasign/fpdi/pdf_context.php', ); diff --git a/pandora_console/vendor/composer/autoload_psr4.php b/pandora_console/vendor/composer/autoload_psr4.php index 57404185e1..5d194597c6 100644 --- a/pandora_console/vendor/composer/autoload_psr4.php +++ b/pandora_console/vendor/composer/autoload_psr4.php @@ -8,6 +8,8 @@ $baseDir = dirname($vendorDir); return array( 'Tests\\' => array($baseDir . '/tests'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'PandoraFMS\\Enterprise\\' => array($baseDir . '/enterprise/include/lib'), + 'PandoraFMS\\' => array($baseDir . '/include/lib'), 'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'), 'Models\\' => array($baseDir . '/include/rest-api/models'), 'Enterprise\\Models\\' => array($baseDir . '/enterprise/include/rest-api/models'), diff --git a/pandora_console/vendor/composer/autoload_static.php b/pandora_console/vendor/composer/autoload_static.php index f6d8bc0456..8eaa08fa17 100644 --- a/pandora_console/vendor/composer/autoload_static.php +++ b/pandora_console/vendor/composer/autoload_static.php @@ -19,6 +19,8 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa 'P' => array ( 'Psr\\Log\\' => 8, + 'PandoraFMS\\Enterprise\\' => 22, + 'PandoraFMS\\' => 11, ), 'M' => array ( @@ -45,6 +47,14 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', ), + 'PandoraFMS\\Enterprise\\' => + array ( + 0 => __DIR__ . '/../..' . '/enterprise/include/lib', + ), + 'PandoraFMS\\' => + array ( + 0 => __DIR__ . '/../..' . '/include/lib', + ), 'Mpdf\\' => array ( 0 => __DIR__ . '/..' . '/mpdf/mpdf/src', @@ -78,11 +88,321 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa ); public static $classMap = array ( + 'DeepCopy\\DeepCopy' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php', + 'DeepCopy\\Exception\\CloneException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php', + 'DeepCopy\\Exception\\PropertyException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php', + 'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php', + 'DeepCopy\\Filter\\Filter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php', + 'DeepCopy\\Filter\\KeepFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php', + 'DeepCopy\\Filter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php', + 'DeepCopy\\Filter\\SetNullFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php', + 'DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php', + 'DeepCopy\\Matcher\\Matcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php', + 'DeepCopy\\Matcher\\PropertyMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php', + 'DeepCopy\\Matcher\\PropertyNameMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php', + 'DeepCopy\\Matcher\\PropertyTypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', + 'DeepCopy\\Reflection\\ReflectionHelper' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', + 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', + 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', + 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php', + 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php', + 'DeepCopy\\TypeFilter\\TypeFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php', + 'DeepCopy\\TypeMatcher\\TypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php', + 'Doctrine\\Common\\Lexer\\AbstractLexer' => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php', + 'Egulias\\EmailValidator\\EmailLexer' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailLexer.php', + 'Egulias\\EmailValidator\\EmailParser' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailParser.php', + 'Egulias\\EmailValidator\\EmailValidator' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailValidator.php', + 'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php', + 'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRLFAtTheEnd.php', + 'Egulias\\EmailValidator\\Exception\\CRLFX2' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRLFX2.php', + 'Egulias\\EmailValidator\\Exception\\CRNoLF' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRNoLF.php', + 'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CharNotAllowed.php', + 'Egulias\\EmailValidator\\Exception\\CommaInDomain' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CommaInDomain.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveAt.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveDot.php', + 'Egulias\\EmailValidator\\Exception\\DomainHyphened' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DomainHyphened.php', + 'Egulias\\EmailValidator\\Exception\\DotAtEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DotAtEnd.php', + 'Egulias\\EmailValidator\\Exception\\DotAtStart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DotAtStart.php', + 'Egulias\\EmailValidator\\Exception\\ExpectedQPair' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingQPair.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingAT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingAT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingATEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingCTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingDTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingDomainLiteralClose.php', + 'Egulias\\EmailValidator\\Exception\\InvalidEmail' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/InvalidEmail.php', + 'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoDNSRecord.php', + 'Egulias\\EmailValidator\\Exception\\NoDomainPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoDomainPart.php', + 'Egulias\\EmailValidator\\Exception\\NoLocalPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoLocalPart.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnclosedComment.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnclosedQuotedString.php', + 'Egulias\\EmailValidator\\Exception\\UnopenedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnopenedComment.php', + 'Egulias\\EmailValidator\\Parser\\DomainPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/DomainPart.php', + 'Egulias\\EmailValidator\\Parser\\LocalPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/LocalPart.php', + 'Egulias\\EmailValidator\\Parser\\Parser' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/Parser.php', + 'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php', + 'Egulias\\EmailValidator\\Validation\\EmailValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/EmailValidation.php', + 'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Error/RFCWarnings.php', + 'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Error/SpoofEmail.php', + 'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Exception/EmptyValidationList.php', + 'Egulias\\EmailValidator\\Validation\\MultipleErrors' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/MultipleErrors.php', + 'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php', + 'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php', + 'Egulias\\EmailValidator\\Validation\\RFCValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/RFCValidation.php', + 'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php', + 'Egulias\\EmailValidator\\Warning\\AddressLiteral' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php', + 'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php', + 'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php', + 'Egulias\\EmailValidator\\Warning\\Comment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/Comment.php', + 'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php', + 'Egulias\\EmailValidator\\Warning\\DomainLiteral' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php', + 'Egulias\\EmailValidator\\Warning\\DomainTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php', + 'Egulias\\EmailValidator\\Warning\\EmailTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php', + 'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php', + 'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php', + 'Egulias\\EmailValidator\\Warning\\IPV6ColonStart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php', + 'Egulias\\EmailValidator\\Warning\\IPV6Deprecated' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php', + 'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php', + 'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php', + 'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php', + 'Egulias\\EmailValidator\\Warning\\LabelTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php', + 'Egulias\\EmailValidator\\Warning\\LocalTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php', + 'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php', + 'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php', + 'Egulias\\EmailValidator\\Warning\\QuotedPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/QuotedPart.php', + 'Egulias\\EmailValidator\\Warning\\QuotedString' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/QuotedString.php', + 'Egulias\\EmailValidator\\Warning\\TLD' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/TLD.php', + 'Egulias\\EmailValidator\\Warning\\Warning' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/Warning.php', 'FPDF_TPL' => __DIR__ . '/..' . '/setasign/fpdi/fpdf_tpl.php', 'FPDI' => __DIR__ . '/..' . '/setasign/fpdi/fpdi.php', 'FilterASCII85' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCII85.php', 'FilterASCIIHexDecode' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCIIHexDecode.php', 'FilterLZW' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterLZW.php', + 'Models\\CachedModel' => __DIR__ . '/../..' . '/include/rest-api/models/CachedModel.php', + 'Models\\Model' => __DIR__ . '/../..' . '/include/rest-api/models/Model.php', + 'Models\\VisualConsole\\Container' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Container.php', + 'Models\\VisualConsole\\Item' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Item.php', + 'Models\\VisualConsole\\Items\\BarsGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/BarsGraph.php', + 'Models\\VisualConsole\\Items\\Box' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Box.php', + 'Models\\VisualConsole\\Items\\Clock' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Clock.php', + 'Models\\VisualConsole\\Items\\ColorCloud' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/ColorCloud.php', + 'Models\\VisualConsole\\Items\\DonutGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/DonutGraph.php', + 'Models\\VisualConsole\\Items\\EventsHistory' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/EventsHistory.php', + 'Models\\VisualConsole\\Items\\Group' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Group.php', + 'Models\\VisualConsole\\Items\\Icon' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Icon.php', + 'Models\\VisualConsole\\Items\\Label' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Label.php', + 'Models\\VisualConsole\\Items\\Line' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Line.php', + 'Models\\VisualConsole\\Items\\ModuleGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/ModuleGraph.php', + 'Models\\VisualConsole\\Items\\Percentile' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Percentile.php', + 'Models\\VisualConsole\\Items\\SimpleValue' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/SimpleValue.php', + 'Models\\VisualConsole\\Items\\StaticGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/StaticGraph.php', + 'Mpdf\\Barcode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode.php', + 'Mpdf\\Barcode\\AbstractBarcode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/AbstractBarcode.php', + 'Mpdf\\Barcode\\BarcodeException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/BarcodeException.php', + 'Mpdf\\Barcode\\BarcodeInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/BarcodeInterface.php', + 'Mpdf\\Barcode\\Codabar' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Codabar.php', + 'Mpdf\\Barcode\\Code11' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code11.php', + 'Mpdf\\Barcode\\Code128' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code128.php', + 'Mpdf\\Barcode\\Code39' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code39.php', + 'Mpdf\\Barcode\\Code93' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code93.php', + 'Mpdf\\Barcode\\EanExt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/EanExt.php', + 'Mpdf\\Barcode\\EanUpc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/EanUpc.php', + 'Mpdf\\Barcode\\I25' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/I25.php', + 'Mpdf\\Barcode\\Imb' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Imb.php', + 'Mpdf\\Barcode\\Msi' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Msi.php', + 'Mpdf\\Barcode\\Postnet' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Postnet.php', + 'Mpdf\\Barcode\\Rm4Scc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Rm4Scc.php', + 'Mpdf\\Barcode\\S25' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/S25.php', + 'Mpdf\\Cache' => __DIR__ . '/..' . '/mpdf/mpdf/src/Cache.php', + 'Mpdf\\Color\\ColorConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorConverter.php', + 'Mpdf\\Color\\ColorModeConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorModeConverter.php', + 'Mpdf\\Color\\ColorSpaceRestrictor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php', + 'Mpdf\\Color\\NamedColors' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/NamedColors.php', + 'Mpdf\\Config\\ConfigVariables' => __DIR__ . '/..' . '/mpdf/mpdf/src/Config/ConfigVariables.php', + 'Mpdf\\Config\\FontVariables' => __DIR__ . '/..' . '/mpdf/mpdf/src/Config/FontVariables.php', + 'Mpdf\\Conversion\\DecToAlpha' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToAlpha.php', + 'Mpdf\\Conversion\\DecToCjk' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToCjk.php', + 'Mpdf\\Conversion\\DecToHebrew' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToHebrew.php', + 'Mpdf\\Conversion\\DecToOther' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToOther.php', + 'Mpdf\\Conversion\\DecToRoman' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToRoman.php', + 'Mpdf\\CssManager' => __DIR__ . '/..' . '/mpdf/mpdf/src/CssManager.php', + 'Mpdf\\Css\\Border' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/Border.php', + 'Mpdf\\Css\\DefaultCss' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/DefaultCss.php', + 'Mpdf\\Css\\TextVars' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/TextVars.php', + 'Mpdf\\DirectWrite' => __DIR__ . '/..' . '/mpdf/mpdf/src/DirectWrite.php', + 'Mpdf\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php', + 'Mpdf\\Fonts\\FontCache' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontCache.php', + 'Mpdf\\Fonts\\FontFileFinder' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontFileFinder.php', + 'Mpdf\\Fonts\\GlyphOperator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/GlyphOperator.php', + 'Mpdf\\Fonts\\MetricsGenerator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/MetricsGenerator.php', + 'Mpdf\\Form' => __DIR__ . '/..' . '/mpdf/mpdf/src/Form.php', + 'Mpdf\\Gif\\ColorTable' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ColorTable.php', + 'Mpdf\\Gif\\FileHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/FileHeader.php', + 'Mpdf\\Gif\\Gif' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Gif.php', + 'Mpdf\\Gif\\Image' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Image.php', + 'Mpdf\\Gif\\ImageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ImageHeader.php', + 'Mpdf\\Gif\\Lzw' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Lzw.php', + 'Mpdf\\Gradient' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gradient.php', + 'Mpdf\\Hyphenator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Hyphenator.php', + 'Mpdf\\Image\\Bmp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Bmp.php', + 'Mpdf\\Image\\ImageProcessor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageProcessor.php', + 'Mpdf\\Image\\ImageTypeGuesser' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageTypeGuesser.php', + 'Mpdf\\Image\\Svg' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Svg.php', + 'Mpdf\\Image\\Wmf' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Wmf.php', + 'Mpdf\\Language\\LanguageToFont' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/LanguageToFont.php', + 'Mpdf\\Language\\LanguageToFontInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/LanguageToFontInterface.php', + 'Mpdf\\Language\\ScriptToLanguage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/ScriptToLanguage.php', + 'Mpdf\\Language\\ScriptToLanguageInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/ScriptToLanguageInterface.php', + 'Mpdf\\Log\\Context' => __DIR__ . '/..' . '/mpdf/mpdf/src/Log/Context.php', + 'Mpdf\\Mpdf' => __DIR__ . '/..' . '/mpdf/mpdf/src/Mpdf.php', + 'Mpdf\\MpdfException' => __DIR__ . '/..' . '/mpdf/mpdf/src/MpdfException.php', + 'Mpdf\\MpdfImageException' => __DIR__ . '/..' . '/mpdf/mpdf/src/MpdfImageException.php', + 'Mpdf\\Otl' => __DIR__ . '/..' . '/mpdf/mpdf/src/Otl.php', + 'Mpdf\\OtlDump' => __DIR__ . '/..' . '/mpdf/mpdf/src/OtlDump.php', + 'Mpdf\\Output\\Destination' => __DIR__ . '/..' . '/mpdf/mpdf/src/Output/Destination.php', + 'Mpdf\\PageFormat' => __DIR__ . '/..' . '/mpdf/mpdf/src/PageFormat.php', + 'Mpdf\\Pdf\\Protection' => __DIR__ . '/..' . '/mpdf/mpdf/src/Pdf/Protection.php', + 'Mpdf\\Pdf\\Protection\\UniqidGenerator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php', + 'Mpdf\\QrCode\\QrCode' => __DIR__ . '/..' . '/mpdf/mpdf/src/QrCode/QrCode.php', + 'Mpdf\\QrCode\\QrCodeException' => __DIR__ . '/..' . '/mpdf/mpdf/src/QrCode/QrCodeException.php', + 'Mpdf\\Shaper\\Indic' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Indic.php', + 'Mpdf\\Shaper\\Myanmar' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Myanmar.php', + 'Mpdf\\Shaper\\Sea' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Sea.php', + 'Mpdf\\SizeConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/SizeConverter.php', + 'Mpdf\\TTFontFile' => __DIR__ . '/..' . '/mpdf/mpdf/src/TTFontFile.php', + 'Mpdf\\TTFontFileAnalysis' => __DIR__ . '/..' . '/mpdf/mpdf/src/TTFontFileAnalysis.php', + 'Mpdf\\TableOfContents' => __DIR__ . '/..' . '/mpdf/mpdf/src/TableOfContents.php', + 'Mpdf\\Tag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag.php', + 'Mpdf\\Tag\\A' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/A.php', + 'Mpdf\\Tag\\Acronym' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Acronym.php', + 'Mpdf\\Tag\\Address' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Address.php', + 'Mpdf\\Tag\\Annotation' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Annotation.php', + 'Mpdf\\Tag\\Article' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Article.php', + 'Mpdf\\Tag\\Aside' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Aside.php', + 'Mpdf\\Tag\\B' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/B.php', + 'Mpdf\\Tag\\BarCode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BarCode.php', + 'Mpdf\\Tag\\Bdi' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bdi.php', + 'Mpdf\\Tag\\Bdo' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bdo.php', + 'Mpdf\\Tag\\Big' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Big.php', + 'Mpdf\\Tag\\BlockQuote' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BlockQuote.php', + 'Mpdf\\Tag\\BlockTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BlockTag.php', + 'Mpdf\\Tag\\Bookmark' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bookmark.php', + 'Mpdf\\Tag\\Br' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Br.php', + 'Mpdf\\Tag\\Caption' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Caption.php', + 'Mpdf\\Tag\\Center' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Center.php', + 'Mpdf\\Tag\\Cite' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Cite.php', + 'Mpdf\\Tag\\Code' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Code.php', + 'Mpdf\\Tag\\ColumnBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/ColumnBreak.php', + 'Mpdf\\Tag\\Columns' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Columns.php', + 'Mpdf\\Tag\\Dd' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dd.php', + 'Mpdf\\Tag\\Del' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Del.php', + 'Mpdf\\Tag\\Details' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Details.php', + 'Mpdf\\Tag\\Div' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Div.php', + 'Mpdf\\Tag\\Dl' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dl.php', + 'Mpdf\\Tag\\DotTab' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/DotTab.php', + 'Mpdf\\Tag\\Dt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dt.php', + 'Mpdf\\Tag\\Em' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Em.php', + 'Mpdf\\Tag\\FieldSet' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FieldSet.php', + 'Mpdf\\Tag\\FigCaption' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FigCaption.php', + 'Mpdf\\Tag\\Figure' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Figure.php', + 'Mpdf\\Tag\\Font' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Font.php', + 'Mpdf\\Tag\\Footer' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Footer.php', + 'Mpdf\\Tag\\Form' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Form.php', + 'Mpdf\\Tag\\FormFeed' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FormFeed.php', + 'Mpdf\\Tag\\H1' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H1.php', + 'Mpdf\\Tag\\H2' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H2.php', + 'Mpdf\\Tag\\H3' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H3.php', + 'Mpdf\\Tag\\H4' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H4.php', + 'Mpdf\\Tag\\H5' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H5.php', + 'Mpdf\\Tag\\H6' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H6.php', + 'Mpdf\\Tag\\HGroup' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/HGroup.php', + 'Mpdf\\Tag\\Header' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Header.php', + 'Mpdf\\Tag\\Hr' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Hr.php', + 'Mpdf\\Tag\\I' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/I.php', + 'Mpdf\\Tag\\Img' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Img.php', + 'Mpdf\\Tag\\IndexEntry' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/IndexEntry.php', + 'Mpdf\\Tag\\IndexInsert' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/IndexInsert.php', + 'Mpdf\\Tag\\InlineTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/InlineTag.php', + 'Mpdf\\Tag\\Input' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Input.php', + 'Mpdf\\Tag\\Ins' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ins.php', + 'Mpdf\\Tag\\Kbd' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Kbd.php', + 'Mpdf\\Tag\\Legend' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Legend.php', + 'Mpdf\\Tag\\Li' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Li.php', + 'Mpdf\\Tag\\Main' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Main.php', + 'Mpdf\\Tag\\Mark' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Mark.php', + 'Mpdf\\Tag\\Meter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Meter.php', + 'Mpdf\\Tag\\Nav' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Nav.php', + 'Mpdf\\Tag\\NewColumn' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/NewColumn.php', + 'Mpdf\\Tag\\NewPage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/NewPage.php', + 'Mpdf\\Tag\\Ol' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ol.php', + 'Mpdf\\Tag\\Option' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Option.php', + 'Mpdf\\Tag\\P' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/P.php', + 'Mpdf\\Tag\\PageBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageBreak.php', + 'Mpdf\\Tag\\PageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageFooter.php', + 'Mpdf\\Tag\\PageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageHeader.php', + 'Mpdf\\Tag\\Pre' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Pre.php', + 'Mpdf\\Tag\\Progress' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Progress.php', + 'Mpdf\\Tag\\Q' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Q.php', + 'Mpdf\\Tag\\S' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/S.php', + 'Mpdf\\Tag\\Samp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Samp.php', + 'Mpdf\\Tag\\Section' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Section.php', + 'Mpdf\\Tag\\Select' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Select.php', + 'Mpdf\\Tag\\SetHtmlPageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetHtmlPageFooter.php', + 'Mpdf\\Tag\\SetHtmlPageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetHtmlPageHeader.php', + 'Mpdf\\Tag\\SetPageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetPageFooter.php', + 'Mpdf\\Tag\\SetPageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetPageHeader.php', + 'Mpdf\\Tag\\Small' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Small.php', + 'Mpdf\\Tag\\Span' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Span.php', + 'Mpdf\\Tag\\Strike' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Strike.php', + 'Mpdf\\Tag\\Strong' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Strong.php', + 'Mpdf\\Tag\\Sub' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Sub.php', + 'Mpdf\\Tag\\SubstituteTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SubstituteTag.php', + 'Mpdf\\Tag\\Summary' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Summary.php', + 'Mpdf\\Tag\\Sup' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Sup.php', + 'Mpdf\\Tag\\TBody' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TBody.php', + 'Mpdf\\Tag\\TFoot' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TFoot.php', + 'Mpdf\\Tag\\THead' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/THead.php', + 'Mpdf\\Tag\\Table' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Table.php', + 'Mpdf\\Tag\\Tag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tag.php', + 'Mpdf\\Tag\\Td' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Td.php', + 'Mpdf\\Tag\\TextArea' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TextArea.php', + 'Mpdf\\Tag\\TextCircle' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TextCircle.php', + 'Mpdf\\Tag\\Th' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Th.php', + 'Mpdf\\Tag\\Time' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Time.php', + 'Mpdf\\Tag\\Toc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Toc.php', + 'Mpdf\\Tag\\TocEntry' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TocEntry.php', + 'Mpdf\\Tag\\TocPageBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TocPageBreak.php', + 'Mpdf\\Tag\\Tr' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tr.php', + 'Mpdf\\Tag\\Tt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tt.php', + 'Mpdf\\Tag\\Tta' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tta.php', + 'Mpdf\\Tag\\Tts' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tts.php', + 'Mpdf\\Tag\\Ttz' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ttz.php', + 'Mpdf\\Tag\\U' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/U.php', + 'Mpdf\\Tag\\Ul' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ul.php', + 'Mpdf\\Tag\\VarTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/VarTag.php', + 'Mpdf\\Tag\\WatermarkImage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/WatermarkImage.php', + 'Mpdf\\Tag\\WatermarkText' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/WatermarkText.php', + 'Mpdf\\Ucdn' => __DIR__ . '/..' . '/mpdf/mpdf/src/Ucdn.php', + 'Mpdf\\Utils\\Arrays' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/Arrays.php', + 'Mpdf\\Utils\\NumericString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/NumericString.php', + 'Mpdf\\Utils\\PdfDate' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/PdfDate.php', + 'Mpdf\\Utils\\UtfString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/UtfString.php', + 'PandoraFMS\\User' => __DIR__ . '/../..' . '/include/lib/User.php', + 'PandoraFMS\\WebSockets\\WSManager' => __DIR__ . '/../..' . '/include/lib/WSManager.php', + 'PandoraFMS\\Websockets\\WebSocketServer' => __DIR__ . '/../..' . '/include/lib/WebSocketServer.php', + 'PandoraFMS\\Websockets\\WebSocketUser' => __DIR__ . '/../..' . '/include/lib/WebSocketUser.php', + 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'fpdi_pdf_parser' => __DIR__ . '/..' . '/setasign/fpdi/fpdi_pdf_parser.php', 'pdf_context' => __DIR__ . '/..' . '/setasign/fpdi/pdf_context.php', ); diff --git a/pandora_console/ws.php b/pandora_console/ws.php new file mode 100644 index 0000000000..5eebe58aad --- /dev/null +++ b/pandora_console/ws.php @@ -0,0 +1,159 @@ +> '.__DIR__.'/pandora_console.log 2>&1 &'; + shell_exec($cmd); + + // Launch gotty - telnet. + $cmd = $base_cmd.' --port '.$config['gotty_telnet_port']; + $cmd .= ' telnet >> '.__DIR__.'/pandora_console.log 2>&1 &'; + shell_exec($cmd); + } +} + +// Start Web SocketProxy. +$ws = new WSManager( + // Bind address. + $config['ws_bind_address'], + // Bind port. + $config['ws_port'], + // Connected handlers. + ['gotty' => 'proxyConnected'], + // Process handlers. + [], + // ProcessRaw handlers. + ['gotty' => 'proxyProcessRaw'], + // Tick handlers. + [], + $bufferSize, + $debug +); + +try { + $ws->run(); +} catch (Exception $e) { + $ws->stdout($e->getMessage()); +} diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 69b27f4f9a..56c06c6394 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.740-191029 +Version: 7.0NG.740-191113 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 34f150ed54..e37636af68 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.740-191029" +pandora_version="7.0NG.740-191113" package_cpan=0 package_pandora=1 diff --git a/pandora_server/FreeBSD/pandora_server.conf.new b/pandora_server/FreeBSD/pandora_server.conf.new index 93d9abbc75..01ff859fa5 100644 --- a/pandora_server/FreeBSD/pandora_server.conf.new +++ b/pandora_server/FreeBSD/pandora_server.conf.new @@ -348,6 +348,15 @@ self_monitoring 1 # Self monitoring interval (in seconds). self_monitoring_interval 300 +# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent +# will make sample data. Disabled by default. + +sample_agent 0 + +# Pandora Sample Agent interval (in seconds). + +sample_agent_interval 600 + # Update parent from the agent xml #update_parent 1 diff --git a/pandora_server/NetBSD/pandora_server.conf.new b/pandora_server/NetBSD/pandora_server.conf.new index 5f38a678da..66743aee36 100644 --- a/pandora_server/NetBSD/pandora_server.conf.new +++ b/pandora_server/NetBSD/pandora_server.conf.new @@ -340,6 +340,15 @@ restart_delay 60 self_monitoring 1 +# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent +# will make sample data. Disabled by default. + +sample_agent 0 + +# Pandora Sample Agent interval (in seconds). + +sample_agent_interval 600 + # Update parent from the agent xml #update_parent 1 diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index a367eb7bca..1ce3e3da5e 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -382,6 +382,16 @@ sub pandora_server_tasks ($) { pandora_self_monitoring ($pa_config, $dbh); } + # Pandora sample agent + if (defined($pa_config->{'sample_agent'})) { + if ($pa_config->{'sample_agent'} == 1 + && !is_metaconsole($pa_config) + && $counter % $pa_config->{'sample_agent_interval'} == 0){ + pandora_sample_agent ($pa_config); + } + pandora_update_config_token ($dbh, 'sample_agent', $pa_config->{'sample_agent'}); + } + # Avoid counter overflow if ($counter >= ~0){ $counter = 0; diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 1b76b1cf66..a5896e6050 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -376,6 +376,15 @@ self_monitoring 1 # Self monitoring interval (in seconds). self_monitoring_interval 300 +# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent +# will make sample data. Disabled by default. + +sample_agent 0 + +# Pandora Sample Agent interval (in seconds). + +sample_agent_interval 600 + # Update parent from the agent xml #update_parent 1 diff --git a/pandora_server/conf/pandora_server.conf.windows b/pandora_server/conf/pandora_server.conf.windows index c7c5db64b4..a7232e459c 100644 --- a/pandora_server/conf/pandora_server.conf.windows +++ b/pandora_server/conf/pandora_server.conf.windows @@ -330,6 +330,15 @@ restart_delay 60 # Self monitoring interval (in seconds). #self_monitoring_interval 300 +# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent +# will make sample data. Disabled by default. + +sample_agent 0 + +# Pandora Sample Agent interval (in seconds). + +sample_agent_interval 600 + # Update parent from the agent xml #update_parent 1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 04e57e4525..4a33f55c2d 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.740"; -my $pandora_build = "191029"; +my $pandora_build = "191113"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash @@ -79,7 +79,7 @@ sub help_screen { sub pandora_init { my $pa_config = $_[0]; my $init_string = $_[1]; - print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-2018 " . pandora_get_initial_copyright_notice() . "\n"; + print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-20".substr($pandora_build,0,2)." " . pandora_get_initial_copyright_notice() . "\n"; print "This program is OpenSource, licensed under the terms of GPL License version 2.\n"; print "You can download latest versions and documentation at official web page.\n\n"; @@ -397,6 +397,12 @@ sub pandora_load_config { # Self monitoring interval $pa_config->{'self_monitoring_interval'} = 300; # 5.1SP1 + # Sample Agent + $pa_config->{'sample_agent'} = 0; + + # Sample agent interval + $pa_config->{'sample_agent_interval'} = 600; + # Process XML data files as a stack $pa_config->{"dataserver_lifo"} = 0; # 5.0 @@ -946,6 +952,12 @@ sub pandora_load_config { elsif ($parametro =~ m/^self_monitoring_interval\s+([0-9]*)/i) { $pa_config->{'self_monitoring_interval'} = clean_blank($1); } + elsif ($parametro =~ m/^sample_agent\s+([0-1])/i) { + $pa_config->{'sample_agent'} = clean_blank($1); + } + elsif ($parametro =~ m/^sample_agent_interval\s+([0-9]*)/i) { + $pa_config->{'sample_agent_interval'} = clean_blank($1); + } elsif ($parametro =~ m/^update_parent\s+([0-1])/i) { $pa_config->{'update_parent'} = clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f575d8e02b..98f86291e7 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -100,6 +100,8 @@ Exported Functions: =item * C +=item * C + =back =head1 METHODS @@ -122,6 +124,7 @@ use threads::shared; use JSON qw(decode_json encode_json); use MIME::Base64; use Text::ParseWords; +use Math::Trig; # Math functions # Debugging #use Data::Dumper; @@ -247,6 +250,7 @@ our @EXPORT = qw( pandora_group_statistics pandora_server_statistics pandora_self_monitoring + pandora_sample_agent pandora_process_policy_queue subst_alert_macros subst_column_macros @@ -1125,6 +1129,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { _name_tag_ => undef, _all_address_ => undef, '_address_\d+_' => undef, + _secondarygroups_ => undef, ); if ((defined ($extra_macros)) && (ref($extra_macros) eq "HASH")) { @@ -4113,6 +4118,15 @@ sub on_demand_macro($$$$$$;$) { } return(defined($field_value)) ? $field_value : ''; + } elsif ($macro eq '_secondarygroups_') { + my $field_value = ''; + + my @groups = get_db_rows ($dbh, 'SELECT tg.nombre from tagent_secondary_group as tsg INNER JOIN tgrupo tg ON tsg.id_group = tg.id_grupo WHERE tsg.id_agent = ?', $module->{'id_agente'}); + foreach my $element (@groups) { + $field_value .= $element->{'nombre'} .","; + } + chop($field_value); + return(defined($field_value)) ? '('.$field_value.')' : ''; } } @@ -5235,6 +5249,83 @@ sub pandora_self_monitoring ($$) { print XMLFILE $xml_output; close (XMLFILE); } +########################################################################## +=head2 C<< xml_module_template (I<$module_name>, I<$module_type>, I<$module_data>) >> + +Module template for sample agent + +=cut +########################################################################## +sub xml_module_template ($$$) { + my ($module_name, $module_type, $module_data) = @_; + my $output = "\n"; + + $module_name = "" if $module_name =~ /[\s+.]+/; + $module_data = "" if $module_data =~ /[\s+.]+/; + + $output .= "\t".$module_name."\n"; + $output .= "\t".$module_type."\n"; + $output .= "\t".$module_data."\n"; + $output .= "\n"; + + return $output; +} +########################################################################## +=head2 C<< pandora_sample_agent (I<$pa_config>) >> + +Pandora agent for make sample data + +=cut +########################################################################## +sub pandora_sample_agent ($) { + + my ($pa_config) = @_; + + my $utimestamp = time (); + my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime()); + # First line + my $xml_output = "\n"; + # Header + $xml_output = "\n"; + # Boolean ever return TRUE + $xml_output .= xml_module_template ("Boolean ever true", "generic_proc","1"); + # Boolean return TRUE at 80% of times + my $sample_boolean_mostly_true = 1; + $sample_boolean_mostly_true = 0 if rand(9) > 7; + $xml_output .= xml_module_template ("Boolean mostly true", "generic_proc",$sample_boolean_mostly_true); + # Boolean return false at 80% of times + my $sample_boolean_mostly_false = 0; + $sample_boolean_mostly_false = 1 if rand(9) > 7; + $xml_output .= xml_module_template ("Boolean mostly false", "generic_proc", $sample_boolean_mostly_false); + # Boolean ever return FALSE + $xml_output .= xml_module_template ("Boolean ever false", "generic_proc","0"); + # Random integer between 0 and 100 + $xml_output .= xml_module_template ("Random integer values", "generic_data",int(rand(100))); + # Random values obtained with sinusoidal curves between 0 and 100 values + my $b = 1; + my $sample_serie_curve = 1 + cos(deg2rad($b)); + $b = $b + rand(20)/10; + $b = 0 if ($b > 180); + $sample_serie_curve = $sample_serie_curve * $b * 10; + $sample_serie_curve =~ s/\,/\./g; + $xml_output .= xml_module_template ("Random serie curve", "generic_data", $sample_serie_curve); + # String with 10 random characters + my $sample_random_text = ""; + my @characters = ('a'..'z','A'..'Z'); + for (1...10){ + $sample_random_text .= $characters[int(rand(@characters))]; + } + $xml_output .= xml_module_template ("Random text", "generic_data_string", $sample_random_text); + # End of xml + $xml_output .= ""; + # File path definition + my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{'servername'}.".sample.".$utimestamp.".data"; + # Opening, Writing and closing of XML + open (my $xmlfile, ">", $filename) or die "[FATAL] Could not open sample XML file for deploying monitorization at '$filename'"; + print $xmlfile $xml_output; + close ($xmlfile); + +} ########################################################################## =head2 C<< set_master (I<$pa_config>, I<$dbh>) >> diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 287b11e900..05a2a380b0 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,7 +32,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.740"; -my $pandora_build = "191029"; +my $pandora_build = "191113"; 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 805efb4c41..05fed4153c 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.740 -%define release 191029 +%define release 191113 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e2eb323b24..ca4e1b49d5 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.740 -%define release 191029 +%define release 191113 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6b1870fadf..17381fad66 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.740" -PI_BUILD="191029" +PI_BUILD="191113" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a9cc09579b..7ae1717f78 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.740 PS191029"; +my $version = "7.0NG.740 PS191113"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 3b72f91063..f45897efe6 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.740 PS191029"; +my $version = "7.0NG.740 PS191113"; # save program name for logging my $progname = basename($0); @@ -118,12 +118,22 @@ sub help_screen{ help_screen_line('--get_planned_downtimes_items', ' [ ]', 'Get all items of planned downtimes'); help_screen_line('--set_planned_downtimes_deleted', ' ', 'Deleted a planned downtime'); help_screen_line('--get_module_id', ' ', 'Get the id of an module'); +<<<<<<< HEAD + help_screen_line('--get_agent_group', '', 'Get the group name of an agent'); + help_screen_line('--get_agent_group_id', '', 'Get the group ID of an agent'); + help_screen_line('--get_agent_modules', '', 'Get the modules of an agent'); + help_screen_line('--get_agents_id_name_by_alias', '', '[]', 'List id and alias of agents mathing given alias'); + help_screen_line('--get_agents', '[ ]', "Get \n\t list of agents with optative filter parameters"); + help_screen_line('--delete_conf_file', '', 'Delete a local conf of a given agent'); + help_screen_line('--clean_conf_file', '', "Clean a local conf of a given agent deleting all modules, \n\t policies, file collections and comments"); +======= help_screen_line('--get_agent_group', ' []', 'Get the group name of an agent'); help_screen_line('--get_agent_group_id', ' []', 'Get the group ID of an agent'); help_screen_line('--get_agent_modules', ' []', 'Get the modules of an agent'); help_screen_line('--get_agents', '[ ]', "Get \n\t list of agents with optative filter parameters"); help_screen_line('--delete_conf_file', ' []', 'Delete a local conf of a given agent'); help_screen_line('--clean_conf_file', ' []', "Clean a local conf of a given agent deleting all modules, \n\t policies, file collections and comments"); +>>>>>>> origin/develop help_screen_line('--get_bad_conf_files', '', 'Get the files bad configured (without essential tokens)'); help_screen_line('--locate_agent', ' []', 'Search a agent into of nodes of metaconsole. Only Enterprise.'); help_screen_line('--migration_agent_queue', ' []', 'Migrate agent only metaconsole'); @@ -4849,6 +4859,49 @@ sub cli_get_agent_modules() { } } +############################################################################## +# Show id, name and id_server of an agent given alias +# Related option: --get_agents_id_name_by_alias +############################################################################## + +sub cli_get_agents_id_name_by_alias() { + my $agent_alias = @ARGV[2]; + my $strict = @ARGV[3]; + my @agents; + my $where_value; + + if($strict eq 'strict') { + $where_value = $agent_alias; + } else { + $where_value = "%".$agent_alias."%"; + } + + if(is_metaconsole($conf) == 1) { + @agents = get_db_rows($dbh,"SELECT alias, id_agente, id_tagente, id_tmetaconsole_setup as 'id_server', server_name FROM tmetaconsole_agent WHERE UPPER(alias) LIKE UPPER(?)", $where_value); + } else { + @agents = get_db_rows($dbh,"SELECT alias, id_agente FROM tagente WHERE UPPER(alias) LIKE UPPER(?)", $where_value); + } + if(scalar(@agents) == 0) { + print "[ERROR] No agents retrieved.\n\n"; + } else { + if(is_metaconsole($conf) == 1) { + print "alias, id_agente, id_tagente, id_server, server_name\n"; + + foreach my $agent (@agents) { + + print safe_output($agent->{'alias'}).", ".$agent->{'id_agente'}.", ".$agent->{'id_tagente'}.", ".$agent->{'id_server'}.", ".$agent->{'server_name'}."\n"; + } + } else { + print "alias, id_agente\n"; + + foreach my $agent (@agents) { + print $agent->{'id_agente'}.",".safe_output($agent->{'alias'})."\n"; + } + } + } +} + + sub cli_create_synthetic() { my $name_module = @ARGV[2]; my $synthetic_type = @ARGV[3]; @@ -5895,9 +5948,16 @@ sub cli_stop_downtime () { exist_check($downtime_id,'planned downtime',$downtime_id); my $current_time = time; - my $downtime_date_to = get_db_value ($dbh, 'SELECT date_to FROM tplanned_downtime WHERE id=?', $downtime_id); - if($current_time >= $downtime_date_to) { + my $data = get_db_single_row ($dbh, 'SELECT date_to, type_execution, executed FROM tplanned_downtime WHERE id=?', $downtime_id); + + if( $data->{'type_execution'} eq 'periodically' && $data->{'executed'} == 1){ + print_log "[ERROR] Planned_downtime '$downtime_name' cannot be stopped.\n"; + print_log "[INFO] Periodical and running planned downtime cannot be stopped.\n\n"; + exit; + } + + if($current_time >= $data->{'date_to'}) { print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n"; exit; } @@ -7419,6 +7479,10 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 2, 1); cli_get_agent_modules(); } + elsif ($param eq '--get_agents_id_name_by_alias') { + param_check($ltotal, 2,1); + cli_get_agents_id_name_by_alias(); + } elsif ($param eq '--get_policy_modules') { param_check($ltotal, 1); cli_get_policy_modules();
    '.__('Report date').': '.date($config['date_format'], ($report['datetime'] - $report['period'])).''.__('From').' '.date($config['date_format'], ($report['datetime'] - $report['period'])).''.__('to').' '.date($config['date_format'], $report['datetime']).''.__('Items period before').' '.date($config['date_format'], $report['datetime']).'