Merge branch 'develop' into feature#new-iface-names

This commit is contained in:
Ramon Novoa 2017-03-01 12:18:09 +01:00
commit 225147770d
44 changed files with 61816 additions and 58252 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0dev-170228 Version: 7.0dev-170301
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0dev'; use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170228'; use constant AGENT_BUILD => '170301';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170228" PI_BUILD="170301"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{170228} {170301}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0dev(Build 170228)") #define PANDORA_VERSION ("7.0dev(Build 170301)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -260,7 +260,6 @@ Pandora_Windows_Service::pandora_init () {
// Get the agent name. // Get the agent name.
agent_name = conf->getValue ("agent_name"); agent_name = conf->getValue ("agent_name");
printf("AGENT NAME: %s\n", agent_name.c_str());
if (agent_name == "") { if (agent_name == "") {
agent_name_cmd = conf->getValue ("agent_name_cmd"); agent_name_cmd = conf->getValue ("agent_name_cmd");
@ -294,14 +293,11 @@ Pandora_Windows_Service::pandora_init () {
} }
} }
printf("AGENT NAME2: %s\n", agent_name.c_str());
// Fall back to the hostname if agent_name is still empty. // Fall back to the hostname if agent_name is still empty.
if (agent_name == "") { if (agent_name == "") {
agent_name = Pandora_Windows_Info::getSystemName (); agent_name = Pandora_Windows_Info::getSystemName ();
this->conf->setValue("agent_name", agent_name); this->conf->setValue("agent_name", agent_name);
} }
printf("AGENT NAME3: %s\n", agent_name.c_str());
printf("AGENT NAME4: %s\n", this->conf->getValue("agent_name").c_str());
// Get the agent alias. // Get the agent alias.
conf->getValue ("agent_alias"); conf->getValue ("agent_alias");

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0dev-170228 Version: 7.0dev-170301
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

View File

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

View File

@ -1444,7 +1444,7 @@ function agents_get_interval_status ($agent) {
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt')); $time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']); $min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']);
$return = $time; $return = $time;
if ($diferencia > ($min_interval["min_interval"] * 2)) if ($diferencia > ($min_interval["min_interval"] * 2) && $min_interval['num_interval'] > 0)
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>'; $return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
return $return; return $return;

View File

