Merge remote-tracking branch 'origin/develop' into 2497-Especificar-version-SNMP-en-tarea-de-reconocimiento-Lead-21487

Conflicts:
	pandora_console/extras/mr/20.sql
	pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
	pandora_console/pandoradb.sql
This commit is contained in:
manuel.montes 2018-09-18 11:17:47 +02:00
commit 65010d7080
44 changed files with 849 additions and 355 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.727
Version: 7.0NG.727-180918
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.727"
pandora_version="7.0NG.727-180918"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.727';
use constant AGENT_BUILD => '180913';
use constant AGENT_BUILD => '180918';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.727
%define release 1
%define release 180918
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.727
%define release 1
%define release 180918
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.727"
PI_BUILD="180913"
PI_BUILD="180918"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{180913}
{180918}
ViewReadme
{Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No}
Windows,Executable
{<%AppName%>-Setup<%Ext%>}
{<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription
{<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.727(Build 180913)")
#define PANDORA_VERSION ("7.0NG.727(Build 180918)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.727(Build 180913))"
VALUE "ProductVersion", "(7.0NG.727(Build 180918))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.727
Version: 7.0NG.727-180918
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.727"
pandora_version="7.0NG.727-180918"
package_pear=0
package_pandora=1

View File

@ -31,5 +31,19 @@ ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL def
ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default '';
ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default '';
ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default '';
ALTER TABLE `tpolicy_modules_inventory` ADD COLUMN `custom_fields` MEDIUMBLOB NOT NULL;
CREATE TABLE IF NOT EXISTS `tlog_graph_models` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`title` TEXT NOT NULL,
`regexp` TEXT NOT NULL,
`fields` TEXT NOT NULL,
`average` tinyint(1) NOT NULL default '0',
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
INSERT INTO tlog_graph_models VALUES (1, 'Apache&#x20;log&#x20;model',
'^.*?&#92;s+.*&quot;.*?&#92;s&#40;&#92;/.*?&#41;&#92;?.*1.1&quot;&#92;s+&#40;.*?&#41;&#92;s+&#40;.*?&#41;&#92;s+',
'pagina,&#x20;html_err_code,&#x20;_tiempo_', 1);
COMMIT;

View File

@ -1769,13 +1769,28 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tlog_graph_models`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tlog_graph_models` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`title` TEXT NOT NULL,
`regexp` TEXT NOT NULL,
`fields` TEXT NOT NULL,
`average` tinyint(1) NOT NULL default '0',
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
INSERT INTO tlog_graph_models VALUES (1, 'Apache&#x20;log&#x20;model',
'^.*?&#92;s+.*&quot;.*?&#92;s&#40;&#92;/.*?&#41;&#92;?.*1.1&quot;&#92;s+&#40;.*?&#41;&#92;s+&#40;.*?&#41;&#92;s+',
'pagina,&#x20;html_err_code,&#x20;_tiempo_', 1);
-- -----------------------------------------------------
-- Add column in table `treport`
-- -----------------------------------------------------
ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1';
ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default '';
ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_pass` varchar(255) NOT NULL default '';

View File

@ -215,20 +215,57 @@ if (! check_acl($config['id_user'], 0, "PM")) {
return;
}
$sec = defined('METACONSOLE') ? 'advanced' : 'gagente';
$url_tree = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=tree";
$url_groups = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=groups";
$buttons['tree'] = array(
'active' => false,
'text' => "<a href='$url_tree'>" .
html_print_image(
"images/gm_massive_operations.png",
true,
array (
"title" => __('Tree Group view')
)
) . "</a>"
);
$buttons['groups'] = array(
'active' => false,
'text' => "<a href='$url_groups'>" .
html_print_image(
"images/group.png",
true,
array(
"title" => __('Group view')
)
) . "</a>"
);
$tab = (string)get_parameter('tab', 'groups');
// Marks correct tab
switch ($tab) {
case 'tree':
$buttons['tree']['active'] = true;
break;
case 'groups':
default:
$buttons['groups']['active'] = true;
break;
}
// Header
if (defined('METACONSOLE')) {
agents_meta_print_header();
$sec = 'advanced';
echo '<div class="notify">';
echo __("Edit or delete groups can cause problems with synchronization");
echo '</div>';
}
else {
} else {
ui_print_page_header (
__("Groups defined in %s", get_product_name()),
"images/group.png", false, "", true, ""
"images/group.png", false, "", true, $buttons
);
$sec = 'gagente';
}
$create_group = (bool) get_parameter ('create_group');
@ -365,148 +402,158 @@ if (($delete_group) && (check_acl($config['id_user'], 0, "PM"))) {
}
}
$acl='';
$search_name = '';
$offset = (int)get_parameter('offset', 0);
$search = (string)get_parameter('search', '');
$block_size = $config['block_size'];
if($tab == 'tree'){
echo html_print_image('images/spinner.gif', true,
array('class' => "loading_tree",
'style' => 'display: none;'));
echo "<div id='tree-controller-recipient'></div>";
if(!empty($search)){
$search_name = "AND t.nombre LIKE '%$search%'";
}
else{
$acl='';
$search_name = '';
$offset = (int)get_parameter('offset', 0);
$search = (string)get_parameter('search', '');
$block_size = $config['block_size'];
if (!users_can_manage_group_all("AR")){
$user_groups_acl = users_get_groups(false, "AR");
$groups_acl = implode(",", $user_groups_ACL);
if(empty($groups_acl)) return ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) );
if(!empty($search)){
$search_name = "AND t.nombre LIKE '%$search%'";
}
$acl = "AND t.id_grupo IN ($groups_acl)";
}
if (!users_can_manage_group_all("AR")){
$user_groups_acl = users_get_groups(false, "AR");
$groups_acl = implode(",", $user_groups_ACL);
if(empty($groups_acl)) return ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) );
$form = "<form method='post' action=''>";
$form .= "<table class='databox filters' width='100%' style='font-weight: bold;'>";
$form .= "<tr><td>" . __('Search') . '&nbsp;';
$form .= html_print_input_text ("search", $search, '', 100, 100, true);
$form .= "</td><td>";
$form .= "<input name='find' type='submit' class='sub search' value='".__('Search')."'>";
$form .= "<td></tr>";
$form .= "</table>";
$form .= "</form>";
$acl = "AND t.id_grupo IN ($groups_acl)";
}
echo $form;
$form = "<form method='post' action=''>";
$form .= "<table class='databox filters' width='100%' style='font-weight: bold;'>";
$form .= "<tr><td>" . __('Search') . '&nbsp;';
$form .= html_print_input_text ("search", $search, '', 100, 100, true);
$form .= "</td><td>";
$form .= "<input name='find' type='submit' class='sub search' value='".__('Search')."'>";
$form .= "<td></tr>";
$form .= "</table>";
$form .= "</form>";
$groups_sql =
"SELECT t.*,
p.nombre AS parent_name,
IF(t.parent=p.id_grupo, 1, 0) AS has_child
FROM tgrupo t
LEFT JOIN tgrupo p
ON t.parent=p.id_grupo
WHERE 1=1
$acl
$search_name
ORDER BY nombre
LIMIT $offset, $block_size
";
echo $form;
$groups = db_get_all_rows_sql($groups_sql);
if (!empty($groups)) {
//Count all groups for pagination only saw user and filters
$groups_sql_count = "SELECT count(*)
$groups_sql =
"SELECT t.*,
p.nombre AS parent_name,
IF(t.parent=p.id_grupo, 1, 0) AS has_child
FROM tgrupo t
LEFT JOIN tgrupo p
ON t.parent=p.id_grupo
WHERE 1=1
$acl
$search_name
ORDER BY nombre
LIMIT $offset, $block_size
";
$groups_count = db_get_value_sql($groups_sql_count);
$table = new StdClass();
$table->width = '100%';
$table->class = "databox data";
$table->head = array ();
$table->head[0] = __('ID');
$table->head[1] = __('Name');
$table->head[2] = __('Icon');
$table->head[3] = __('Alerts');
$table->head[4] = __('Parent');
$table->head[5] = __('Description');
$table->head[6] = __('Actions');
$table->align = array ();
$table->align[0] = 'right';
$table->align[2] = 'left';
$table->align[6] = 'left';
$table->size[5] = '30%';
$table->size[6] = '10%';
$table->data = array ();
$groups = db_get_all_rows_sql($groups_sql);
foreach ($groups as $key => $group) {
$url = "index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group=".$group['id_grupo'];
$url_delete = "index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group=" . $group['id_grupo'];
$table->data[$key][0] = $group['id_grupo'];
$table->data[$key][1] = "<a href='$url'>" . $group['nombre'] . "</a>";
$table->data[$key][2] = html_print_image(
"images/groups_small/" . $group['icon'] . ".png",
true,
array(
"style" => '',
"class" => "bot",
"alt" => $group['nombre'],
"title" => $group['nombre'],
false, false, false, true
)
);
if (!empty($groups)) {
//Count all groups for pagination only saw user and filters
$groups_sql_count = "SELECT count(*)
FROM tgrupo t
WHERE 1=1
$acl
$search_name
";
$groups_count = db_get_value_sql($groups_sql_count);
//reporting_get_group_stats
$table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled');
$table->data[$key][4] = $group['parent_name'];
$table->data[$key][5] = $group['description'];
$table->data[$key][6] = "<a href='$url'>" .
html_print_image(
"images/config.png",
$table = new StdClass();
$table->width = '100%';
$table->class = "databox data";
$table->head = array ();
$table->head[0] = __('ID');
$table->head[1] = __('Name');
$table->head[2] = __('Icon');
$table->head[3] = __('Alerts');
$table->head[4] = __('Parent');
$table->head[5] = __('Description');
$table->head[6] = __('Actions');
$table->align = array ();
$table->align[0] = 'left';
$table->align[2] = 'left';
$table->align[6] = 'left';
$table->size[0] = '3%';
$table->size[5] = '30%';
$table->size[6] = '5%';
$table->data = array ();
foreach ($groups as $key => $group) {
$url = "index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group=".$group['id_grupo'];
$url_delete = "index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group=" . $group['id_grupo'];
$table->data[$key][0] = $group['id_grupo'];
$table->data[$key][1] = "<a href='$url'>" . $group['nombre'] . "</a>";
$table->data[$key][2] = html_print_image(
"images/groups_small/" . $group['icon'] . ".png",
true,
array(
"alt" => __('Edit'),
"title" => __('Edit'),
"border" => '0'
"style" => '',
"class" => "bot",
"alt" => $group['nombre'],
"title" => $group['nombre'],
false, false, false, true
)
) .
"</a>";
);
//reporting_get_group_stats
$table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled');
$table->data[$key][4] = $group['parent_name'];
$table->data[$key][5] = $group['description'];
$table->data[$key][6] = "<a href='$url'>" .
html_print_image(
"images/config.png",
true,
array(
"alt" => __('Edit'),
"title" => __('Edit'),
"border" => '0'
)
) .
"</a>";
$confirm_message = __('Are you sure?');
if ($group['has_child']) {
$confirm_message = __('The child groups will be updated to use the parent id of the deleted group') . ". " . $confirm_message;
}
$table->data[$key][6] .= '&nbsp;&nbsp;' .
'<a href="'. $url_delete. '" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">' .
html_print_image(
"images/cross.png",
true,
array(
"alt" => __('Delete'),
"title" => __('Delete'),
"border" => '0'
)
) .
"</a>";
$confirm_message = __('Are you sure?');
if ($group['has_child']) {
$confirm_message = __('The child groups will be updated to use the parent id of the deleted group') . ". " . $confirm_message;
}
$table->data[$key][6] .= '&nbsp;&nbsp;' .
'<a href="'. $url_delete. '" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">' .
html_print_image(
"images/cross.png",
true,
array(
"alt" => __('Delete'),
"title" => __('Delete'),
"border" => '0'
)
) .
"</a>";
echo ui_pagination(
$groups_count, false,
$offset, $block_size,
true, 'offset', false
);
html_print_table ($table);
echo ui_pagination(
$groups_count, false,
$offset, $block_size,
true, 'offset', true
);
}
else {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) );
}
echo ui_pagination(
$groups_count, false,
$offset, $block_size,
true, 'offset', false
);
html_print_table ($table);
echo ui_pagination(
$groups_count, false,
$offset, $block_size,
true, 'offset', true
);
}
else {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) );
}
if (check_acl($config['id_user'], 0, "PM")) {
@ -517,5 +564,101 @@ if (check_acl($config['id_user'], 0, "PM")) {
echo '</form>';
}
ui_require_javascript_file("TreeController", "include/javascript/tree/");
enterprise_hook('close_meta_frame');
$tab = "group_edition";
?>
<?php if (!is_metaconsole()){ ?>
<script type="text/javascript" src="include/javascript/fixed-bottom-box.js"></script>
<?php }else{ ?>
<script type="text/javascript" src="../../include/javascript/fixed-bottom-box.js"></script>
<?php } ?>
<script type="text/javascript">
var treeController = TreeController.getController();
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();
$(".loading_tree").show();
var parameters = {};
parameters['page'] = "include/ajax/tree.ajax";
parameters['getChildren'] = 1;
parameters['type'] = "<?php echo $tab; ?>";
parameters['filter'] = {};
parameters['filter']['searchGroup'] = '';
parameters['filter']['searchAgent'] = '';
parameters['filter']['statusAgent'] = '';
parameters['filter']['searchModule'] = '';
parameters['filter']['statusModule'] = '';
parameters['filter']['groupID'] = '';
parameters['filter']['tagID'] = '';
parameters['filter']['searchHirearchy'] = 1;
parameters['filter']['show_not_init_agents'] = 1;
parameters['filter']['show_not_init_modules'] = 1;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: parameters,
success: function(data) {
if (data.success) {
$(".loading_tree").hide();
treeController.init({
recipient: $("div#tree-controller-recipient"),
//detailRecipient: $.fixedBottomBox({ width: 400, height: window.innerHeight * 0.9 }),
page: parameters['page'],
emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: "<?php echo __('Found groups'); ?>",
tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'],
counterTitles: {
total: {
agents: "<?php echo __('Total agents'); ?>",
modules: "<?php echo __('Total modules'); ?>",
none: "<?php echo __('Total'); ?>"
},
alerts: {
agents: "<?php echo __('Fired alerts'); ?>",
modules: "<?php echo __('Fired alerts'); ?>",
none: "<?php echo __('Fired alerts'); ?>"
},
critical: {
agents: "<?php echo __('Critical agents'); ?>",
modules: "<?php echo __('Critical modules'); ?>",
none: "<?php echo __('Critical'); ?>"
},
warning: {
agents: "<?php echo __('Warning agents'); ?>",
modules: "<?php echo __('Warning modules'); ?>",
none: "<?php echo __('Warning'); ?>"
},
unknown: {
agents: "<?php echo __('Unknown agents'); ?>",
modules: "<?php echo __('Unknown modules'); ?>",
none: "<?php echo __('Unknown'); ?>"
},
not_init: {
agents: "<?php echo __('Not init agents'); ?>",
modules: "<?php echo __('Not init modules'); ?>",
none: "<?php echo __('Not init'); ?>"
},
ok: {
agents: "<?php echo __('Normal agents'); ?>",
modules: "<?php echo __('Normal modules'); ?>",
none: "<?php echo __('Normal'); ?>"
}
}
});
}
},
dataType: "json"
});
</script>

View File

@ -1543,8 +1543,13 @@ function loadFieldsFromDB(item) {
$("select[name=parent]").val(val);
if (key == 'linked_layout_status_type')
$("select[name=linked_map_status_calculation_type]").val(val).change();
if (key == 'id_layout_linked')
$("select[name=map_linked]").val(val).change();
if (key == 'id_layout_linked') {
if (data['linked_layout_node_id'] == null)
$("select[name=map_linked]").val(val).change();
else
$("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]")
.prop("selected", true).change();
}
if (key == 'linked_layout_node_id')
$("input[name=linked_map_node_id]").val(val);
if (key == 'id_layout_linked_weight')

View File

@ -43,6 +43,7 @@ if (is_ajax ()) {
require_once($config['homedir'] . "/include/class/TreeModule.class.php");
require_once($config['homedir'] . "/include/class/TreeTag.class.php");
require_once($config['homedir'] . "/include/class/TreeGroup.class.php");
require_once($config['homedir'] . "/include/class/TreeGroupEdition.class.php");
enterprise_include_once("include/class/TreePolicies.class.php");
enterprise_include_once("include/class/TreeGroupMeta.class.php");
require_once($config['homedir'] . "/include/functions_reporting.php");
@ -104,6 +105,9 @@ if (is_ajax ()) {
if (!class_exists('TreePolicies')) break;
$tree = new TreePolicies($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access);
break;
case 'group_edition':
$tree = new TreeGroupEdition($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access);
break;
default:
// FIXME. No error handler
return;

View File

@ -615,8 +615,8 @@ switch ($action) {
$values['id_agent'] = $id_agent;
}
if ($linked_map_node_id) {
$values['linked_layout_node_id'] = $linked_map_node_id;
if ($linked_map_node_id !== null) {
$values['linked_layout_node_id'] = (int) $linked_map_node_id;
}
}
else if ($id_agent == 0) {

View File

@ -0,0 +1,108 @@
<?php
//Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2018 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
require_once($config['homedir']."/include/class/Tree.class.php");
class TreeGroupEdition extends TreeGroup {
public function __construct($type, $rootType = '', $id = -1, $rootID = -1, $serverID = false, $childrenMethod = "on_demand", $access = 'AR') {
global $config;
parent::__construct($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access);
}
protected function getData() {
if ($this->id == -1) {
$this->getFirstLevel();
}
}
protected function getProcessedGroups () {
$processed_groups = array();
// Index and process the groups
$groups = $this->getGroupCounters();
// If user have not permissions in parent, set parent node to 0 (all)
// Avoid to do foreach for admins
if (!users_can_manage_group_all("AR")) {
foreach ($groups as $id => $group) {
if (!isset($this->userGroups[$groups[$id]['parent']])) {
$groups[$id]['parent'] = 0;
}
}
}
// Build the group hierarchy
foreach ($groups as $id => $group) {
if (isset($groups[$id]['parent']) && ($groups[$id]['parent'] != 0)) {
$parent = $groups[$id]['parent'];
// Parent exists
if (!isset($groups[$parent]['children'])) {
$groups[$parent]['children'] = array();
}
// Store a reference to the group into the parent
$groups[$parent]['children'][] = &$groups[$id];
// This group was introduced into a parent
$groups[$id]['have_parent'] = true;
}
}
// Sort the children groups
foreach ($groups as $id => $group) {
if (isset($groups[$id]['children'])) {
usort($groups[$id]['children'], array("Tree", "cmpSortNames"));
}
}
//Filter groups and eliminates the reference to children groups out of her parent
$groups = array_filter($groups, function ($group) {
return !$group['have_parent'];
});
usort($groups, array("Tree", "cmpSortNames"));
return $groups;
}
protected function getGroupCounters() {
$messages = array(
'confirm' => __('Confirm'),
'cancel' => __('Cancel'),
'messg' => __('Are you sure?')
);
$sql = "SELECT id_grupo AS gid,
nombre as name, parent, icon
FROM tgrupo
";
$stats = db_get_all_rows_sql($sql);
$group_stats = array();
foreach ($stats as $group) {
$group_stats[$group['gid']]['name'] = $group['name'];
$group_stats[$group['gid']]['parent'] = $group['parent'];
$group_stats[$group['gid']]['icon'] = $group['icon'];
$group_stats[$group['gid']]['id'] = $group['gid'];
$group_stats[$group['gid']]['type'] = 'group';
$group_stats[$group['gid']] = $this->getProcessedItem($group_stats[$group['gid']]);
$group_stats[$group['gid']]['delete']['messages'] = $messages;
$group_stats[$group['gid']]['edit'] = 1;
$group_stats[$group['gid']]['alerts'] = '';
}
return $group_stats;
}
}
?>

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC180913';
$build_version = 'PC180918';
$pandora_version = 'v7.0NG.727';
// Do not overwrite default timezone set if defined.

View File

@ -1638,23 +1638,13 @@ function get_agent_alert_fired ($id_agent, $id_alert, $period, $date = 0) {
*
* @return array An array with all the events happened.
*/
function get_module_alert_fired ($id_agent_module, $id_alert, $period, $date = 0) {
function get_module_alert_fired ($id_agent_module, $id_alert) {
if (!is_numeric ($date)) {
$date = time_w_fixed_tz($date);
}
if (empty ($date)) {
$date = get_system_time();
}
$datelimit = $date - $period;
$sql = sprintf ('SELECT timestamp
$sql = sprintf ('SELECT *
FROM tevento
WHERE id_agentmodule = %d AND utimestamp > %d
AND utimestamp <= %d
WHERE id_agentmodule = %d
AND id_alert_am = %d
ORDER BY timestamp DESC', $id_agent_module, $datelimit, $date, $id_alert);
ORDER BY timestamp DESC', $id_agent_module, $id_alert);
return db_get_all_rows_sql ($sql);
}

View File

@ -1552,7 +1552,7 @@ function reporting_event_report_group($report, $content,
function reporting_event_report_module($report, $content,
$type = 'dinamic', $force_width_chart = null,
$force_height_chart = null, $pdf=0) {
global $config;
if($pdf){
@ -1563,20 +1563,29 @@ function reporting_event_report_module($report, $content,
}
$return['type'] = 'event_report_module';
if (empty($content['name'])) {
$content['name'] = __('Event Report Module');
}
$id_server = false;
if(is_metaconsole()){
$id_server = metaconsole_get_id_server($content["server_name"]);
metaconsole_connect(null, $id_server);
}
$return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']) .
" - " .
io_safe_output(
modules_get_agentmodule_name($content['id_agent_module']));
$return['subtitle'] = agents_get_alias($content['id_agent']) . " - " .
io_safe_output(modules_get_agentmodule_name($content['id_agent_module']));
if(is_metaconsole()){
metaconsole_restore_db();
}
$return["description"] = $content["description"];
$return["date"] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$event_filter = $content['style'];
$return['show_summary_group'] = $event_filter['show_summary_group'];
//filter
@ -1585,22 +1594,18 @@ function reporting_event_report_module($report, $content,
$filter_event_type = json_decode($event_filter['filter_event_type'],true);
$filter_event_status = json_decode($event_filter['filter_event_status'],true);
$filter_event_filter_search = $event_filter['event_filter_search'];
//graphs
$event_graph_by_user_validator = $event_filter['event_graph_by_user_validator'];
$event_graph_by_criticity = $event_filter['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated'];
$id_server = false;
if(is_metaconsole()){
$id_server = metaconsole_get_id_server($content["server_name"]);
}
//data events
$data = reporting_get_module_detailed_event (
$content['id_agent_module'], $content['period'], $report["datetime"],
$show_summary_group, $filter_event_severity, $filter_event_type,
$content['id_agent_module'], $content['period'], $report["datetime"],
$show_summary_group, $filter_event_severity, $filter_event_type,
$filter_event_status, $filter_event_filter_search, $force_width_chart,
$event_graph_by_user_validator, $event_graph_by_criticity,
$event_graph_by_user_validator, $event_graph_by_criticity,
$event_graph_validated_vs_unvalidated, $ttl, $id_server);
if (empty($data)) {
@ -1608,7 +1613,7 @@ function reporting_event_report_module($report, $content,
}
else {
$return['data'] = array_reverse($data);
}
}
if ($config['metaconsole']) {
metaconsole_restore_db();
@ -1621,7 +1626,7 @@ function reporting_event_report_module($report, $content,
else{
$return['total_events'] = 0;
}
return reporting_check_structure_content($return);
}
@ -2865,14 +2870,27 @@ function reporting_alert_get_fired($id_agent_module, $id_alert_template_module,
$id_alert_template_module,
$period,
$datetime);
if (!is_numeric ($datetime)) {
$datetime = time_w_fixed_tz($datetime);
}
if (empty ($datetime)) {
$datetime = get_system_time();
}
$datelimit = $datetime - $period;
$empty = '----------------------------';
if (empty($firedTimes)) {
$firedTimes = array();
$firedTimes[0]['timestamp'] = null;
$firedTimes[0]['timestamp'] = $empty;
}
foreach ($firedTimes as $fireTime) {
if($fireTime['utimestamp'] > $datelimit && $fireTime['utimestamp'] <= $datetime)
$fired[] = $fireTime['timestamp'];
else
$fired[] = $empty;
}
return $fired;
@ -2955,6 +2973,16 @@ function reporting_alert_report_group($report, $content) {
foreach ($alerts as $template => $actions) {
$datetime = (int) $report["datetime"];
if (!is_numeric ($datetime)) {
$datetime = time_w_fixed_tz($datetime);
}
if (empty ($datetime)) {
$datetime = get_system_time();
}
$period = (int) $content["period"];
$datelimit = $datetime - $period;
$data_action = array();
$data_action['actions'] = array();
@ -2963,7 +2991,7 @@ function reporting_alert_report_group($report, $content) {
foreach ($actions["custom"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -2976,7 +3004,7 @@ function reporting_alert_report_group($report, $content) {
foreach ($actions["default"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -2989,7 +3017,7 @@ function reporting_alert_report_group($report, $content) {
foreach ($actions["unavailable"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3009,10 +3037,7 @@ function reporting_alert_report_group($report, $content) {
(int) $report["datetime"]);
$module_actions["actions"] = $data_action;
if ($module_actions["template_fired"][0] !== null)
$data_row['alerts'][$ntemplates] = $module_actions;
else
$data_row = null;
$ntemplates++;
}
@ -3075,6 +3100,16 @@ function reporting_alert_report_agent($report, $content) {
foreach ($alerts as $template => $actions) {
$datetime = (int) $report["datetime"];
if (!is_numeric ($datetime)) {
$datetime = time_w_fixed_tz($datetime);
}
if (empty ($datetime)) {
$datetime = get_system_time();
}
$period = (int) $content["period"];
$datelimit = $datetime - $period;
$data_action = array();
$data_action['actions'] = array();
@ -3083,7 +3118,7 @@ function reporting_alert_report_agent($report, $content) {
foreach ($actions["custom"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3096,7 +3131,7 @@ function reporting_alert_report_agent($report, $content) {
foreach ($actions["default"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3109,7 +3144,7 @@ function reporting_alert_report_agent($report, $content) {
foreach ($actions["unavailable"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3129,10 +3164,7 @@ function reporting_alert_report_agent($report, $content) {
(int) $report["datetime"]);
$module_actions["actions"] = $data_action;
if ($module_actions["template_fired"][0] !== null)
$data_row['alerts'][$ntemplates] = $module_actions;
else
$data_row = null;
$ntemplates++;
}
@ -3198,6 +3230,15 @@ function reporting_alert_report_module($report, $content) {
$ntemplates = 0;
foreach ($alerts as $template => $actions) {
$datetime = (int) $report["datetime"];
if (!is_numeric ($datetime)) {
$datetime = time_w_fixed_tz($datetime);
}
if (empty ($datetime)) {
$datetime = get_system_time();
}
$period = (int) $content["period"];
$datelimit = $datetime - $period;
$data_action = array();
$data_action['actions'] = array();
@ -3207,7 +3248,7 @@ function reporting_alert_report_module($report, $content) {
foreach ($actions["custom"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3220,7 +3261,7 @@ function reporting_alert_report_module($report, $content) {
foreach ($actions["default"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3233,7 +3274,7 @@ function reporting_alert_report_module($report, $content) {
foreach ($actions["unavailable"] as $action) {
$data_action[$naction]["name"] = $action["name"];
$fired = $action["fired"];
if ($fired == 0){
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){
$data_action[$naction]['fired'] = '----------------------------';
}
else {
@ -3253,10 +3294,7 @@ function reporting_alert_report_module($report, $content) {
(int) $report["datetime"]);
$module_actions["actions"] = $data_action;
if ($module_actions["template_fired"][0] !== null)
$data_row['alerts'][$ntemplates] = $module_actions;
else
$data_row = null;
$ntemplates++;
}

View File

@ -1960,6 +1960,12 @@ function reporting_html_alert_report($table, $item, $pdf = 0) {
$table1->data = array ();
$table1->rowspan = array();
$table1->valign = array();
if ($item['data'] == null) {
$table->data['alerts']['cell'] = ui_print_empty_data ( __('No alerts defined') , '', true) ;
return true;
}
$table1->head['agent'] = __('Agent');
$table1->head['module'] = __('Module');
$table1->head['template'] = __('Template');

View File

@ -700,7 +700,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$visual_maps = db_get_all_rows_filter("tlayout", "id != " . (int) $visualConsole_id, array("id", "name"));
$form_items_advance['map_linked_row']['html'] = '<td align="left">'
. __('Linked map')
. __('Linked visual console')
. '</td>'
. '<td align="left">';
@ -727,7 +727,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
return $arr;
}, array());
$form_items_advance['map_linked_row']['html'] .= html_print_select_from_sql(
$form_items_advance['map_linked_row']['html'] .= html_print_select(
array(), 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true
);
$form_items_advance['map_linked_row']['html'] .= html_print_input_hidden(
@ -773,7 +773,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items_advance['map_linked_row']['html'] .= ob_get_clean();
}
else {
$form_items_advance['map_linked_row']['html'] .= html_print_select_from_sql(
$form_items_advance['map_linked_row']['html'] .= html_print_select(
$visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true
);
}
@ -790,7 +790,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'percentile_item', 'module_graph', 'simple_value',
'icon', 'label', 'datos', 'donut_graph');
$form_items_advance['linked_map_status_calculation_row']['html'] = '<td align="left">'.
__('Type of the status calculation of the linked map') . '</td>'
__('Type of the status calculation of the linked visual console') . '</td>'
. '<td align="left">'
. html_print_select(
$status_type_select_items,
@ -803,6 +803,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
false,
false
)
. ui_print_help_icon("linked_map_status_calc", true)
. '</td>';
$form_items_advance['map_linked_weight'] = array();
@ -811,13 +812,12 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'percentile_item', 'module_graph', 'simple_value',
'icon', 'label', 'datos', 'donut_graph');
$form_items_advance['map_linked_weight']['html'] = '<td align="left">'
. __('Linked map weight') . '</td>'
. __('Linked visual console weight') . '</td>'
. '<td align="left">'
. html_print_input_text(
'map_linked_weight', 80, '', 5, 5, true, false, false, "", "type_number percentage"
)
. '<span>%</span>'
. ui_print_help_icon("linked_map_weight", true)
. '</td>';
$form_items_advance['linked_map_status_service_critical_row'] = array();

View File

@ -0,0 +1,36 @@
<?php
/**
* @package Include/help/es
*/
?>
<h1>Ways to calculate the status of the linked visual console</h1>
<h3>By Default</h3>
<p>
It calculates the status based on the status of all elements, as an agent would do.
</p>
<h3>By weight</h3>
<p>
It calculates the status of the elements that have a visual console, a module or an agent assigned in relation to a percentage of elements configured by the user. This percentage is the one that has to exceed the number of elements of a non-normal status with respect to the number of elements taken into account in the calculation for that status to change.
</p>
<p>
For example, given an element with a percentage of 50% and a visual console linked with 5 elements:
</p>
<ul>
<li>1 <i>critical</i>, 1 <i>warning</i> y 3 <i>normal</i> -> Status <i>normal</i>.</li>
<li>2 <i>critical</i>, 2 <i>warning</i> y 1 <i>normal</i> -> Status <i>normal</i>.</li>
<li>1 <i>critical</i>, 3 <i>warning</i> y 1 <i>normal</i> -> Status <i>warning</i>.</li>
<li>3 <i>critical</i>, 1 <i>warning</i> y 1 <i>normal</i> -> Status <i>critical.</i></li>
<li>1 <i>critical</i>, 1 <i>warning</i> y 3 <i>unknown</i> -> Status <i>unknown</i>.</li>
</ul>
<p>
If several statuses exceed the weight, the priority is the same as in the rest of the status calculation (<i>critical</i> > <i>warning</i> > <i>unknown</i>). If there are no elements to perform the calculation, the status becomes <i>unknown</i>.
</p>
<h3>By critical elements</h3>
<p>
It calculates the status using the elements in <i>critical</i> status and the percentages of the thresholds defined by the user. If the number of elements in <i>critical</i> status with respect to the number of elements taken into account in the calculation exceeds the percentage assigned as <i>warning</i>, the status becomes <i>warning</i>. The same applies to the percentage assigned as <i>critical</i>, which also has preference.
</p>

View File

@ -0,0 +1,36 @@
<?php
/**
* @package Include/help/es
*/
?>
<h1>Formas de calcular el estado de la consola visual enlazada</h1>
<h3>Por defecto</h3>
<p>
Calcula el estado a partir del estado de todos los elementos, como lo haría un agente.
</p>
<h3>Por peso</h3>
<p>
Calcula el estado de los elementos que tienen asignados una consola visual, un módulo o un agente en relación a un porcentaje de elementos configurado por el usuario. Este porcentaje es el que tiene que superar el número de elementos de un estado no normal respecto al número de elementos tenidos en cuenta en el cálculo para que el ese estado cambie.
</p>
<p>
Por ejemplo, dado un elemento con un porcentaje del 50% y una consola visual enlazada con 5 elementos:
</p>
<ul>
<li>1 <i>critical</i>, 1 <i>warning</i> y 3 <i>normal</i> -> Estado <i>normal</i>.</li>
<li>2 <i>critical</i>, 2 <i>warning</i> y 1 <i>normal</i> -> Estado <i>normal</i>.</li>
<li>1 <i>critical</i>, 3 <i>warning</i> y 1 <i>normal</i> -> Estado <i>warning</i>.</li>
<li>3 <i>critical</i>, 1 <i>warning</i> y 1 <i>normal</i> -> Estado <i>critical.</i></li>
<li>1 <i>critical</i>, 1 <i>warning</i> y 3 <i>unknown</i> -> Estado <i>unknown</i>.</li>
</ul>
<p>
Si varios estados superan el peso, la prioridad es igual que en el resto de cálculo de estados (<i>critical</i> > <i>warning</i> > <i>unknown</i>). Si no hay elementos para realizar el cálculo, el estado pasa a ser <i>unknown</i>.
</p>
<h3>Por elementos críticos</h3>
<p>
Calcula el estado usando los elementos en estado <i>critical</i> y los porcentajes de los umbrales definidos por el usuario. Si el número de los elementos en estado <i>critical</i> respecto al número de elementos tenidos en cuenta en el cálculo supera el porcentaje asignado como <i>warning</i>, el estado pasa a ser <i>warning</i>. Lo mismo para el porcentaje asignado como <i>critical</i>, que además tiene preferencia.
</p>

View File

@ -1585,6 +1585,10 @@ function display_confirm_dialog (message, ok_text, cancel_text, ok_function) {
clean_function();
}
var buttons_obj = {};
buttons_obj[cancel_text] = clean_function;
buttons_obj[ok_text] = ok_function_clean;
// Display the dialog
$("body").append('<div id="pandora_confirm_dialog_text"><h3>' + message + '</h3></div>');
$("#pandora_confirm_dialog_text").dialog({
@ -1598,10 +1602,7 @@ function display_confirm_dialog (message, ok_text, cancel_text, ok_function) {
},
closeOnEscape: true,
modal: true,
buttons: {
Cancel: clean_function,
"Confirm": ok_function_clean
}
buttons: buttons_obj
});
}

View File

@ -55,7 +55,7 @@ var TreeController = {
}
container.append($group);
_.each(elements, function(element) {
element.jqObject = _processNode($group, element);
});
@ -279,14 +279,13 @@ var TreeController = {
// Load leaf
function _processNode (container, element) {
// type, [id], [serverID], callback
function _getTreeDetailData (type, id, serverID, callback) {
var lastParam = arguments[arguments.length - 1];
var callback;
if (typeof lastParam === 'function')
callback = lastParam;
var serverID;
if (arguments.length >= 4)
serverID = arguments[2];
@ -296,23 +295,23 @@ var TreeController = {
var type;
if (arguments.length >= 2)
type = arguments[0];
if (typeof type === 'undefined')
throw new TypeError('Type required');
if (typeof callback === 'undefined')
throw new TypeError('Callback required');
var postData = {
page: controller.ajaxPage,
getDetail: 1,
type: type
}
if (typeof id !== 'undefined')
postData.id = id;
if (typeof serverID !== 'undefined')
postData.serverID = serverID;
$.ajax({
url: controller.ajaxURL,
type: 'POST',
@ -346,6 +345,36 @@ var TreeController = {
$content.append(element.iconHTML + " ");
}
$content.append(element.name);
if(typeof element.edit != 'undefined'){
var url_edit = controller.baseURL + "index.php?sec=gagente&sec2=godmode/groups/configure_group&tab=tree&id_group=" + element.id;
var $updateicon = $('<img src="' + (controller.baseURL.length > 0 ? controller.baseURL : '')+ 'images/config.png" style="width:18px; vertical-align: middle;"/>')
var $updatebtn = $('<a href = "' + url_edit + '"></a>')
.append($updateicon);
$content.append($updatebtn);
}
if(typeof element.delete != 'undefined'){
var url_delete = controller.baseURL + "index.php?sec=gagente&sec2=godmode/groups/group_list&tab=tree&delete_group=1&id_group=" + element.id;
var $deleteBtn = $('<a><img src="' + (controller.baseURL.length > 0 ? controller.baseURL : '') +'images/cross.png" style="width:18px; vertical-align: middle; cursor: pointer;"/></a>');
$deleteBtn.click(function (event){
var ok_function = function(){
window.location.replace(url_delete);
};
display_confirm_dialog(
element.delete.messages.messg,
element.delete.messages.confirm,
element.delete.messages.cancel,
ok_function
)
});
$content.append($deleteBtn);
}
if(typeof element.alerts != 'undefined'){
$content.append(element.alerts);
}
break;
case 'agent':
// Is quiet
@ -583,95 +612,99 @@ var TreeController = {
if (typeof(public_user) === 'undefined') public_user = 0;
if (typeof element.searchChildren != 'undefined' && element.searchChildren) {
$node
.removeClass("leaf-empty")
.addClass("leaf-closed");
if(element.rootType == "group_edition"
&& typeof element.children == 'undefined'){
$node.addClass("leaf-empty");
}
else{
$node
.removeClass("leaf-empty")
.addClass("leaf-closed");
$leafIcon.click(function (e) {
e.preventDefault();
$leafIcon.click(function (e) {
e.preventDefault();
if (!$node.hasClass("leaf-loading") && !$node.hasClass("children-loaded") && !$node.hasClass("leaf-empty")) {
$node
.removeClass("leaf-closed")
.removeClass("leaf-error")
.addClass("leaf-loading");
$.ajax({
url: controller.ajaxURL,
type: 'POST',
dataType: 'json',
data: {
page: controller.ajaxPage,
getChildren: 1,
id: element.id,
type: element.type,
rootID: element.rootID,
serverID: element.serverID,
rootType: element.rootType,
filter: controller.filter,
hash: public_hash,
id_user: public_user
},
complete: function(xhr, textStatus) {
$node.removeClass("leaf-loading");
$node.addClass("children-loaded");
},
success: function(data, textStatus, xhr) {
if (data.success) {
var $group = $node.children("ul.tree-group");
if ((typeof data.tree != 'undefined' && data.tree.length > 0) || $group.length > 0) {
$node.addClass("leaf-open");
if ($group.length <= 0) {
$group = $("<ul></ul>");
$group
.addClass("tree-group")
.hide();
$node.append($group);
}
_.each(data.tree, function(element) {
element.jqObject = _processNode($group, element);
});
$group.slideDown();
$node.data('children', $group);
// Add again the hover event to the 'force_callback' elements
forced_title_callback();
}
else {
$node.addClass("leaf-empty");
}
}
else {
$node.addClass("leaf-error");
}
},
error: function(xhr, textStatus, errorThrown) {
$node.addClass("leaf-error");
}
});
}
else if (! $node.hasClass("leaf-empty")) {
if ($node.hasClass("leaf-open")) {
$node
.removeClass("leaf-open")
.addClass("leaf-closed")
.data('children')
.slideUp();
}
else {
if (!$node.hasClass("leaf-loading") && !$node.hasClass("children-loaded") && !$node.hasClass("leaf-empty")) {
$node
.removeClass("leaf-closed")
.addClass("leaf-open")
.data('children')
.slideDown();
.removeClass("leaf-error")
.addClass("leaf-loading");
$.ajax({
url: controller.ajaxURL,
type: 'POST',
dataType: 'json',
data: {
page: controller.ajaxPage,
getChildren: 1,
id: element.id,
type: element.type,
rootID: element.rootID,
serverID: element.serverID,
rootType: element.rootType,
filter: controller.filter,
hash: public_hash,
id_user: public_user
},
complete: function(xhr, textStatus) {
$node.removeClass("leaf-loading");
$node.addClass("children-loaded");
},
success: function(data, textStatus, xhr) {
if (data.success) {
var $group = $node.children("ul.tree-group");
if ((typeof data.tree != 'undefined' && data.tree.length > 0) || $group.length > 0) {
$node.addClass("leaf-open");
if ($group.length <= 0) {
$group = $("<ul></ul>");
$group
.addClass("tree-group")
.hide();
$node.append($group);
}
_.each(data.tree, function(element) {
element.jqObject = _processNode($group, element);
});
$group.slideDown();
$node.data('children', $group);
// Add again the hover event to the 'force_callback' elements
forced_title_callback();
}
else {
$node.addClass("leaf-empty");
}
}
else {
$node.addClass("leaf-error");
}
},
error: function(xhr, textStatus, errorThrown) {
$node.addClass("leaf-error");
}
});
}
}
});
else if (! $node.hasClass("leaf-empty")) {
if ($node.hasClass("leaf-open")) {
$node
.removeClass("leaf-open")
.addClass("leaf-closed")
.data('children')
.slideUp();
}
else {
$node
.removeClass("leaf-closed")
.addClass("leaf-open")
.data('children')
.slideDown();
}
}
});
}
}
return $node;

View File

@ -3709,6 +3709,57 @@ div.simple_value > a > span.text p
color:white;
}
.modaldeletebutton{
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
cursor:pointer;
text-align:center;
margin-left:45px;
float:left;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin-bottom:30px;
border-radius: 3px;width:90px;height:30px;background-color:white;border: 1px solid #FA5858;
}
.modaldeletebuttontext{
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
color:#FA5858;font-family:Nunito;font-size:10pt;position:relative;top:6px;
}
.modaldeletebutton:hover .modaldeletebuttontext {
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
color:white;
}
.modaldeletebutton:hover {
transition-property: background-color, color;
transition-duration: 1s;
transition-timing-function: ease-out;
-webkit-transition-property: background-color, color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color, color;
-o-transition-duration: 1s;
background-color:#FA5858;
}
.modalgobutton{
transition-property: background-color, color;
transition-duration: 1s;

View File

@ -71,7 +71,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.727';
$build = '180913';
$build = '180918';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -36,7 +36,6 @@ $agentId = (int)get_parameter('id_agente');
$id_agente = $agentId;
$agent_name = agents_get_name($id_agente);
$agent_alias = agents_get_alias($id_agente);
$agentData = gis_get_data_last_position_agent($id_agente);
//Avoid the agents with characters that fails the div.
$agent_name_original = $agent_name;
@ -83,35 +82,22 @@ switch ($config["dbtype"]) {
gis_activate_ajax_refresh(null, $timestampLastOperation);
gis_activate_select_control();
if ($agentData === false) {
ui_print_info_message (
__("There is no GIS data for this agent, so it's positioned in default position of map.") );
}
$dataLastPosition = gis_get_data_last_position_agent($agentId);
if ($dataLastPosition !== false) {
echo "<b>" . __("Last position in ") .
$dataLastPosition['start_timestamp'] . ":</b> " .
$dataLastPosition['stored_longitude'] . ", " . $dataLastPosition['stored_latitude'] . ", " . $dataLastPosition['stored_altitude'];
}
echo "<br />";
echo "<form class='' action='index.php?" . $url . "' method='POST'>";
echo "<table width=100% class='databox filters'>";
echo "<tr><td>" . __("Period to show data as path") . ": ";
echo "<tr><td>" . __("Period to show data as path");
echo "<td>";
html_print_extended_select_for_time ('period', $period, '', '', '0', 10);
echo "<td>";
html_print_submit_button(__('Refresh path'), 'refresh', false, 'class = "sub upd" style="margin-top:0px"');
echo "</table></form>";
echo "<h4>" . __("Positional data from the last") . " " . human_time_description_raw ($period) ."</h4>";
/* Get the total number of Elements for the pagination */
$sqlCount = sprintf ("SELECT COUNT(*)
FROM tgis_data_history
WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d)
ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period);
$countData = db_get_value_sql($sqlCount);
$countData = (int) db_get_value_sql($sqlCount);
/* Get the elements to present in this page */
switch ($config["dbtype"]) {
@ -141,9 +127,7 @@ switch ($config["dbtype"]) {
$result = db_get_all_rows_sql ($sql, true);
if ($result === false) {
$sql2 = sprintf ("
SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude,
start_timestamp, description, number_of_packages, manual_placement
@ -163,10 +147,11 @@ if ($result === false) {
}
if ($result !== false) {
if(!$countData){
$countData = 1;
}
ui_pagination ($countData, false) ;
echo "<h4>" . __("Positional data from the last") . " " . human_time_description_raw($period) ."</h4>";
if ($countData > 0) ui_pagination($countData, false);
$table = new StdClass();
$table->data = array();
foreach ($result as $key => $row) {
$distance = 0;
@ -187,9 +172,13 @@ if ($result !== false) {
$rowdata = array(
$row['longitude'],
$row['latitude'],
$row['altitude'],
$row['start_timestamp'],
$row['end_timestamp'],
(int) $row['altitude'] . " m",
is_numeric($row['start_timestamp'])
? date($config["date_format"], $row['start_timestamp'])
: date_w_fixed_tz($row['start_timestamp']),
is_numeric($row['end_timestamp'])
? date($config["date_format"], $row['end_timestamp'])
: date_w_fixed_tz($row['end_timestamp']),
$row['description'],
sprintf(__('%s Km'), $distance),
$row['number_of_packages'],
@ -206,13 +195,12 @@ if ($result !== false) {
__('Distance'),
__("# of Packages"),
__("Manual placement"));
$table->class = 'position_data_table';
$table->class = 'databox data';
$table->id = $agent_name.'_position_data_table';
$table->title = $agent_alias . " " . __("positional data");
$table->titlestyle = "background-color:#799E48;";
html_print_table($table); unset($table);
$table->width = '100%';
html_print_table($table);
unset($table);
ui_pagination ($countData, false) ;
echo "<h3>" . __('Total') . ' ' . $countData . ' ' . __('Data') . "</h3>";
if ($countData > 0) ui_pagination($countData, false);
}
?>

View File

@ -108,6 +108,9 @@ $layers = gis_get_layers($idMap);
// Render map
$has_management_acl = check_acl($config["id_user"], $map['group_id'], "MW")
|| check_acl ($config["id_user"], $map['group_id'], "MM");
$buttons = array();
if ($config["pure"] == 0) {
@ -119,22 +122,14 @@ else {
html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode'))) . "</a>";
}
if (check_acl ($config["id_user"], $map['group_id'], "MW") || check_acl ($config["id_user"], $map['group_id'], "MM")) {
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
$buttons['setup']['godmode'] = 1;
if ($has_management_acl) {
$hash = md5($config["dbpass"] . $idMap . $config["id_user"]);
$buttons['public_link']['text'] = '<a href="' .
ui_get_full_url('operation/gis_maps/public_console.php?hash=' .$hash .
'&map_id=' . $idMap . '&id_user=' . $config["id_user"]) . '" target="_blank">'.
html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>';
}
$buttonsString = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' .
html_print_image("images/bricks.png", true, array("class" => "top", "border" => '0')) . '&nbsp; Agent&nbsp;-&nbsp;test_gis1</a></li></ul></div><div id="menu_tab"><ul class="mn"><li class="nomn"><a href="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente=3">' . html_print_image("images/setup.png", true, array("class" => "top", "title" => "Manage", "border" => "0", "width" => "16", "title" => "Manage")) . '&nbsp;</a></li><li class="nomn_high"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' . html_print_image("images/monitor.png", true, array("class" => "top", "title" => "Main", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=data">' . html_print_image("images/lightbulb.png", true, array("class" => "top", "title" => "Data", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=alert">' . html_print_image("images/bell.png", true, array("class" => "top", "title" => "Alerts", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=sla&amp;id_agente=3">' . html_print_image("images/images.png", true, array("class" => "top", "title" => "S.L.A.", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;group_id=2">' . html_print_image("images/agents_group.png", true, array("class" => "top", "title" => "Group", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=inventory&amp;id_agente=3">' . html_print_image("images/page_white_text.png", true, array("class" => "top", "title" => "Inventory", "border" => "0", "width" => "16")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente=3">' . html_print_image("images/world.png", array("class" => "top", "title" => "GIS data", "border" => "0")) . '&nbsp;</a>';
$times = array(
5 => __('5 seconds'),
10 => __('10 seconds'),
@ -144,19 +139,31 @@ $times = array(
SECONDS_5MINUTES => __('5 minutes'),
SECONDS_10MINUTES => __('10 minutes'),
SECONDS_1HOUR => __('1 hour'),
SECONDS_2HOUR => __('2 hours'));
SECONDS_2HOUR => __('2 hours')
);
$buttons[]['text'] = '&nbsp;' . __('Refresh: ') . html_print_select($times, 'refresh_time', 60, 'changeRefreshTime(this.value);', '', 0, true, false, false) . "&nbsp;";
$buttons[]['text'] = "<div style='margin-top: 6px;'>"
.__('Refresh') . ": "
. html_print_select($times, 'refresh_time', 60, 'changeRefreshTime(this.value);', '', 0, true, false, false)
. "</div>";
$status = array(
'all' => __('All'),
'all' => __('None'),
'bad' => __('Critical'),
'warning' => __('Warning'),
'ok' => __('Ok'),
'default' => __('Other'));
'default' => __('Other')
);
$buttons[]['text'] = '&nbsp;' . __('Show agents by state: ') .
html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false) . "&nbsp;";
$buttons[]['text'] = "<div style='margin-top: 6px;'>"
. __('Filter by status') . ": "
. html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false)
. "</div>";
if ($has_management_acl) {
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
$buttons['setup']['godmode'] = 1;
}
ui_print_page_header(__('Map') . " &raquo; " . __('Map') . "&nbsp;" . $map['map_name'],
"images/op_gis.png", false, "", false, $buttons);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.727
%define release 1
%define release 180918
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.727
%define release 1
%define release 180918
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -2372,6 +2372,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules_inventory` (
`username` varchar(100) default '',
`password` varchar(100) default '',
`pending_delete` tinyint(1) default '0',
`custom_fields` MEDIUMBLOB NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_policy`) REFERENCES tpolicies(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,
@ -3338,3 +3339,14 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tlog_graph_models`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tlog_graph_models` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`title` TEXT NOT NULL,
`regexp` TEXT NOT NULL,
`fields` TEXT NOT NULL,
`average` tinyint(1) NOT NULL default '0',
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -1260,3 +1260,10 @@ INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*'
-- Dumping data for table `tcontainer`
--
INSERT INTO `tcontainer` SET `name` = 'Default graph container';
--
-- Dumping data for table `tlog_graph_models`
--
INSERT INTO tlog_graph_models VALUES (1, 'Apache&#x20;log&#x20;model',
'^.*?&#92;s+.*&quot;.*?&#92;s&#40;&#92;/.*?&#41;&#92;?.*1.1&quot;&#92;s+&#40;.*?&#41;&#92;s+&#40;.*?&#41;&#92;s+',
'pagina,&#x20;html_err_code,&#x20;_tiempo_', 1);

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.727
Version: 7.0NG.727-180918
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.727"
pandora_version="7.0NG.727-180918"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.727";
my $pandora_build = "180913";
my $pandora_build = "180918";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.727";
my $pandora_build = "180913";
my $pandora_build = "180918";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.727
%define release 1
%define release 180918
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.727
%define release 1
%define release 180918
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.727"
PI_BUILD="180913"
PI_BUILD="180918"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.727 PS180913";
my $version = "7.0NG.727 PS180918";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.727 PS180913";
my $version = "7.0NG.727 PS180918";
# save program name for logging
my $progname = basename($0);