";
+ $data[$i][$j] = "
";
$data[$i][$j] .= 0;
$data[$i][$j] .= '
';
}
@@ -271,7 +323,7 @@ function mainModuleGroups()
}
} else {
foreach ($value['gm'] as $k => $v) {
- $data[$i][$j] = "
";
+ $data[$i][$j] = "
";
$data[$i][$j] .= 0;
$data[$i][$j] .= '
';
$j++;
diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php
index e6ec05977b..ba66cae68e 100644
--- a/pandora_console/extensions/net_tools.php
+++ b/pandora_console/extensions/net_tools.php
@@ -1,26 +1,60 @@
".__('The agent hasn\'t got IP').'
';
- return;
- }
-
- echo "
- ";
-
- echo '
';
- echo "
';
-
- $operation = get_parameter('operation', 0);
- $community = get_parameter('community', 'public');
- $ip = get_parameter('select_ips');
-
if (!validate_address($ip)) {
- ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
+ ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} else {
switch ($operation) {
case 1:
@@ -175,7 +147,7 @@ function main_net_tools()
} else {
echo '
'.__('Traceroute to ').$ip.'
';
echo '
';
- echo system("$traceroute $ip");
+ echo system($traceroute.' '.$ip);
echo '
';
}
break;
@@ -187,7 +159,7 @@ function main_net_tools()
} else {
echo '
'.__('Ping to %s', $ip).'
';
echo '
';
- echo system("$ping -c 5 $ip");
+ echo system($ping.' -c 5 '.$ip);
echo '
';
}
break;
@@ -199,7 +171,7 @@ function main_net_tools()
} else {
echo '
'.__('Basic TCP Scan on ').$ip.'
';
echo '
';
- echo system("$nmap -F $ip");
+ echo system($nmap.' -F '.$ip);
echo '
';
}
break;
@@ -212,7 +184,7 @@ function main_net_tools()
ui_print_error_message(__('Dig executable does not exist.'));
} else {
echo '
';
- echo system("dig $ip");
+ echo system('dig '.$ip);
echo '
';
}
@@ -221,51 +193,227 @@ function main_net_tools()
ui_print_error_message(__('Whois executable does not exist.'));
} else {
echo '
';
- echo system("whois $ip");
+ echo system('whois '.$ip);
echo '
';
}
break;
case 3:
+ $snmp_obj = [
+ 'ip_target' => $ip,
+ 'snmp_version' => $snmp_version,
+ 'snmp_community' => $community,
+ 'format' => '-Oqn',
+ ];
+
+ $snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.3.0';
+ $result = get_h_snmpwalk($snmp_obj);
echo '
'.__('SNMP information for ').$ip.'
';
-
- $snmpget = whereis_the_command('snmpget');
- if (empty($snmpget)) {
- ui_print_error_message(__('SNMPget executable does not exist.'));
+ echo '
'.__('Uptime').'
';
+ echo '
';
+ if (empty($result)) {
+ ui_print_error_message(__('Target unreachable.'));
+ break;
} else {
- echo ''.__('Uptime').'
';
- echo '';
- echo exec("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.3.0 ");
- echo '
';
- echo ''.__('Device info').'
';
- echo '';
-
- echo system("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.1.0 ");
- echo '
';
-
- echo 'Interface Information
';
- echo '
';
- echo ''.__('Interface');
- echo ' | '.__('Status');
-
- $int_max = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 ");
-
- for ($ax = 0; $ax < $int_max; $ax++) {
- $interface = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.2.$ax ");
- $estado = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax ");
- echo " |
---|
$interface | $estado";
- }
-
- echo ' |
';
+ echo array_pop($result);
}
+
+ echo '';
+ echo '
'.__('Device info').'
';
+ echo '
';
+ $snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.1.0';
+ $result = get_h_snmpwalk($snmp_obj);
+ if (empty($result)) {
+ ui_print_error_message(__('Target unreachable.'));
+ break;
+ } else {
+ echo array_pop($result);
+ }
+
+ echo '
';
+
+ echo '
Interface Information
';
+
+ $table = new StdClass();
+ $table->class = 'databox';
+ $table->head = [];
+ $table->head[] = __('Interface');
+ $table->head[] = __('Status');
+
+ $i = 0;
+
+ $base_oid = '.1.3.6.1.2.1.2.2.1';
+ $idx_oids = '.1';
+ $names_oids = '.2';
+ $status_oids = '.8';
+
+ $snmp_obj['base_oid'] = $base_oid.$idx_oids;
+ $idx = get_h_snmpwalk($snmp_obj);
+
+ $snmp_obj['base_oid'] = $base_oid.$names_oids;
+ $names = get_h_snmpwalk($snmp_obj);
+
+ $snmp_obj['base_oid'] = $base_oid.$status_oids;
+ $statuses = get_h_snmpwalk($snmp_obj);
+
+ foreach ($idx as $k => $v) {
+ $index = str_replace($base_oid.$idx_oids, '', $k);
+ $name = $names[$base_oid.$names_oids.$index];
+
+ $status = $statuses[$base_oid.$status_oids.$index];
+
+ $table->data[$i][0] = $name;
+ $table->data[$i++][1] = $status;
+ }
+
+ html_print_table($table);
+ break;
+
+ default:
+ // Ignore.
break;
}
}
+}
+
+
+/**
+ * Main function.
+ *
+ * @return void
+ */
+function main_net_tools()
+{
+ $operation = get_parameter('operation', 0);
+ $community = get_parameter('community', 'public');
+ $ip = get_parameter('select_ips');
+ $snmp_version = get_parameter('select_version');
+
+ // Show form.
+ $id_agente = get_parameter('id_agente', 0);
+ $principal_ip = db_get_sql(
+ sprintf(
+ 'SELECT direccion FROM tagente WHERE id_agente = %d',
+ $id_agente
+ )
+ );
+
+ $list_address = db_get_all_rows_sql(
+ sprintf(
+ 'SELECT id_a FROM taddress_agent WHERE id_agent = %d',
+ $id_agente
+ )
+ );
+ foreach ($list_address as $address) {
+ $ids[] = join(',', $address);
+ }
+
+ $ips = db_get_all_rows_sql(
+ sprintf(
+ 'SELECT ip FROM taddress WHERE id_a IN (%s)',
+ join($ids)
+ )
+ );
+
+ if ($ips == '') {
+ echo "
".__('The agent hasn\'t got IP').'
';
+ return;
+ }
+
+ // Javascript.
+ ?>
+
+ ';
+ echo "
';
+
+ if ($operation) {
+ // Execute form.
+ net_tools_execute($operation, $ip, $community, $snmp_version);
+ }
+
echo '
';
}
+/**
+ * Add option.
+ *
+ * @return void
+ */
function godmode_net_tools()
{
global $config;
diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php
index 09d66abf0c..e487d49ee5 100644
--- a/pandora_console/extensions/realtime_graphs.php
+++ b/pandora_console/extensions/realtime_graphs.php
@@ -29,7 +29,14 @@ function pandora_realtime_graphs()
$hide_header = get_parameter('hide_header', 0);
if (!$hide_header) {
- ui_print_page_header(__('Realtime graphs'), 'images/extensions.png', false, '', false, $onheader);
+ ui_print_page_header(
+ __('Realtime graphs'),
+ 'images/extensions.png',
+ false,
+ 'real_time_view',
+ false,
+ $onheader
+ );
}
$chart[time()]['graph'] = '0';
@@ -166,7 +173,7 @@ function pandora_realtime_graphs()
$table->colspan[2]['snmp_oid'] = 2;
$data['snmp_ver'] = __('Version').' '.html_print_select($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
- $data['snmp_ver'] .= ' '.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:realtimeGraphs.snmpBrowserWindow();', 'class="sub next"', true);
+ $data['snmp_ver'] .= ' '.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:snmpBrowserWindow();', 'class="sub next"', true);
$table->colspan[2]['snmp_ver'] = 2;
$table->data[] = $data;
diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.css b/pandora_console/extensions/realtime_graphs/realtime_graphs.css
index ab6c94e238..2219c6152a 100644
--- a/pandora_console/extensions/realtime_graphs/realtime_graphs.css
+++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.css
@@ -11,5 +11,5 @@
#graph_container {
width: 800px;
- margin: 20px auto !important;
+ margin: 20px auto;
}
diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js
index 7140d245d4..b5d6c1eaa8 100644
--- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js
+++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js
@@ -10,7 +10,9 @@
var plot;
var plotOptions = {
- legend: { container: $("#chartLegend") },
+ legend: {
+ container: $("#chartLegend")
+ },
xaxis: {
tickFormatter: function(timestamp, axis) {
var date = new Date(timestamp * 1000);
@@ -131,47 +133,6 @@
resetDataPooling();
}
- // Set the form OID to the value selected in the SNMP browser
- function setOID() {
- if ($("#snmp_browser_version").val() == "3") {
- $("#text-snmp_oid").val($("#table1-0-1").text());
- } else {
- $("#text-snmp_oid").val($("#snmp_selected_oid").text());
- }
-
- // Close the SNMP browser
- $(".ui-dialog-titlebar-close").trigger("click");
- }
-
- // Show the SNMP browser window
- function snmpBrowserWindow() {
- // Keep elements in the form and the SNMP browser synced
- $("#text-target_ip").val($("#text-ip_target").val());
- $("#text-community").val($("#text-snmp_community").val());
- $("#snmp_browser_version").val($("#snmp_version").val());
- $("#snmp3_browser_auth_user").val($("#snmp3_auth_user").val());
- $("#snmp3_browser_security_level").val($("#snmp3_security_level").val());
- $("#snmp3_browser_auth_method").val($("#snmp3_auth_method").val());
- $("#snmp3_browser_auth_pass").val($("#snmp3_auth_pass").val());
- $("#snmp3_browser_privacy_method").val($("#snmp3_privacy_method").val());
- $("#snmp3_browser_privacy_pass").val($("#snmp3_privacy_pass").val());
-
- $("#snmp_browser_container")
- .show()
- .dialog({
- title: "",
- resizable: true,
- draggable: true,
- modal: true,
- overlay: {
- opacity: 0.5,
- background: "black"
- },
- width: 920,
- height: 500
- });
- }
-
function shortNumber(number) {
if (Math.round(number) != number) return number;
number = Number.parseInt(number);
@@ -187,6 +148,7 @@
return number + " " + shorts[pos];
}
+
function roundToTwo(num) {
return +(Math.round(num + "e+2") + "e-2");
}
diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php
index 92d106d153..c43e2a97f2 100755
--- a/pandora_console/extensions/resource_registration.php
+++ b/pandora_console/extensions/resource_registration.php
@@ -998,20 +998,23 @@ function process_upload_xml($xml)
{
$hook_enterprise = enterprise_include('extensions/resource_registration/functions.php');
- // Extract component
+ // Extract component.
process_upload_xml_component($xml);
$group_filter = get_parameter('group');
- // Extract visual map
+ // Extract visual map.
process_upload_xml_visualmap($xml, $group_filter);
- // Extract policies
+ // Extract policies.
if ($hook_enterprise === true) {
- process_upload_xml_policy($xml, $group_filter);
+ $centralized_management = !is_central_policies_on_node();
+ if ($centralized_management) {
+ process_upload_xml_policy($xml, $group_filter);
+ }
}
- // Extract reports
+ // Extract reports.
process_upload_xml_report($xml, $group_filter);
}
@@ -1038,6 +1041,11 @@ function resource_registration_extension_main()
return;
}
+ $centralized_management = !is_central_policies_on_node();
+ if (!$centralized_management) {
+ ui_print_warning_message(__('This node is configured with centralized mode. Go to metaconsole to create a policy.'));
+ }
+
echo '
';
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'
'.__("You can get more resurces in our
Public Resource Library");
echo '
';
diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php
index 562d757a20..e26b0dab1e 100644
--- a/pandora_console/extensions/users_connected.php
+++ b/pandora_console/extensions/users_connected.php
@@ -66,10 +66,10 @@ function users_extension_main_god($god=true)
$rows = [];
echo "
".__('No other users connected').'
';
} else {
- $table->cellpadding = 4;
- $table->cellspacing = 4;
+ $table->cellpadding = 0;
+ $table->cellspacing = 0;
$table->width = '100%';
- $table->class = 'databox data';
+ $table->class = 'info_table';
$table->size = [];
$table->data = [];
$table->head = [];
diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt
deleted file mode 100644
index 7ddcdae14e..0000000000
--- a/pandora_console/extras/delete_files/delete_files.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-/godmode/servers/recorn_script.php
-/godmode/servers/manage_recontask_form.php
-/godmode/servers/manage_recontask.php
\ No newline at end of file
diff --git a/pandora_console/extras/mr/26.sql b/pandora_console/extras/mr/26.sql
index f9c904a0a3..591edd6499 100644
--- a/pandora_console/extras/mr/26.sql
+++ b/pandora_console/extras/mr/26.sql
@@ -1,8 +1,24 @@
START TRANSACTION;
--- ----------------------------------------------------------------------
--- Add column in table `tagent_custom_fields`
--- ----------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `source` varchar(60) default '',
+ `destination` varchar(60) default '',
+ `utimestamp` bigint(20) default 0,
+ `bytes` int(18) unsigned default 0,
+ `pkts` int(18) unsigned default 0,
+ PRIMARY KEY (`id`),
+ UNIQUE (`source`, `destination`, `utimestamp`)
+) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
+
+ALTER TABLE `treport_content` ADD COLUMN `show_extended_events` tinyint(1) default '0';
+
+UPDATE `treport_content` SET type="netflow_summary" WHERE type="netflow_pie" OR type="netflow_statistics";
+
+UPDATE `tnetflow_filter` SET aggregate="dstip" WHERE aggregate NOT IN ("dstip", "srcip", "dstport", "srcport");
+
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
+ALTER TABLE `trecon_task` ADD COLUMN `summary` text;
+
COMMIT;
diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql
new file mode 100644
index 0000000000..697be21a93
--- /dev/null
+++ b/pandora_console/extras/mr/27.sql
@@ -0,0 +1,54 @@
+START TRANSACTION;
+
+ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
+
+ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
+
+UPDATE tuser_task SET parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
+
+ALTER TABLE `treport_content` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
+
+ALTER TABLE `treport_content_template` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
+
+ALTER TABLE `trecon_script` ADD COLUMN `type` int NOT NULL default 0;
+ALTER TABLE `trecon_task` ADD COLUMN `type` int NOT NULL default 0;
+
+UPDATE `trecon_script` SET `type` = 1 WHERE `name`="Discovery.Application.VMware";
+UPDATE `trecon_script` SET `type` = 2 WHERE `name`="Discovery.Cloud";
+UPDATE `trecon_script` SET `type` = 3 WHERE `name` LIKE "IPAM%Recon";
+UPDATE `trecon_script` SET `type` = 4 WHERE `name` LIKE "IPMI%Recon";
+
+UPDATE `trecon_task` SET `type`=3 WHERE `description`="Discovery.Application.VMware";
+UPDATE `trecon_task` SET `type`=2 WHERE `description`="Discovery.Cloud";
+UPDATE `trecon_task` SET `type`=7 WHERE `description`="Discovery.Cloud.RDS";
+
+COMMIT;
diff --git a/pandora_console/extras/mr/28.sql b/pandora_console/extras/mr/28.sql
new file mode 100644
index 0000000000..bab07bead8
--- /dev/null
+++ b/pandora_console/extras/mr/28.sql
@@ -0,0 +1,45 @@
+START TRANSACTION;
+
+ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+
+ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+
+ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
+
+ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
+
+DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event';
+INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (NULL,'admin','Welcome to Pandora FMS Console', '<p style="text-align: center; font-size: 13px;">Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&gt; Site news.</p> ',NOW());
+
+
+INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official communication"), "admin", 1, 0);
+UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System status' OR `description` = 'Official communication';
+UPDATE `tnotification_source` SET `icon`="icono_logo_pandora.png" WHERE `description` = 'Official communication';
+
+-- ---------------------------------------------------------------------
+-- Table `tvisual_console_items_cache`
+-- ---------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` (
+ `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ `vc_id` INTEGER UNSIGNED NOT NULL,
+ `vc_item_id` INTEGER UNSIGNED NOT NULL,
+ `user_id` VARCHAR(60) DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `expiration` INTEGER UNSIGNED NOT NULL COMMENT 'Seconds to expire',
+ PRIMARY KEY(`id`),
+ FOREIGN KEY(`vc_id`) REFERENCES `tlayout`(`id`)
+ ON DELETE CASCADE,
+ FOREIGN KEY(`vc_item_id`) REFERENCES `tlayout_data`(`id`)
+ ON DELETE CASCADE,
+ FOREIGN KEY (`user_id`) REFERENCES `tusuario`(`id_user`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) engine=InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
+
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1) DEFAULT '1';
+
+COMMIT;
diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql
new file mode 100644
index 0000000000..2bc8b9a8c9
--- /dev/null
+++ b/pandora_console/extras/mr/29.sql
@@ -0,0 +1,28 @@
+START TRANSACTION;
+
+ALTER TABLE `tmetaconsole_agent` ADD INDEX `id_tagente_idx` (`id_tagente`);
+
+DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x';
+
+CREATE TABLE IF NOT EXISTS `tcredential_store` (
+ `identifier` varchar(100) NOT NULL,
+ `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
+ `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
+ `username` text,
+ `password` text,
+ `extra_1` text,
+ `extra_2` text,
+ PRIMARY KEY (`identifier`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+
+INSERT INTO `tcredential_store` (`identifier`, `id_group`, `product`, `username`, `password`) VALUES ("imported_aws_account", 0, "AWS", (SELECT `value` FROM `tconfig` WHERE `token` = "aws_access_key_id" LIMIT 1), (SELECT `value` FROM `tconfig` WHERE `token` = "aws_secret_access_key" LIMIT 1));
+DELETE FROM `tcredential_store` WHERE `username` IS NULL AND `password` IS NULL;
+
+UPDATE `tagente` ta INNER JOIN `tagente` taa on ta.`id_parent` = taa.`id_agente` AND taa.`nombre` IN ("us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1") SET ta.nombre = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), ta.`nombre`));
+
+UPDATE `tagente` SET `nombre` = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), `nombre`)) WHERE `nombre` IN ("Aws", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1");
+
+UPDATE `trecon_task` SET `auth_strings` = "imported_aws_account" WHERE `type` IN (2,6,7);
+
+COMMIT;
diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php
index d6cd017087..f3b11177d1 100644
--- a/pandora_console/extras/pandora_diag.php
+++ b/pandora_console/extras/pandora_diag.php
@@ -122,7 +122,7 @@ function execution_time()
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
return "
Warning Status   The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph";
} else {
- return "
Normal Status   The execution time is correct. For a more extensive information of this data consult the Execution Time graph";
+ return "
Normal Status   The execution time is correct. For more information about this data, check the Execution Time graph";
}
}
@@ -140,7 +140,8 @@ function get_status_logs($path)
{
$status_server_log = '';
$size_server_log = number_format(get_logs_size($path));
- if ($size_server_log <= 1048576) {
+ $size_server_log = (0 + str_replace(',', '', $size_server_log));
+ if ($size_server_log <= 10485760) {
$status_server_log = "
Normal Status   You have less than 10 MB of logs";
} else {
$status_server_log = "
Warning Status   You have more than 10 MB of logs";
@@ -157,9 +158,9 @@ function percentage_modules_per_agent()
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = ($total_modules / $total_agents);
if ($average_modules_per_agent <= 40) {
- $status_average_modules = "
Normal Status   The average of modules per agent is less than 40 percent";
+ $status_average_modules = "
Normal Status   The average of modules per agent is less than 40";
} else {
- $status_average_modules = "
Warning Status  The average of modules per agent is more than 40 percent. You can have performance problems";
+ $status_average_modules = "
Warning Status  The average of modules per agent is more than 40. You can have performance problems";
}
return $status_average_modules;
@@ -173,9 +174,9 @@ function license_capacity()
$status_license_capacity = '';
$current_count = db_get_value_sql('SELECT count(*) FROM tagente');
if ($current_count > ($license_limit * 90 / 100)) {
- $status_license_capacity = "
Warning Status   The license capacity is more than 90 percent";
+ $status_license_capacity = "
Warning Status   License capacity exceeds 90 percent";
} else {
- $status_license_capacity = "
Normal Status   The license capacity is less than 90 percent";
+ $status_license_capacity = "
Normal Status   License capacity is less than 90 percent";
}
return $status_license_capacity;
@@ -202,9 +203,9 @@ function interval_average_of_network_modules()
$average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) {
- $status_average_modules = "
Warning Status   The system has a lot of load and a very fine configuration is required";
+ $status_average_modules = "
Warning Status   The system is overloaded (average time $average_time) and a very fine configuration is required";
} else {
- $status_average_modules = "
Normal Status   The system has an acceptable charge";
+ $status_average_modules = "
Normal Status   The system is not overloaded (average time $average_time) ";
}
if ($average_time == 0) {
@@ -221,9 +222,9 @@ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLO
function files_attachment_folder($total_files)
{
if ($total_files <= 700) {
- $status_total_files = "
Normal Status   The attachment folder has less than 700 files.";
+ $status_total_files = "
Normal Status   The attached folder contains less than 700 files.";
} else {
- $status_total_files = "
Warning Status   The attachment folder has more than 700 files.";
+ $status_total_files = "
Warning Status   The attached folder contains more than 700 files.";
}
return $status_total_files;
@@ -236,9 +237,9 @@ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size)
{
if ($tagente_datos_size <= 3000000) {
- $tagente_datos_size = "
Normal Status   The tagente_datos table has an acceptable amount of data.";
+ $tagente_datos_size = "
Normal Status   The tagente_datos table contains an acceptable amount of data.";
} else {
- $tagente_datos_size = "
Warning Status   The tagente_datos table has too much data. A historical database is recommended.";
+ $tagente_datos_size = "
Warning Status   The tagente_datos table contains too much data. A historical database is recommended.";
}
return $tagente_datos_size;
@@ -274,6 +275,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
}
$path_server_logs = '/log/pandora/pandora_server.log';
+$path_err_logs = '/log/pandora/pandora_server.error';
$path_console_logs = '/www/html/pandora_console/pandora_console.log';
$innodb_log_file_size_min_rec_value = '64M';
$innodb_log_buffer_size_min_rec_value = '16M';
@@ -294,16 +296,16 @@ $key_buffer_size_min_rec_value = 256;
$read_buffer_size_min_rec_value = 32;
$read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2;
-$innodb_file_per_table_min_rec_value = 0;
+$innodb_file_per_table_min_rec_value = 1;
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
{
$status_tables_frag = '';
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
- $status_tables_frag = "
Warning Status   The fragmentation tables is higher than recommended. You should defragment them.";
+ $status_tables_frag = "
Warning Status   Table fragmentation is higher than recommended. They should be defragmented.";
} else {
- $status_tables_frag = "
Normal Status   The fragmentation tables is correct.";
+ $status_tables_frag = "
Normal Status   Table fragmentation is correct.";
}
return $status_tables_frag;
@@ -319,9 +321,9 @@ if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
- echo "\nThis command line script gives information about Pandora FMS database.
-This program only can be executed from console, and need a parameter, the
-full path to Pandora FMS 'config.php' file.
+ echo "\nThis command line script contains information about Pandora FMS database.
+ This program can only be executed from the console, and it needs a parameter, the
+ full path to Pandora FMS 'config.php' file.
Usage:
php pandora_diag.php path_to_pandora_console
@@ -344,15 +346,21 @@ full path to Pandora FMS 'config.php' file.
include '../include/config.php';
}
- // Not from console, this is a web session
- if ((!isset($config['id_user'])) or (!check_acl($config['id_user'], 0, 'PM'))) {
+ // Not from console, this is a web session.
+ if ((!isset($config['id_user'])) || (!check_acl($config['id_user'], 0, 'PM'))) {
echo "
You don't have privileges to use diagnostic tool
";
echo '
Please login with an administrator account before try to use this tool
';
exit;
}
- // Header
- ui_print_page_header(__('Pandora FMS Diagnostic tool'), '', false, '', true);
+ // Header.
+ ui_print_page_header(
+ __('Pandora FMS Diagnostic tool'),
+ '',
+ false,
+ 'diagnostic_tool_tab',
+ true
+ );
echo "
";
echo "".__('Pandora status info').' |
';
@@ -677,7 +685,7 @@ render_info_data(
$read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
$query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
$innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
- echo "".__('MySQL Performance metrics').' |
';
+ echo "".__('MySQL Performance metrics').' '.ui_print_help_icon('performance_metrics_tab', true).' |
';
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
@@ -704,12 +712,14 @@ render_info_data(
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
- render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables');
+ render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
echo "".__(' Pandora FMS logs dates').' |
';
render_row(number_format((get_logs_size($path_server_logs) / 1048576), 3).'M', 'Size server logs (current value)');
render_row(get_status_logs($path_server_logs), 'Status server logs');
+ render_row(number_format((get_logs_size($path_err_logs) / 1048576), 3).'M', 'Size error logs (current value)');
+ render_row(get_status_logs($path_err_logs), 'Status error logs');
render_row(number_format((get_logs_size($path_console_logs) / 1048576), 3).'M', 'Size console logs (current value)');
render_row(get_status_logs($path_console_logs), 'Status console logs');
@@ -731,14 +741,14 @@ render_info_data(
echo "".__(' Status of the attachment folder').' |
';
- render_row($attachment_total_files, 'Total files in the attachment folder');
+ render_row($attachment_total_files, 'Total files in the attached folder');
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
echo "".__(' Information from the tagente_datos table').' |
';
- render_row($tagente_datos_size, 'Total data in the tagente_datos table');
- render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table');
- render_row(execution_time(), 'Degradation of the execution time when executing a count');
+ render_row($tagente_datos_size, 'Total data in tagente_datos table');
+ render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
+ render_row(execution_time(), 'Execution time degradation when executing a count');
echo "".__(' Pandora FMS server threads').' |
';
@@ -781,6 +791,6 @@ render_info_data(
echo "
";
echo ''.__(
- '(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
-keep up-to-date database to get the best performance and results in Pandora'
+ '(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
+ keep the database up-to-date to get the best performance and results in Pandora'
).'
';
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 e7cedb62f5..4bad7b3652 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
@@ -58,6 +58,7 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` (
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
+ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- -----------------------------------------------------
-- Table `tpolicy_modules`
@@ -136,6 +137,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` (
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
+ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tpolicies`
@@ -759,11 +761,41 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
+-- ----------------------------------------------------------------------
+-- Table `tnews`
+-- ----------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tnews` (
+ `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ `author` varchar(255) NOT NULL DEFAULT '',
+ `subject` varchar(255) NOT NULL DEFAULT '',
+ `text` TEXT NOT NULL,
+ `timestamp` DATETIME NOT NULL DEFAULT 0,
+ `id_group` int(10) NOT NULL default 0,
+ `modal` tinyint(1) DEFAULT 0,
+ `expire` tinyint(1) DEFAULT 0,
+ `expire_timestamp` DATETIME NOT NULL DEFAULT 0,
+ PRIMARY KEY(`id_news`)
+) ENGINE = InnoDB DEFAULT CHARSET=utf8;
+
+
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
ALTER TABLE treport_content_template ADD COLUMN `visual_format` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `hide_no_data` tinyint(1) default '0';
+ALTER TABLE `treport_content_template` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@@ -975,10 +1007,12 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`agent_version` varchar(100) default '',
`ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00',
`disabled` tinyint(2) NOT NULL default '0',
+ `remote` tinyint(1) NOT NULL default '0',
`id_parent` int(10) unsigned default '0',
`custom_id` varchar(255) default '',
`server_name` varchar(100) default '',
`cascade_protection` tinyint(2) NOT NULL default '0',
+ `cascade_protection_module` int(10) unsigned default '0',
`timezone_offset` TINYINT(2) NULL DEFAULT '0' COMMENT 'number of hours of diference with the server timezone' ,
`icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' ,
`update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' ,
@@ -993,19 +1027,21 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`fired_count` bigint(20) NOT NULL default '0',
`update_module_count` tinyint(1) NOT NULL default '0',
`update_alert_count` tinyint(1) NOT NULL default '0',
+ `update_secondary_groups` tinyint(1) NOT NULL default '0',
+ `transactional_agent` tinyint(1) NOT NULL default '0',
+ `alias` varchar(600) BINARY NOT NULL default '',
+ `alias_as_name` tinyint(2) NOT NULL default '0',
+ `safe_mode_module` int(10) unsigned NOT NULL default '0',
+ `cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
+ KEY `id_tagente_idx` (`id_tagente`),
KEY `disabled` (`disabled`),
KEY `id_grupo` (`id_grupo`),
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-ALTER TABLE tmetaconsole_agent ADD COLUMN `remote` tinyint(1) NOT NULL default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT NULL default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT '';
-
-- ---------------------------------------------------------------------
-- Table `ttransaction`
-- ---------------------------------------------------------------------
@@ -1150,6 +1186,9 @@ ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0
ALTER TABLE tagente_estado CHANGE `last_known_status` `known_status` tinyint(4) default 0;
ALTER TABLE tagente_estado ADD COLUMN `last_known_status` tinyint(4) default 0;
ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL default 0;
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
+ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `talert_actions`
@@ -1180,6 +1219,7 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket';
UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:
_field1_ as destination email address, and
_field2_ as subject for message.
_field3_ as text of message.
_field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0;
+ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
@@ -1199,13 +1239,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 26);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 29);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '733');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '736');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- ---------------------------------------------------------------------
@@ -1252,6 +1292,11 @@ alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
ALTER TABLE `tusuario` DROP COLUMN `flash_chart`;
ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0';
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
+ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1);
+
+
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
@@ -1260,6 +1305,10 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0;
+ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0';
+ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0';
+ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
@@ -1279,6 +1328,7 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_max` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
+ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente`
@@ -1329,6 +1379,7 @@ ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_type` ENUM ('default
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0;
+ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
@@ -1355,6 +1406,7 @@ ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT "";
+UPDATE `tnetflow_filter` SET aggregate="dstip" WHERE aggregate NOT IN ("dstip", "srcip", "dstport", "srcport");
-- ---------------------------------------------------------------------
-- Table `treport_custom_sql`
@@ -1369,13 +1421,27 @@ UPDATE treport_custom_sql SET `sql` = 'select t1.alias as agent_n
-- ----------------------------------------------------------------------
-- Table `treport_content`
-- ---------------------------------------------------------------------
-
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300';
ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `hide_no_data` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `recursion` tinyint(1) default NULL;
+ALTER TABLE treport_content ADD COLUMN `show_extended_events` tinyint(1) default '0';
+UPDATE `treport_content` SET type="netflow_summary" WHERE type="netflow_pie" OR type="netflow_statistics";
+ALTER TABLE `treport_content` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
@@ -1410,6 +1476,7 @@ ALTER TABLE trecon_task ADD `vlan_enabled` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE trecon_task ADD `auth_strings` text;
ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0';
+ALTER TABLE trecon_task ADD `summary` text;
-- ---------------------------------------------------------------------
-- Table `twidget` AND Table `twidget_dashboard`
@@ -1912,6 +1979,47 @@ CREATE TABLE `tgis_map_layer_groups` (
CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+-- -----------------------------------------------------
+-- Table `tnetwork_matrix`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `source` varchar(60) default '',
+ `destination` varchar(60) default '',
+ `utimestamp` bigint(20) default 0,
+ `bytes` int(18) unsigned default 0,
+ `pkts` int(18) unsigned default 0,
+ PRIMARY KEY (`id`),
+ UNIQUE (`source`, `destination`, `utimestamp`)
+) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
+
+-- ---------------------------------------------------------------------
+-- Table `user_task`
+-- ---------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tuser_task` (
+ `id` int(20) unsigned NOT NULL auto_increment,
+ `function_name` varchar(80) NOT NULL default '',
+ `parameters` text NOT NULL default '',
+ `name` varchar(60) NOT NULL default '',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `user_task_scheduled`
+-- ---------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` (
+ `id` int(20) unsigned NOT NULL auto_increment,
+ `id_usuario` varchar(60) NOT NULL default '0',
+ `id_user_task` int(20) unsigned NOT NULL default '0',
+ `args` TEXT NOT NULL,
+ `scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no',
+ `last_run` int(20) unsigned default '0',
+ `custom_data` int(10) NULL default '0',
+ `flag_delete` tinyint(1) UNSIGNED NOT NULL default 0,
+ `id_grupo` int(10) unsigned NOT NULL default 0,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
-- -----------------------------------------------------
-- Table `tnotification_source`
-- -----------------------------------------------------
@@ -1934,7 +2042,7 @@ INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `
("Message", "icono_info_mr.png", 86400, 1, 1, 0),
("Pending task", "icono_info_mr.png", 86400, 1, 1, 0),
("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0),
- ("Official communication", "icono_info_mr.png", 86400, 1, 1, 0),
+ ("Official communication", "icono_logo_pandora.png", 86400, 1, 1, 0),
("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0);
-- -----------------------------------------------------
@@ -2031,6 +2139,9 @@ INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fi
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System status"), "admin", 1, 0);
INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message";
INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != '';
+INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official communication"), "admin", 1, 0);
+UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System status' OR `description` = 'Official communication';
+
-- ----------------------------------------------------------------------
-- Add custom internal recon scripts
-- ----------------------------------------------------------------------
@@ -2040,3 +2151,61 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di
-- Add column in table `tagent_custom_fields`
-- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
+
+-- ----------------------------------------------------------------------
+-- Add column in table `tnetflow_filter`
+-- ----------------------------------------------------------------------
+ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
+
+
+-- ----------------------------------------------------------------------
+-- Update table `tuser_task`
+-- ----------------------------------------------------------------------
+UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
+
+-- ----------------------------------------------------------------------
+-- ADD message in table 'tnews'
+-- ----------------------------------------------------------------------
+
+INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (NULL,'admin','Welcome to Pandora FMS Console', '<p style="text-align: center; font-size: 13px;">Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&gt; Site news.</p> ',NOW());
+
+-- ----------------------------------------------------------------------
+-- Alter table `talert_templates`
+-- ----------------------------------------------------------------------
+
+ ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
+
+-- ---------------------------------------------------------------------
+-- Table `tvisual_console_items_cache`
+-- ---------------------------------------------------------------------
+CREATE TABLE `tvisual_console_elements_cache` (
+ `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ `vc_id` INTEGER UNSIGNED NOT NULL,
+ `vc_item_id` INTEGER UNSIGNED NOT NULL,
+ `user_id` VARCHAR(60) DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `expiration` INTEGER UNSIGNED NOT NULL COMMENT 'Seconds to expire',
+ PRIMARY KEY(`id`),
+ FOREIGN KEY(`vc_id`) REFERENCES `tlayout`(`id`)
+ ON DELETE CASCADE,
+ FOREIGN KEY(`vc_item_id`) REFERENCES `tlayout_data`(`id`)
+ ON DELETE CASCADE,
+ FOREIGN KEY (`user_id`) REFERENCES `tusuario`(`id_user`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE
+) engine=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `tcredential_store`
+-- ---------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tcredential_store` (
+ `identifier` varchar(100) NOT NULL,
+ `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
+ `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
+ `username` text,
+ `password` text,
+ `extra_1` text,
+ `extra_2` text,
+ PRIMARY KEY (`identifier`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/pandora_console/general/firts_task/collections.php b/pandora_console/general/firts_task/collections.php
index 269de3ba12..8e27ce6ee3 100755
--- a/pandora_console/general/firts_task/collections.php
+++ b/pandora_console/general/firts_task/collections.php
@@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
__('Collections')]); ?>
-
+
true, 'message' => __('There are no custom
__('Custom Fields')]); ?>
-
+
true, 'message' => __('There are no custom
__('Custom Graphs')]); ?>
-
+
__('Fields Manager')]); ?>
-
+
__('Incidents')]); ?>
-
+
__('Visual Console')]); ?>
-
+
__('Network Map')]); ?>
-
+
__('Planned Downtime')]); ?>
-
+
__('Discovery server')]); ?>
diff --git a/pandora_console/general/firts_task/service_list.php b/pandora_console/general/firts_task/service_list.php
index f3971ca786..424bc60400 100755
--- a/pandora_console/general/firts_task/service_list.php
+++ b/pandora_console/general/firts_task/service_list.php
@@ -25,7 +25,7 @@ ui_require_css_file('firts_task');
__('Services')]); ?>
-
+
__('SNMP Filter')]); ?>
-
+
__('Transactions')]); ?>
-
+
';
+echo ''.__('Page generated on %s', date('Y-m-d H:i:s')).'';
+
-echo ' ';
-echo '
® '.get_copyright_notice().'';
if (isset($config['debug'])) {
$cache_info = [];
diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php
index 7addef057f..a093596b2b 100644
--- a/pandora_console/general/header.php
+++ b/pandora_console/general/header.php
@@ -18,10 +18,14 @@ require_once 'include/functions_notifications.php';
// Global errors/warnings checking.
config_check();
-?>
-
';
echo '
';
- html_print_submit_button(__('Check code').' >', 'login_button', false, 'class="sub next_login"');
+ html_print_submit_button(__('Check code').' >', 'login_button', false, 'class="next_login"');
echo '
';
break;
@@ -305,12 +305,12 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
echo '
';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_splash_login'])) {
- html_print_image('enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ 'alt' => 'splash', 'border' => 0, 'title' => $splash_title], false, true);
+ html_print_image('enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ 'alt' => 'splash', 'border' => 0], false, true);
} else {
- html_print_image('enterprise/images/custom_splash_login/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
+ html_print_image('enterprise/images/custom_splash_login/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0], false, true);
}
} else {
- html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
+ html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0], false, true);
}
echo '
';
@@ -319,7 +319,7 @@ echo '
';
echo ''.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'
';
echo '';
-if (!isset($process_error_message) && isset($mail)) {
+if (empty($process_error_message) && isset($mail)) {
echo '';
echo '
';
echo '
';
@@ -336,7 +336,7 @@ if (!isset($process_error_message) && isset($mail)) {
echo '
';
echo '
';
echo '
';
-} else if (isset($process_error_message)) {
+} else if (isset($process_error_message) && !empty($process_error_message)) {
echo '';
echo '
';
echo '
';
@@ -518,6 +518,7 @@ if ($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig'
ui_require_css_file('dialog');
ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui.min');
+ui_require_jquery_file('jquery-ui_custom');
?>
$email],
- ['id_user' => $config['id_user']]
- );
- }
-
- // Update the alert action Mail to XXX/Administrator if it is set to default
- $mail_check = 'yourmail@domain.es';
- $mail_alert = alerts_get_alert_action_field1(1);
- if ($mail_check === $mail_alert && $email !== false) {
- alerts_update_alert_action(
- 1,
- [
- 'field1' => $email,
- 'field1_recovery' => $email,
- ]
- );
- }
-
- config_update_value('initial_wizard', 1);
- }
-
- // Change the language if is change in checkbox
- if ($change_language !== 0) {
- config_update_value('language', $change_language);
- }
-
- if ($cancel_wizard !== 0) {
- config_update_value('initial_wizard', 1);
- }
-
- return;
-}
-
-$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
-// Avoid to show default email
-if ($email == 'admin@example.com') {
- $email = '';
-}
-
-// Prints first step pandora registration
-echo '
';
-
- echo '
';
- echo __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.';
- echo '
';
-
- echo '
';
- $table = new StdClass();
- $table->class = 'databox filters';
- $table->width = '100%';
- $table->data = [];
- $table->size = [];
- $table->size[0] = '40%';
- $table->style[0] = 'font-weight:bold';
- $table->size[1] = '60%';
- $table->border = '5px solid';
-
- $table->data[0][0] = __('Language code');
- $table->data[0][1] = html_print_select_from_sql(
- 'SELECT id_language, name FROM tlanguage',
- 'language',
- $config['language'],
- '',
- '',
- '',
- true
- );
-
- $zone_name = [
- 'Africa' => __('Africa'),
- 'America' => __('America'),
- 'Antarctica' => __('Antarctica'),
- 'Arctic' => __('Arctic'),
- 'Asia' => __('Asia'),
- 'Atlantic' => __('Atlantic'),
- 'Australia' => __('Australia'),
- 'Europe' => __('Europe'),
- 'Indian' => __('Indian'),
- 'Pacific' => __('Pacific'),
- 'UTC' => __('UTC'),
- ];
-
- if ($zone_selected == '') {
- if ($config['timezone'] != '') {
- $zone_array = explode('/', $config['timezone']);
- $zone_selected = $zone_array[0];
- } else {
- $zone_selected = 'Europe';
- }
- }
-
- $timezones = timezone_identifiers_list();
- foreach ($timezones as $timezone) {
- if (strpos($timezone, $zone_selected) !== false) {
- $timezone_country = preg_replace('/^.*\//', '', $timezone);
- $timezone_n[$timezone] = $timezone_country;
- }
- }
-
- $table->data[2][0] = __('Timezone setup').' '.ui_print_help_tip(
- __('Must have the same time zone as the system or database to avoid mismatches of time.'),
- true
- );
- $table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
- $table->data[2][1] .= ' '.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
-
- $table->data[4][0] = __('E-mail for receiving alerts');
- $table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true);
-
- html_print_table($table);
- echo '
';
-
- echo '
';
- echo '
';
- html_print_submit_button(__('Register'), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
- echo '
';
- echo '
';
- html_print_button(__('Cancel'), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
- echo '
';
- echo '
';
- echo __('All fields required');
- echo '
';
- echo '
';
-
- echo '
';
-
- ?>
-
-
diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php
index 21c9713a48..a02f6c11ac 100644
--- a/pandora_console/general/logon_ok.php
+++ b/pandora_console/general/logon_ok.php
@@ -1,26 +1,39 @@
-
-
-
-
-
-
- class = 'databox';
- $table->cellpadding = 4;
- $table->cellspacing = 4;
- $table->head = [];
- $table->data = [];
- $table->headstyle[0] = 'text-align:center;';
- $table->width = '100%';
- $table->head[0] = ''.__('%s Overview', get_product_name()).'';
- $table->head_colspan[0] = 4;
- // Indicators
- $tdata = [];
- $stats = reporting_get_stats_indicators($data, 120, 10, false);
- $status = '';
- foreach ($stats as $stat) {
- $status .= ''.$stat['title'].''.' | '.$stat['graph'].' | ';
- }
+ui_require_css_file('logon');
- $status .= ' ';
- $table->data[0][0] = $status;
- $table->rowclass[] = '';
+echo '';
- $table->data[] = $tdata;
+//
+// Overview Table.
+//
+$table = new stdClass();
+$table->class = 'no-class';
+$table->cellpadding = 4;
+$table->cellspacing = 4;
+$table->head = [];
+$table->data = [];
+$table->headstyle[0] = 'text-align:center;';
+$table->width = '100%';
+$table->head_colspan[0] = 4;
- // Alerts
- $tdata = [];
- $tdata[0] = reporting_get_stats_alerts($data);
- $table->rowclass[] = '';
- $table->data[] = $tdata;
+// Indicators.
+$tdata = [];
+$stats = reporting_get_stats_indicators($data, 120, 10, false);
+$status = ' ';
+foreach ($stats as $stat) {
+ $status .= ''.$stat['title'].' | '.$stat['graph'].' | ';
+}
- // Modules by status
- $tdata = [];
- $tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
- $table->rowclass[] = '';
- $table->data[] = $tdata;
+$status .= ' ';
+$table->data[0][0] = $status;
+$table->rowclass[] = '';
- // Total agents and modules
- $tdata = [];
- $tdata[0] = reporting_get_stats_agents_monitors($data);
- $table->rowclass[] = '';
- $table->data[] = $tdata;
+$table->data[] = $tdata;
- // Users
- if (users_is_admin()) {
- $tdata = [];
- $tdata[0] = reporting_get_stats_users($data);
- $table->rowclass[] = '';
- $table->data[] = $tdata;
- }
+// Alerts.
+$tdata = [];
+$tdata[0] = reporting_get_stats_alerts($data);
+$table->rowclass[] = '';
+$table->data[] = $tdata;
- html_print_table($table);
- unset($table);
- ?>
-
-
- |
-
-
-
-
- rowclass[] = '';
+$table->data[] = $tdata;
+
+// Total agents and modules.
+$tdata = [];
+$tdata[0] = reporting_get_stats_agents_monitors($data);
+$table->rowclass[] = '';
+$table->data[] = $tdata;
+
+// Users.
+if (users_is_admin()) {
+ $tdata = [];
+ $tdata[0] = reporting_get_stats_users($data);
+ $table->rowclass[] = '';
+ $table->data[] = $tdata;
+}
+
+ui_toggle(
+ html_print_table($table, true),
+ __('%s Overview', get_product_name()),
+ '',
+ 'overview',
+ false
+);
+unset($table);
+
+echo '';
+
+// News.
+$options = [];
+$options['id_user'] = $config['id_user'];
+$options['modal'] = false;
+$options['limit'] = 3;
+$news = get_news($options);
- if (!empty($news)) {
- // NEWS BOARD/////////////////////////////
- echo ' ';
+if (!empty($news)) {
+ ui_require_css_file('news');
+ // NEWS BOARD.
+ if ($config['prominent_time'] == 'timestamp') {
+ $comparation_suffix = '';
+ } else {
+ $comparation_suffix = __('ago');
+ }
- echo ' ';
- echo ''.__('News board').' | ';
- if ($config['prominent_time'] == 'timestamp') {
- $comparation_suffix = '';
- } else {
- $comparation_suffix = __('ago');
- }
+ $output_news = '';
+ foreach ($news as $article) {
+ $image = false;
+ if ($article['text'] == '<p style="text-align: center; font-size: 13px;">Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&gt; Site news.</p> ') {
+ $image = true;
+ }
- foreach ($news as $article) {
- $text = io_safe_output($article['text']);
+ $text_bbdd = io_safe_output($article['text']);
+ $text = html_entity_decode($text_bbdd);
+ $output_news .= ' '.$article['subject'].'';
+ $output_news .= ' ';
+ $output_news .= ' '.__('by').' '.$article['author'].' '.ui_print_timestamp($article['timestamp'], true).' '.$comparation_suffix.' ';
+ if ($image) {
+ $output_news .= '  ';
+ }
+
+ $output_news .= nl2br($text);
+ $output_news .= ' ';
+ }
+
+ $output_news .= ' ';
+
+ // News board.
+ ui_toggle(
+ $output_news,
+ __('News board'),
+ '',
+ 'news',
+ false
+ );
+ // END OF NEWS BOARD.
+}
+
+// LAST ACTIVITY.
+// Show last activity from this user.
+$table = new stdClass();
+$table->class = 'no-td-padding info_table';
+$table->cellpadding = 0;
+$table->cellspacing = 0;
+$table->width = '100%';
+// Don't specify px.
+$table->data = [];
+$table->size = [];
+$table->headstyle = [];
+$table->size[0] = '5%';
+$table->size[1] = '15%';
+$table->headstyle[1] = 'min-width: 12em;';
+$table->size[2] = '5%';
+$table->headstyle[2] = 'min-width: 65px;';
+$table->size[3] = '10%';
+$table->size[4] = '25%';
+$table->head = [];
+$table->head[0] = __('User');
+$table->head[1] = __('Action');
+$table->head[2] = __('Date');
+$table->head[3] = __('Source IP');
+$table->head[4] = __('Comments');
+$table->align[4] = 'left';
+$sql = sprintf(
+ 'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
+ FROM tsesion
+ WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
+ AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
+ $config['id_user']
+);
- echo ''.$article['subject'].' | ';
- echo ''.__('by').' '.$article['author'].' '.ui_print_timestamp($article['timestamp'], true).' '.$comparation_suffix.' | ';
- echo '';
- echo nl2br($text);
- echo ' | ';
- }
+$sessions = db_get_all_rows_sql($sql);
- echo ' ';
- echo ' ';
- // News board
- echo ' ';
+if ($sessions === false) {
+ $sessions = [];
+}
- // END OF NEWS BOARD/////////////////////////////
- }
-
- // LAST ACTIVITY/////////////////////////////
- // Show last activity from this user
- echo ' ';
-
- $table = new stdClass();
- $table->class = 'databox data';
- $table->width = '100%';
- // Don't specify px
- $table->data = [];
- $table->size = [];
- $table->size[0] = '5%';
- $table->size[1] = '15%';
- $table->size[2] = '15%';
- $table->size[3] = '10%';
- $table->size[4] = '25%';
- $table->head = [];
- $table->head[0] = __('User');
- $table->head[1] = __('Action');
- $table->head[2] = __('Date');
- $table->head[3] = __('Source IP');
- $table->head[4] = __('Comments');
- $table->title = ' '.__('This is your last activity performed on the %s console', get_product_name()).'';
-
- switch ($config['dbtype']) {
- case 'mysql':
- $sql = sprintf(
- 'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
- FROM tsesion
- WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
- AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
- $config['id_user']
- );
- break;
-
- case 'postgresql':
- $sql = sprintf(
- "SELECT \"id_usuario\", accion, \"ip_origen\", descripcion, utimestamp
- FROM tsesion
- WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_1WEEK.")
- AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10",
- $config['id_user']
- );
- break;
-
- case 'oracle':
- $sql = sprintf(
- "SELECT id_usuario, accion, ip_origen, descripcion, utimestamp
- FROM tsesion
- WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_1WEEK.")
- AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC",
- $config['id_user']
- );
- break;
- }
-
- $sessions = db_get_all_rows_sql($sql);
-
- if ($sessions === false) {
- $sessions = [];
- }
-
- foreach ($sessions as $session) {
- $data = [];
-
- switch ($config['dbtype']) {
- case 'mysql':
- case 'oracle':
- $session_id_usuario = $session['id_usuario'];
- $session_ip_origen = $session['ip_origen'];
- break;
-
- case 'postgresql':
- $session_id_usuario = $session['id_usuario'];
- $session_ip_origen = $session['ip_origen'];
- break;
- }
+foreach ($sessions as $session) {
+ $data = [];
+ $session_id_usuario = $session['id_usuario'];
+ $session_ip_origen = $session['ip_origen'];
- $data[0] = ' '.$session_id_usuario.'';
- $data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
- $data[2] = ui_print_help_tip(date($config['date_format'], $session['utimestamp']), true).human_time_comparation($session['utimestamp'], 'tiny');
- $data[3] = $session_ip_origen;
- $description = str_replace([',', ', '], ', ', $session['descripcion']);
- if (strlen($description) > 100) {
- $data[4] = ' '.io_safe_output(substr($description, 0, 150).'...').' ';
- } else {
- $data[4] = ' '.io_safe_output($description).' ';
- }
+ $data[0] = ' '.$session_id_usuario.'';
+ $data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
+ $data[2] = ui_print_help_tip(
+ date($config['date_format'], $session['utimestamp']),
+ true
+ ).human_time_comparation($session['utimestamp'], 'tiny');
+ $data[3] = $session_ip_origen;
+ $description = str_replace([',', ', '], ', ', $session['descripcion']);
+ if (strlen($description) > 100) {
+ $data[4] = ' '.io_safe_output(substr($description, 0, 150).'...').' ';
+ } else {
+ $data[4] = ' '.io_safe_output($description).' ';
+ }
- array_push($table->data, $data);
- }
+ array_push($table->data, $data);
+}
- echo " ";
- html_print_table($table);
- unset($table);
- echo ' ';
- echo ' ';
- // activity
- // END OF LAST ACTIVIYY/////////////////////////////
- ?>
-
-
- |
-
-
-
+$activity .= html_print_table($table, true);
+unset($table);
+
+ui_toggle(
+ $activity,
+ __('Latest activity'),
+ '',
+ 'activity',
+ false,
+ false,
+ '',
+ 'white-box-content padded'
+);
+// END OF LAST ACTIVIYY.
+// Close right panel.
+echo '
';
+
+// Close welcome panel.
+echo '
';
diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php
index cb5126b621..ca6c0fd473 100644
--- a/pandora_console/general/main_menu.php
+++ b/pandora_console/general/main_menu.php
@@ -20,40 +20,16 @@ if (! isset($config['id_user'])) {
';
+if ($config['menu_type'] == 'classic') {
+ echo '