@ -2162,7 +2162,7 @@ function html_print_autocomplete_modules($name = 'module',
ob_start(); ob_start();
html_print_input_text_extended ($name, $default, 'text-' . $name, '', 30, 100, false, '', html_print_input_text_extended ($name, $default, 'text-' . $name, '', 30, 100, false, '',
array('style' => 'background: url(images/input_module.png) no-repeat right;')); array('style' => 'background: url(images/search_module.png) no-repeat right;'));
html_print_input_hidden($name . "_hidden", $id_agent_module); html_print_input_hidden($name . "_hidden", $id_agent_module);
ui_print_help_tip(__('Type at least two characters to search the module.'), false); ui_print_help_tip(__('Type at least two characters to search the module.'), false);

View File

@ -2509,10 +2509,10 @@ function modules_get_agentmodule_mininterval($id_agent) {
function modules_get_agentmodule_mininterval_no_async($id_agent) { function modules_get_agentmodule_mininterval_no_async($id_agent) {
$sql = 'SELECT MIN(tae.current_interval) AS min_interval $sql = 'SELECT COUNT(tae.current_interval) AS num_interval, MIN(tae.current_interval) AS min_interval
FROM tagente_estado tae FROM tagente_estado tae
INNER JOIN tagente_modulo tam ON tae.id_agente_modulo = tam.id_agente_modulo INNER JOIN tagente_modulo tam ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN ttipo_modulo ttm ON tam.id_tipo_modulo = ttm.id_tipo where ttm.nombre not like "async%" and tae.id_agente = '.$id_agent; INNER JOIN ttipo_modulo ttm ON tam.id_tipo_modulo = ttm.id_tipo where ttm.nombre not like "async%" and tae.id_agente = '.$id_agent.' and tam.disabled = 0';
return db_get_row_sql($sql); return db_get_row_sql($sql);
} }

View File

@ -2760,7 +2760,7 @@ function ui_print_agent_autocomplete_input($parameters) {
//Default value //Default value
$icon_image = html_print_image('images/input_agent.png', true, false, true); $icon_image = html_print_image('images/search_agent.png', true, false, true);
if (isset($parameters['icon_image'])) { if (isset($parameters['icon_image'])) {
$icon_image = $parameters['icon_image']; $icon_image = $parameters['icon_image'];
} }
@ -3747,4 +3747,26 @@ function ui_print_module_string_value($value, $id_agente_module,
return $salida; return $salida;
} }
/**
* Displays a tag list
*/
function ui_print_tags_view($title = '', $tags = array()) {
$tv = '';
$tv .= '<div class="tag-wrapper">';
if ($title !== '') $tv .= '<h3>' . $title . '</h3>';
foreach ($tags as $tag) {
$tv .= '<div class=pandora-tag>';
$tv .= '<span class=pandora-tag-title>';
$tv .= $tag['title'];
$tv .= '</span>';
$tv .= '<span class=pandora-tag-value>';
$tv .= $tag['value'];
$tv .= '</span>';
$tv .= '</div>';
}
$tv .= '</div>';
echo $tv;
}
?> ?>

View File

@ -1577,6 +1577,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
} }
var stack = 0, bars = true, lines = false, steps = false; var stack = 0, bars = true, lines = false, steps = false;
var plot = $.plot($('#' + graph_id), datas, options); var plot = $.plot($('#' + graph_id), datas, options);
// Re-calculate the graph height with the legend height // Re-calculate the graph height with the legend height
@ -1603,7 +1604,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// Adjust linked graph to the width and position of the main plot // Adjust linked graph to the width and position of the main plot
// Miniplot // Miniplot
if ( !dashboard || !vconsole ) { if ( !dashboard && !vconsole) {
var overview = $.plot($('#overview_'+graph_id),datas, { var overview = $.plot($('#overview_'+graph_id),datas, {
series: { series: {
stack: stacked, stack: stacked,

View File

@ -464,7 +464,7 @@ function js_addAgentPoint(layerName, pointName, lon, lat, id, type_string, statu
type: type_string, type: type_string,
long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())
}); });
if (isHideFeatureByStatus(statusAgent)) { if (isHideFeatureByStatus(statusAgent)) {
feature.style.display = 'none'; feature.style.display = 'none';
} }
@ -536,9 +536,9 @@ function js_addAgentPointExtent(layerName, pointName, lon, lat, icon, width, hei
feature = new OpenLayers.Feature.Vector(point, feature = new OpenLayers.Feature.Vector(point,
{ {
id_parent: idParent, id_parent: idParent.toString(),
status: statusA, status: statusA,
id: id, id: id.toString(),
type: type_string, type: type_string,
long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())
}, },

BIN
pandora_console/include/languages/en.mo Executable file → Normal file

Binary file not shown.

61373
pandora_console/include/languages/en.po Executable file → Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3805,4 +3805,41 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
} }
.checkselected{ .checkselected{
background-color: #eee; background-color: #eee;
}
.tag-wrapper{
padding: 0 10px 0 0;
overflow: auto;
}
.pandora-tag{
float:left;
margin-bottom:18px;
padding:1px 6px 1px 0;
}
.pandora-tag-title{
color: white;
background-color: #373737;
font-weight: bold;
padding: 6px 6px 6px 10px;
border: #373737;
border-width: 1px;
border-top-style: solid;
border-top-left-radius: 12px;
border-left-style: solid;
border-bottom-left-radius: 12px;
border-bottom-style: solid;
}
.pandora-tag-value{
color: #373737;
font-weight: bold;
padding: 6px 10px 6px 6px;
border: #373737;
border-width: 1px;
border-top-style: solid;
border-top-right-radius: 12px;
border-right-style: solid;
border-bottom-right-radius: 12px;
border-bottom-style: solid;
} }

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0dev'; $version = '7.0dev';
$build = '170228'; $build = '170301';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -24,6 +24,7 @@ elseif (check_acl ($id_user, 0, "EM"))
$propagate = db_get_value('propagate','tgrupo','id_grupo',$id_group); $propagate = db_get_value('propagate','tgrupo','id_grupo',$id_group);
if ($id_group > 0) { if ($id_group > 0) {
$filter_resume['groups'] = $id_group;
if ($propagate) { if ($propagate) {
$childrens_ids = array($id_group); $childrens_ids = array($id_group);
@ -66,18 +67,22 @@ switch ($status) {
case 0: case 0:
case 1: case 1:
case 2: case 2:
$filter_resume['status'] = $status;
$sql_post .= " AND estado = " . $status; $sql_post .= " AND estado = " . $status;
break; break;
case 3: case 3:
$filter_resume['status'] = $status;
$sql_post .= " AND (estado = 0 OR estado = 2)"; $sql_post .= " AND (estado = 0 OR estado = 2)";
break; break;
} }
if ($search != "") { if ($search != "") {
$filter_resume['free_search'] = $search;
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%')"; $sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%')";
} }
if ($event_type != "") { if ($event_type != "") {
$filter_resume['event_type'] = $event_type;
// If normal, warning, could be several (going_up_warning, going_down_warning... too complex // If normal, warning, could be several (going_up_warning, going_down_warning... too complex
// for the user so for him is presented only "warning, critical and normal" // for the user so for him is presented only "warning, critical and normal"
if ($event_type == "warning" || $event_type == "critical" || $event_type == "normal") { if ($event_type == "warning" || $event_type == "critical" || $event_type == "normal") {
@ -93,6 +98,7 @@ if ($event_type != "") {
} }
if ($severity != -1) { if ($severity != -1) {
$filter_resume['severity'] = $severity;
switch ($severity) { switch ($severity) {
case EVENT_CRIT_WARNING_OR_CRITICAL: case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_post .= " $sql_post .= "
@ -115,7 +121,8 @@ if ($severity != -1) {
// In metaconsole mode the agent search is performed by name // In metaconsole mode the agent search is performed by name
if ($meta) { if ($meta) {
if ($text_agent != __('All')) { if (($text_agent != __('All')) && ($text_agent !== '')) {
$filter_resume['agent'] = $text_agent;
$sql_post .= " AND agent_name LIKE '%$text_agent%'"; $sql_post .= " AND agent_name LIKE '%$text_agent%'";
} }
} }
@ -128,6 +135,7 @@ else {
$sql_post .= " AND 1 = 0"; $sql_post .= " AND 1 = 0";
break; break;
default: default:
$filter_resume['agent'] = $id_agent;
$sql_post .= " AND id_agente = " . $id_agent; $sql_post .= " AND id_agente = " . $id_agent;
break; break;
} }
@ -140,6 +148,7 @@ if ($meta) {
} }
else { else {
if (!empty($text_module)) { if (!empty($text_module)) {
$filter_resume['module'] = $text_module;
$sql_post .= " AND id_agentmodule IN ( $sql_post .= " AND id_agentmodule IN (
SELECT id_agente_modulo SELECT id_agente_modulo
FROM tagente_modulo FROM tagente_modulo
@ -148,8 +157,10 @@ else {
} }
} }
if ($id_user_ack != "0") if ($id_user_ack != "0") {
$filter_resume['user_ack'] = $id_user_ack;
$sql_post .= " AND id_usuario = '" . $id_user_ack . "'"; $sql_post .= " AND id_usuario = '" . $id_user_ack . "'";
}
if (!isset($date_from)) { if (!isset($date_from)) {
$date_from = ""; $date_from = "";
@ -160,6 +171,7 @@ if (!isset($date_to)) {
if (($date_from == '') && ($date_to == '')) { if (($date_from == '') && ($date_to == '')) {
if ($event_view_hr > 0) { if ($event_view_hr > 0) {
$filter_resume['hours_max'] = $event_view_hr;
$unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR); $unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR);
$sql_post .= " AND (utimestamp > " . $unixtime . ")"; $sql_post .= " AND (utimestamp > " . $unixtime . ")";
} }
@ -167,18 +179,22 @@ if (($date_from == '') && ($date_to == '')) {
else { else {
if ($date_from != '') { if ($date_from != '') {
if($time_from != '') { if($time_from != '') {
$filter_resume['time_from'] = $date_from . " " . $time_from;
$udate_from = strtotime($date_from . " " . $time_from); $udate_from = strtotime($date_from . " " . $time_from);
$sql_post .= " AND (utimestamp >= " . $udate_from . ")"; $sql_post .= " AND (utimestamp >= " . $udate_from . ")";
} else { } else {
$filter_resume['time_from'] = $date_from;
$udate_from = strtotime($date_from . " 00:00:00"); $udate_from = strtotime($date_from . " 00:00:00");
$sql_post .= " AND (utimestamp >= " . $udate_from . ")"; $sql_post .= " AND (utimestamp >= " . $udate_from . ")";
} }
} }
if ($date_to != '') { if ($date_to != '') {
if($time_to != '') { if($time_to != '') {
$filter_resume['time_to'] = $date_to . " " . $time_to;
$udate_to = strtotime($date_to . " " . $time_to); $udate_to = strtotime($date_to . " " . $time_to);
$sql_post .= " AND (utimestamp <= " . $udate_to . ")"; $sql_post .= " AND (utimestamp <= " . $udate_to . ")";
} else { } else {
$filter_resume['time_to'] = $date_to;
$udate_to = strtotime($date_to . " 23:59:59"); $udate_to = strtotime($date_to . " 23:59:59");
$sql_post .= " AND (utimestamp <= " . $udate_to . ")"; $sql_post .= " AND (utimestamp <= " . $udate_to . ")";
} }
@ -189,6 +205,7 @@ else {
if (!empty($tag_with)) { if (!empty($tag_with)) {
$sql_post .= ' AND ( '; $sql_post .= ' AND ( ';
$first = true; $first = true;
$filter_resume['tag_inc'] = $tag_with;
foreach ($tag_with as $id_tag) { foreach ($tag_with as $id_tag) {
if ($first) $first = false; if ($first) $first = false;
else $sql_post .= " AND "; else $sql_post .= " AND ";
@ -205,6 +222,7 @@ if (!empty($tag_with)) {
if (!empty($tag_without)) { if (!empty($tag_without)) {
$sql_post .= ' AND ( '; $sql_post .= ' AND ( ';
$first = true; $first = true;
$filter_resume['tag_no_inc'] = $tag_without;
foreach ($tag_without as $id_tag) { foreach ($tag_without as $id_tag) {
if ($first) $first = false; if ($first) $first = false;
else $sql_post .= " AND "; else $sql_post .= " AND ";
@ -216,10 +234,14 @@ if (!empty($tag_without)) {
// Filter/Only alerts // Filter/Only alerts
if (isset($filter_only_alert)) { if (isset($filter_only_alert)) {
if ($filter_only_alert == 0) if ($filter_only_alert == 0) {
$filter_resume['alerts'] = $filter_only_alert;
$sql_post .= " AND event_type NOT LIKE '%alert%'"; $sql_post .= " AND event_type NOT LIKE '%alert%'";
else if ($filter_only_alert == 1) }
else if ($filter_only_alert == 1) {
$filter_resume['alerts'] = $filter_only_alert;
$sql_post .= " AND event_type LIKE '%alert%'"; $sql_post .= " AND event_type LIKE '%alert%'";
}
} }
// Tags ACLS // Tags ACLS
@ -247,6 +269,7 @@ if (($tags_acls_condition != ERR_WRONG_PARAMETERS) && ($tags_acls_condition != E
if ($meta) { if ($meta) {
if ($server_id) { if ($server_id) {
$filter_resume['server'] = $server_id;
$sql_post .= " AND server_id = " . $server_id; $sql_post .= " AND server_id = " . $server_id;
} else { } else {
$enabled_nodes = db_get_all_rows_sql(' $enabled_nodes = db_get_all_rows_sql('

View File

@ -25,6 +25,7 @@ require_once ($config['homedir'] . "/include/functions_users.php"); //Users func
require_once ($config['homedir'] . "/include/functions_groups.php"); require_once ($config['homedir'] . "/include/functions_groups.php");
require_once ($config["homedir"] . "/include/functions_graph.php"); require_once ($config["homedir"] . "/include/functions_graph.php");
require_once ($config["homedir"] . "/include/functions_tags.php"); require_once ($config["homedir"] . "/include/functions_tags.php");
enterprise_include_once('include/functions_events.php');
check_login (); check_login ();
@ -163,6 +164,7 @@ $sql_post = "";
$id_user = $config['id_user']; $id_user = $config['id_user'];
$filter_resume = array();
require('events.build_query.php'); require('events.build_query.php');
// Now $sql_post have all the where condition // Now $sql_post have all the where condition
@ -459,7 +461,12 @@ $table_advanced->rowclass[] = '';
$data = array(); $data = array();
$data[0] = __("Alert events") . $jump; $data[0] = __("Alert events") . $jump;
$data[0] .= html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true); $alert_events_titles = array(
'-1' => __('All'),
'0' => __('Filter alert events'),
'1' => __('Only alert events')
);
$data[0] .= html_print_select ($alert_events_titles, "filter_only_alert", $filter_only_alert, '', '', '', true);
$data[1] = __('Block size for pagination') . $jump; $data[1] = __('Block size for pagination') . $jump;
$lpagination[25] = 25; $lpagination[25] = 25;
$lpagination[50] = 50; $lpagination[50] = 50;
@ -561,7 +568,8 @@ $types["not_normal"] = __("Not normal");
$data[1] .= html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true); $data[1] .= html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true);
$data[2] = __('Severity') . $jump; $data[2] = __('Severity') . $jump;
$data[2] .= html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true, false, false); $severities = get_priorities ();
$data[2] .= html_print_select ($severities, "severity", $severity, '', __('All'), '-1', true, false, false);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
@ -605,19 +613,6 @@ $data[0] .= '<a href="javascript:" onclick="show_load_filter_dialog();">' .
html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> &nbsp;'; html_print_image("images/load.png", true, array("border" => '0', "title" => __('Load filter'), "alt" => __('Load filter'))) . '</a> &nbsp;';
$data[0] .= '<a id="events_graph_link" href="javascript: show_events_graph_dialog()">' . $data[0] .= '<a id="events_graph_link" href="javascript: show_events_graph_dialog()">' .
html_print_image('images/chart_curve.png', true, array('title' => __('Show events graph'))) . '</a> <br />'; html_print_image('images/chart_curve.png', true, array('title' => __('Show events graph'))) . '</a> <br />';
if (empty($id_name)) {
$data[0] .= '<div id="filter_loaded_span" style="font-weight: normal">[' .
__('No filter loaded') .
']</div>';
}
else {
$data[0] .= '<div id="filter_loaded_span" style="font-weight: normal">[' .
__('Filter loaded') . ': ' . $id_name .
']</div>';
}
$data[0] .= '</div>'; $data[0] .= '</div>';
@ -641,7 +636,7 @@ $events_filter .= "</form>"; //This is the filter div
if (is_metaconsole()) if (is_metaconsole())
ui_toggle($events_filter, __("Show Options")); ui_toggle($events_filter, __("Show Options"));
else else
ui_toggle($events_filter, __('Event control filter'), '', !$open_filter); ui_toggle($events_filter, __('Event control filter'));
// Error div for ajax messages // Error div for ajax messages
echo "<div id='show_filter_error' style='display: none;'>"; echo "<div id='show_filter_error' style='display: none;'>";
@ -696,6 +691,7 @@ if ($group_rep == 0) {
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);
} }
elseif ($group_rep == 1) { elseif ($group_rep == 1) {
$filter_resume['duplicate'] = $group_rep;
$result = events_get_events_grouped( $result = events_get_events_grouped(
$sql_post, $sql_post,
$offset, $offset,
@ -707,6 +703,7 @@ elseif ($group_rep == 1) {
'DESC'); 'DESC');
} }
elseif ($group_rep == 2) { elseif ($group_rep == 2) {
$filter_resume['duplicate'] = $group_rep;
$result = events_get_events_grouped_by_agent( $result = events_get_events_grouped_by_agent(
$sql_post, $sql_post,
$offset, $offset,
@ -715,6 +712,23 @@ elseif ($group_rep == 2) {
$history); $history);
} }
$filter_resume['title'] = empty($id_name)
? __('No filter loaded')
: __('Filter loaded') . ': ' . $id_name;
// Active filter tag view call (only enterprise version)
// It is required to pass some references to enterprise function
// to translate the active filters
enterprise_hook('print_event_tags_active_filters',
array( $filter_resume, array(
'status' => $fields,
'event_type' => $types,
'severity' => $severities,
'duplicate' => $repeated_sel,
'alerts' => $alert_events_titles,
'groups' => users_get_groups_for_select($config["id_user"], $access, true, true, false))
)
);
if (!empty($result)) { if (!empty($result)) {
if ($group_rep == 0) { if ($group_rep == 0) {
$sql = "SELECT COUNT(id_evento) $sql = "SELECT COUNT(id_evento)

View File

@ -117,7 +117,7 @@ switch ($opt) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
if (empty($idAgentsWithGIS)) { if (empty($idAgentsWithGIS)) {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -125,7 +125,7 @@ switch ($opt) {
WHERE 1 = 0'); WHERE 1 = 0');
} }
else { else {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -135,7 +135,7 @@ switch ($opt) {
break; break;
case "postgresql": case "postgresql":
if (empty($idAgentsWithGIS)) { if (empty($idAgentsWithGIS)) {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -143,7 +143,7 @@ switch ($opt) {
WHERE 1 = 0'); WHERE 1 = 0');
} }
else { else {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -153,7 +153,7 @@ switch ($opt) {
break; break;
case "oracle": case "oracle":
if (empty($idAgentsWithGIS)) { if (empty($idAgentsWithGIS)) {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -161,7 +161,7 @@ switch ($opt) {
WHERE 1 = 0'); WHERE 1 = 0');
} }
else { else {
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente, $agentsGISStatus = db_get_all_rows_sql('SELECT t1.alias, id_parent, t1.id_agente AS tagente_id_agente,
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude, COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
FROM tagente t1 FROM tagente t1
@ -180,7 +180,7 @@ switch ($opt) {
$status = agents_get_status($row['tagente_id_agente']); $status = agents_get_status($row['tagente_id_agente']);
if (!$config['gis_label']) if (!$config['gis_label'])
$row['nombre'] = ''; $row['alias'] = '';
$icon = gis_get_agent_icon_map($row['tagente_id_agente'], true, $status); $icon = gis_get_agent_icon_map($row['tagente_id_agente'], true, $status);
if ($icon[0] !== '/') { if ($icon[0] !== '/') {
@ -196,7 +196,7 @@ switch ($opt) {
'icon_path' => $config["homeurl"] . '/' . $icon, 'icon_path' => $config["homeurl"] . '/' . $icon,
'icon_width' => $icon_width, 'icon_width' => $icon_width,
'icon_height' => $icon_height, 'icon_height' => $icon_height,
'name' => $row['nombre'], 'name' => io_safe_output($row['alias']),
'status' => $status, 'status' => $status,
'stored_longitude' => $row['stored_longitude'], 'stored_longitude' => $row['stored_longitude'],
'stored_latitude' => $row['stored_latitude'], 'stored_latitude' => $row['stored_latitude'],

View File

@ -183,10 +183,10 @@ if ($layers != false) {
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer); $agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer);
foreach ($agentNames as $agentName) { foreach ($agentNames as $key => $agentName) {
$idAgent = agents_get_agent_id($agentName); $idAgent = $key;
$coords = gis_get_data_last_position_agent($idAgent); $coords = gis_get_data_last_position_agent($idAgent);
if ($coords === false) { if ($coords === false) {
$coords['stored_latitude'] = $map['default_latitude']; $coords['stored_latitude'] = $map['default_latitude'];
$coords['stored_longitude'] = $map['default_longitude']; $coords['stored_longitude'] = $map['default_longitude'];
@ -198,7 +198,6 @@ if ($layers != false) {
} }
} }
$icon = gis_get_agent_icon_map($idAgent, true); $icon = gis_get_agent_icon_map($idAgent, true);
$icon_size = getimagesize($icon); $icon_size = getimagesize($icon);
$icon_width = $icon_size[0]; $icon_width = $icon_size[0];

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -66,7 +66,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1'); INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev'); INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170228'); INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170301');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0dev-170228 Version: 7.0dev-170301
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0dev"; my $pandora_version = "7.0dev";
my $pandora_build = "170228"; my $pandora_build = "170301";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -2896,6 +2896,7 @@ sub pandora_create_agent ($$$$$$$$$$;$$$$$$$$$) {
} }
$agent_mode = 1 unless defined($agent_mode); $agent_mode = 1 unless defined($agent_mode);
$alias = $agent_name unless defined($alias);
$description = "Created by $server_name" unless ($description ne ''); $description = "Created by $server_name" unless ($description ne '');
my ($columns, $values) = db_insert_get_values ({ 'nombre' => safe_input($agent_name), my ($columns, $values) = db_insert_get_values ({ 'nombre' => safe_input($agent_name),

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0dev %define version 7.0dev
%define release 170228 %define release 170301
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170228" PI_BUILD="170301"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0dev PS170228"; my $version = "7.0dev PS170301";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0dev PS170228"; my $version = "7.0dev PS170301";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);