Merge remote-tracking branch 'origin/develop' into 1827-Graficas_TIP_eje_x_no_mantiene_ratio

This commit is contained in:
daniel 2018-05-21 17:26:19 +02:00
commit 78f73d5a76
39 changed files with 250 additions and 324 deletions

View File

@ -67,6 +67,7 @@ $PANDHOME_ENT/pandora_plugins/Informix/informix.pl \
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \ $PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \
$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \ $PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \
$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ $PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \
$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \
$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \ $PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \
$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl " $PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl "
PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm" PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm"

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.722-180510 Version: 7.0NG.722-180521
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.0NG.722-180510" pandora_version="7.0NG.722-180521"
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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.722'; use constant AGENT_VERSION => '7.0NG.722';
use constant AGENT_BUILD => '180510'; use constant AGENT_BUILD => '180521';
# 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.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
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.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
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.0NG.722" PI_VERSION="7.0NG.722"
PI_BUILD="180510" PI_BUILD="180521"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{180510} {180521}
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.0NG.722(Build 180510)") #define PANDORA_VERSION ("7.0NG.722(Build 180521)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

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.0NG.722(Build 180510))" VALUE "ProductVersion", "(7.0NG.722(Build 180521))"
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.0NG.722-180510 Version: 7.0NG.722-180521
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.0NG.722-180510" pandora_version="7.0NG.722-180521"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -83,7 +83,7 @@ function mainAgentsAlerts() {
} }
} }
$refr = get_parameter('refr', 30); // By default 30 seconds $refr = (int) get_parameter('refr', 30); // By default 30 seconds
$show_modules = (bool) get_parameter ("show_modules",0); $show_modules = (bool) get_parameter ("show_modules",0);
$group_id = get_parameter('group_id', 0); $group_id = get_parameter('group_id', 0);
$offset = get_parameter('offset', 0); $offset = get_parameter('offset', 0);

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.
$refr = get_parameter('refresh', 0); // By default 30 seconds $refr = (int) get_parameter('refresh', 0); // By default 30 seconds
function mainAgentsModules() { function mainAgentsModules() {
global $config; global $config;
@ -62,7 +62,7 @@ function mainAgentsModules() {
$updated_time = $updated_info; $updated_time = $updated_info;
$modulegroup = get_parameter('modulegroup', 0); $modulegroup = get_parameter('modulegroup', 0);
$refr = get_parameter('refresh', 0); // By default 30 seconds $refr = (int) get_parameter('refresh', 0); // By default 30 seconds
$recursion = get_parameter('recursion', 0); $recursion = get_parameter('recursion', 0);
$group_id = (int)get_parameter('group_id', 0); $group_id = (int)get_parameter('group_id', 0);

View File

@ -461,14 +461,9 @@ config_check();
<?php <?php
if ($_GET["refr"]) { if ($_GET["refr"]) {
$_get_refr = strip_tags($_GET["refr"]);
?> ?>
refr_time = parseInt("<?php echo $_get_refr; ?>"); var refr_time = <?php echo (int) get_parameter("refr", 0); ?>;
if (isNaN(refr_time)) { var t = new Date();
refr_time = 0;
}
t = new Date();
t.setTime (t.getTime () + t.setTime (t.getTime () +
parseInt(<?php echo $config["refr"] * 1000; ?>)); parseInt(<?php echo $config["refr"] * 1000; ?>));
$("#refrcounter").countdown ({until: t, $("#refrcounter").countdown ({until: t,

View File

@ -17,171 +17,170 @@
global $config; global $config;
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once($config["homedir"] . '/include/functions_graph.php');
check_login (); check_login();
$enterprise_include = enterprise_include_once('godmode/admin_access_logs.php'); $enterprise_include = enterprise_include_once('godmode/admin_access_logs.php');
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, "PM")) {
db_pandora_audit( "ACL Violation", db_pandora_audit("ACL Violation", "Trying to access audit view");
"Trying to access event viewer"); require("general/noaccess.php");
require ("general/noaccess.php");
exit; exit;
} }
ui_print_page_header (__('Pandora audit')." &raquo; ".__('Review Logs'), "images/gm_log.png", false, "", true ); ui_print_page_header(__('Pandora audit') . " &raquo; " . __('Review Logs'), "images/gm_log.png", false, "", true);
$offset = get_parameter ("offset", 0); $offset = (int) get_parameter("offset");
$tipo_log = get_parameter ("tipo_log", 'all'); $filter_type = (string) get_parameter("filter_type");
$user_filter = get_parameter('user_filter', 'all'); $filter_user = (string) get_parameter("filter_user");
$filter_text = get_parameter('filter_text', ''); $filter_text = (string) get_parameter("filter_text");
$filter_hours_old = get_parameter('filter_hours_old', 24); $filter_period = get_parameter("filter_period", null);
$filter_ip = get_parameter('filter_ip', ''); $filter_period = ($filter_period !== null) ? (int) $filter_period : 24;
$filter_ip = (string) get_parameter("filter_ip");
echo "<table width='100%' border='0' cellspacing='4' cellpadding='4' class='databox filters'>"; $filter_query = "&filter_type=" . $filter_type
echo '<tr><td class="datost">'; . "&filter_user=" . $filter_user
echo '<div style="float: left; width: 400px;">'; . "&filter_text=" . $filter_text
echo '<b>'.__('Filter').'</b><br><br>'; . "&filter_period=" . $filter_period
. "&filter_ip=" . $filter_ip;
$rows = db_get_all_rows_sql ("SELECT DISTINCT(accion) $table = new stdClass();
FROM tsesion"); $table->class = "databox filters";
if (empty ($rows)) { $table->cellstyle = array();
$rows = array (); $table->cellstyle[0] = array();
} $table->cellstyle[1] = array();
$actions = array (); $table->cellstyle[0][0] = "text-align: right;";
$table->cellstyle[0][1] = "text-align: left;";
foreach ($rows as $row) { $table->cellstyle[0][2] = "text-align: right;";
$actions[$row["accion"]] = $row["accion"]; $table->cellstyle[0][3] = "text-align: left;";
} $table->cellstyle[0][4] = "text-align: right;";
echo '<form name="query_sel" method="post" action="index.php?sec=glog&sec2=godmode/admin_access_logs">'; $table->cellstyle[0][5] = "text-align: left;";
$table = null; $table->cellstyle[1][0] = "text-align: right;";
$table->width = '100%'; $table->cellstyle[1][1] = "text-align: left;";
$table->cellstyle[1][2] = "text-align: right;";
$table->cellstyle[1][3] = "text-align: left;";
$table->cellstyle[1][5] = "text-align: right;";
$table->data = array(); $table->data = array();
$table->data[0][0] = __('Action');
$table->data[0][1] = html_print_select ($actions, 'tipo_log', $tipo_log, '', __('All'), 'all', true);
$table->data[1][0] = __('User');
$table->data[1][1] = html_print_select_from_sql('SELECT id_user, id_user AS text FROM tusuario', 'user_filter', $user_filter, '', __('All'), 'all', true);
$table->data[2][0] = __('Free text for search (*)');
$table->data[2][1] = html_print_input_text('filter_text', $filter_text, __('Free text for search (*)'), 20, 40, true);
$table->data[3][0] = __('Max. hours old');
$table->data[3][1] = html_print_input_text('filter_hours_old', $filter_hours_old, __('Max. hours old'), 3, 6, true);
$table->data[4][0] = __('IP');
$table->data[4][1] = html_print_input_text('filter_ip', $filter_ip, __('IP'), 15, 15, true);
$table->data[5][0] = '';
$table->data[5][1] = html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search" style="float: right;"', true);
html_print_table($table);
echo '</form>';
echo '</div>';
echo '<div style="float: right; width: 300px;">';
echo graphic_user_activity(300, 140); $data = array();
echo '</div>'; $data[0] = "<b>" . __('Search') . "</b>";
echo '<div style="clear:both;">&nbsp;</div>'; $data[1] = html_print_input_text("filter_text", $filter_text, __("Free text for search (*)"), 20, 40, true);
echo '</td></tr></table>';
$data[2] = "<b>" . __("Max. hours old") . "</b>";
$data[3] = html_print_input_text("filter_period", $filter_period, __("Max. hours old"), 3, 6, true);
$data[4] = "<b>" . __("IP") . "</b>";
$data[5] = html_print_input_text("filter_ip", $filter_ip, __("IP"), 15, 15, true);
$filter = 'WHERE 1 = 1'; $table->data[0] = $data;
$data = array();
if ($tipo_log != 'all') { $actions_sql = "SELECT DISTINCT(accion), accion AS text FROM tsesion";
$filter .= sprintf (" AND accion = '%s'", $tipo_log); $data[0] = "<b>" . __("Action") . "</b>";
} $data[1] = html_print_select_from_sql($actions_sql, "filter_type", $filter_type, "", __("All"), "", true);
switch ($config['dbtype']) {
case "mysql":
if ($user_filter != 'all') {
$filter .= sprintf(' AND id_usuario = "%s"', $user_filter);
}
$filter .= ' AND (accion LIKE "%' . $filter_text . '%" OR descripcion LIKE "%' . $filter_text . '%")'; $users_sql = "SELECT id_user, id_user AS text FROM tusuario";
$data[2] = "<b>" . __("User") . "</b>";
$data[3] = html_print_select_from_sql($users_sql, "filter_user", $filter_user, "", __("All"), "", true);
if ($filter_ip != '') { $data[4] = "";
$filter .= sprintf(' AND ip_origen LIKE "%s"', $filter_ip); $data[5] = html_print_submit_button(__("Filter"), "filter", false, 'class="sub search"', true);
}
break;
case "postgresql":
case "oracle":
if ($user_filter != 'all') {
$filter .= sprintf(' AND id_usuario = \'%s\'', $user_filter);
}
$filter .= ' AND (accion LIKE \'%' . $filter_text . '%\' OR descripcion LIKE \'%' . $filter_text . '%\')'; $table->data[1] = $data;
if ($filter_ip != '') { $form = '<form name="query_sel" method="post" action="index.php?sec=glog&sec2=godmode/admin_access_logs">';
$filter .= sprintf(' AND ip_origen LIKE \'%s\'', $filter_ip); $form .= html_print_table($table, true);
} $form .= '</form>';
break; ui_toggle($form, __("Filter"), "", false);
// ui_toggle(graphic_user_activity(400, 150), __("Chart"));
$filter = "1=1";
if (!empty($filter_type)) {
$filter .= sprintf (" AND accion = '%s'", $filter_type);
} }
if ($filter_hours_old != 0) { if (!empty($filter_user)) {
$filter .= sprintf(" AND id_usuario = '%s'", $filter_user);
}
if (!empty($filter_text)) {
$filter .= " AND (accion LIKE '%'" . $filter_text . "'%' OR descripcion LIKE '%'" . $filter_text . "'%')";
}
if (!empty($filter_ip)) {
$filter .= sprintf(" AND ip_origen LIKE '%'", $filter_ip);
}
if (!empty($filter_period)) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_hours_old . ' HOUR)'; $filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_period . ' HOUR)';
break; break;
case "postgresql": case "postgresql":
$filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_hours_old . ' HOUR \''; $filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_period . ' HOUR \'';
break; break;
case "oracle": case "oracle":
$filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_hours_old . '\' HOUR)'; $filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_period . '\' HOUR)';
break; break;
} }
} }
$sql = "SELECT COUNT(*) FROM tsesion " . $filter; $count_sql = sprintf("SELECT COUNT(*) FROM tsesion WHERE %s", $filter);
$count = db_get_sql ($sql); $count = (int) db_get_value_sql($count_sql);
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs&tipo_log=".$tipo_log."&user_filter=".$user_filter."&filter_text=".$filter_text."&filter_hours_old=".$filter_hours_old."&filter_ip=".$filter_ip; $url = "index.php?sec=godmode&sec2=godmode/admin_access_logs" . $filter_query;
ui_pagination($count, $url);
ui_pagination ($count, $url);
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$sql = sprintf ("SELECT * $sql = sprintf(
"SELECT *
FROM tsesion FROM tsesion
%s WHERE %s
ORDER BY fecha DESC ORDER BY fecha DESC
LIMIT %d, %d", $filter, $offset, $config["block_size"]); LIMIT %d, %d",
$filter, $offset, $config["block_size"]
);
break; break;
case "postgresql": case "postgresql":
$sql = sprintf ("SELECT * $sql = sprintf(
"SELECT *
FROM tsesion FROM tsesion
%s WHERE %s
ORDER BY fecha DESC ORDER BY fecha DESC
LIMIT %d OFFSET %d", $filter, $config["block_size"], $offset); LIMIT %d OFFSET %d",
$filter, $config["block_size"], $offset
);
break; break;
case "oracle": case "oracle":
$set = array(); $set = array();
$set['limit'] = $config["block_size"]; $set['limit'] = $config["block_size"];
$set['offset'] = $offset; $set['offset'] = $offset;
$sql = sprintf ("SELECT * $sql = sprintf(
"SELECT *
FROM tsesion FROM tsesion
%s WHERE %s
ORDER BY fecha DESC", $filter); ORDER BY fecha DESC",
$result = oracle_recode_query ($sql, $set); $filter
);
$result = oracle_recode_query($sql, $set);
break; break;
} }
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql($sql);
if (empty($result)) $result = array();
// Delete rnum row generated by oracle_recode_query() function
if (($config["dbtype"] == 'oracle') && ($result !== false)) {
for ($i=0; $i < count($result); $i++) {
unset($result[$i]['rnum']);
}
}
if (empty ($result)) {
$result = array ();
}
$table = new stdClass(); $table = new stdClass();
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->width = '100%'; $table->width = '100%';
$table->class = "databox data"; $table->class = "databox data";
$table->size = array (); $table->size = array();
$table->data = array (); $table->data = array();
$table->head = array (); $table->head = array();
$table->align = array(); $table->align = array();
$table->rowclass = array(); $table->rowclass = array();
@ -192,9 +191,6 @@ $table->head[3] = __('Source IP');
$table->head[4] = __('Comments'); $table->head[4] = __('Comments');
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->head[5] = enterprise_hook('tableHeadEnterpriseAudit', array('title1')); $table->head[5] = enterprise_hook('tableHeadEnterpriseAudit', array('title1'));
}
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->head[6] = enterprise_hook('tableHeadEnterpriseAudit', array('title2')); $table->head[6] = enterprise_hook('tableHeadEnterpriseAudit', array('title2'));
} }
@ -204,106 +200,54 @@ $table->size[3] = 100;
$table->size[4] = 200; $table->size[4] = 200;
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->size[5] = enterprise_hook('tableHeadEnterpriseAudit', array('size1')); $table->size[5] = enterprise_hook('tableHeadEnterpriseAudit', array('size1'));
}
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->size[6] = enterprise_hook('tableHeadEnterpriseAudit', array('size2')); $table->size[6] = enterprise_hook('tableHeadEnterpriseAudit', array('size2'));
}
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->align[5] = enterprise_hook('tableHeadEnterpriseAudit', array('align')); $table->align[5] = enterprise_hook('tableHeadEnterpriseAudit', array('align'));
}
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->align[6] = enterprise_hook('tableHeadEnterpriseAudit', array('align2')); $table->align[6] = enterprise_hook('tableHeadEnterpriseAudit', array('align2'));
} }
$table->colspan = array(); $table->colspan = array();
$table->rowstyle = array(); $table->rowstyle = array();
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
// Get data // Get data
foreach ($result as $row) { foreach ($result as $row) {
if ($rowPair)
$table->rowclass[$iterator] = 'rowPair';
else
$table->rowclass[$iterator] = 'rowOdd';
$rowPair = !$rowPair;
$iterator++; $iterator++;
$data = array (); $table->rowclass[] = $rowPair ? "rowPair" : "rowOdd";
switch ($config['dbtype']) { $rowPair = !$rowPair;
case "mysql":
case "postgresql":
$data[0] = $row["id_usuario"];
break;
case "oracle":
$data[0] = $row["id_usuario"];
break;
}
$data[1] = ui_print_session_action_icon ($row['accion'], true);
$data[1] .= $row["accion"];
$data[2] = ui_print_help_tip($row['fecha'], true) . ui_print_timestamp($row['utimestamp'], true);
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$data[3] = $row["ip_origen"];
break;
case "oracle":
$data[3] = $row["ip_origen"];
break;
}
$data[4] = io_safe_output($row["descripcion"]);
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$data[5] = enterprise_hook('cell1EntepriseAudit', array($row['id_sesion']));
break;
case "oracle":
$data[5] = enterprise_hook('cell1EntepriseAudit', array($row['id_sesion']));
break;
}
}
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$data[6] = enterprise_hook('cell2EntepriseAudit', array($row['id_sesion']));
break;
case "oracle":
$data[6] = enterprise_hook('cell2EntepriseAudit', array($row['id_sesion']));
break;
}
}
array_push ($table->data, $data);
$data = array();
$data[0] = $row["id_usuario"];
$data[1] = ui_print_session_action_icon($row["accion"], true) . $row["accion"];
$data[2] = ui_print_help_tip($row["fecha"], true) . ui_print_timestamp($row["utimestamp"], true);
$data[3] = $row["ip_origen"];
$data[4] = $row["descripcion"];
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
switch ($config['dbtype']) { $data[5] = enterprise_hook("cell1EntepriseAudit", array($row["id_sesion"]));
case "mysql": $data[6] = enterprise_hook("cell2EntepriseAudit", array($row["id_sesion"]));
case "postgresql": }
rowEnterpriseAudit($table, $iterator, $row['id_sesion']);
break; $table->data[] = $data;
case "oracle":
rowEnterpriseAudit($table, $iterator, $row['id_sesion']); if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
break; rowEnterpriseAudit($table, $iterator, $row["id_sesion"]);
}
} }
} }
html_print_table ($table); html_print_table($table);
echo '<div style="width: '.$table->width.'" class="action-buttons">'; echo '<div style="width: '.$table->width.'" class="action-buttons">';
echo '<a href="' . $csv_url = ui_get_full_url(false, false, false, false) . 'index.php?sec=gextensions&sec2=godmode/audit_log_csv' . $filter_query;
ui_get_full_url(false, false, false, false) . 'index.php?sec=gextensions&sec2=godmode/audit_log_csv&tipo_log='.$tipo_log.'&user_filter='.$user_filter.'&filter_text='.$filter_text.'&filter_hours_old='.$filter_hours_old.'&filter_ip='.$filter_ip.'"'. echo '<a href="' . $csv_url . '">'
'>' . . html_print_button(__("Export to CSV"), "export_csv", false, "", "class=sub upd", true, false)
html_print_button (__('Export to CSV '), 'export_csv', false, '', 'class=sub upd', true, false). '</a>'; . '</a>';
echo '</div>'; echo '</div>';
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
enterprise_hook('enterpriseAuditFooter'); enterprise_hook('enterpriseAuditFooter');
} }
?> ?>

View File

@ -12,22 +12,19 @@
$ownDir = dirname(__FILE__) . '/'; $ownDir = dirname(__FILE__) . '/';
$ownDir = str_replace("\\", "/", $ownDir); $ownDir = str_replace("\\", "/", $ownDir);
require_once ($ownDir.'../include/config.php'); require_once($ownDir . "../include/config.php");
require_once($config["homedir"] . "/include/functions.php");
require_once($config["homedir"] . "/include/functions_db.php");
require_once($config["homedir"] . "/include/auth/mysql.php");
global $config; global $config;
require_once ($config["homedir"]."/include/functions.php");
require_once ($config["homedir"]."/include/functions_db.php");
require_once ($config["homedir"]."/include/auth/mysql.php");
error_reporting(E_ALL); if (! isset($_SESSION["id_usuario"])) {
ini_set("display_errors", 1); session_start();
session_write_close();
if (! isset ($_SESSION["id_usuario"])) {
session_start ();
session_write_close ();
} }
// Login check // Login check
if (!isset($_SESSION["id_usuario"])) { if (!isset($_SESSION["id_usuario"])) {
$config['id_user'] = null; $config['id_user'] = null;
@ -36,94 +33,56 @@ else {
$config['id_user'] = $_SESSION["id_usuario"]; $config['id_user'] = $_SESSION["id_usuario"];
} }
if (!check_login()) { check_login();
db_pandora_audit("ACL Violation", "Trying to access graph builder");
include ($config["homedir"]."/general/noaccess.php");
return;
}
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl($config['id_user'], 0, "PM")) {
db_pandora_audit( "ACL Violation", db_pandora_audit("ACL Violation", "Trying to access audit CSV export");
"Trying to access event viewer"); require("general/noaccess.php");
require ("general/noaccess.php");
exit; exit;
} }
$tipo_log = get_parameter ("tipo_log", 'all'); $filter_type = (string) get_parameter("filter_type");
$user_filter = get_parameter('user_filter', 'all'); $filter_user = (string) get_parameter("filter_user");
$filter_text = get_parameter('filter_text', ''); $filter_text = (string) get_parameter("filter_text");
$filter_hours_old = get_parameter('filter_hours_old', 24); $filter_period = get_parameter("filter_period", null);
$filter_ip = get_parameter('filter_ip', ''); $filter_period = ($filter_period !== null) ? (int) $filter_period : 24;
$filter_ip = (string) get_parameter("filter_ip");
$filter = 'WHERE 1 = 1'; $filter = "1=1";
if ($tipo_log != 'all') { if (!empty($filter_type)) {
$filter .= " AND accion = '$tipo_log'"; $filter .= sprintf (" AND accion = '%s'", $filter_type);
}
switch ($config['dbtype']) {
case "mysql":
if ($user_filter != 'all') {
$filter .= sprintf(' AND id_usuario = "%s"', $user_filter);
}
$filter .= ' AND (accion LIKE "%' . $filter_text . '%" OR descripcion LIKE "%' . $filter_text . '%")';
if ($filter_ip != '') {
$filter .= sprintf(' AND ip_origen LIKE "%s"', $filter_ip);
}
break;
case "postgresql":
case "oracle":
if ($user_filter != 'all') {
$filter .= sprintf(' AND id_usuario = \'%s\'', $user_filter);
}
$filter .= ' AND (accion LIKE \'%' . $filter_text . '%\' OR descripcion LIKE \'%' . $filter_text . '%\')';
if ($filter_ip != '') {
$filter .= sprintf(' AND ip_origen LIKE \'%s\'', $filter_ip);
}
break;
} }
if ($filter_hours_old != 0) { if (!empty($filter_user)) {
$filter .= sprintf(" AND id_usuario = '%s'", $filter_user);
}
if (!empty($filter_text)) {
$filter .= " AND (accion LIKE '%'" . $filter_text . "'%' OR descripcion LIKE '%'" . $filter_text . "'%')";
}
if (!empty($filter_ip)) {
$filter .= sprintf(" AND ip_origen LIKE '%'", $filter_ip);
}
if (!empty($filter_period)) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_hours_old . ' HOUR)'; $filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_period . ' HOUR)';
break; break;
case "postgresql": case "postgresql":
$filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_hours_old . ' HOUR \''; $filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_period . ' HOUR \'';
break; break;
case "oracle": case "oracle":
$filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_hours_old . '\' HOUR)'; $filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_period . '\' HOUR)';
break; break;
} }
} }
switch ($config["dbtype"]) { $sql = sprintf( "SELECT * FROM tsesion WHERE %s ORDER BY fecha DESC", $filter);
case "mysql": $result = db_get_all_rows_sql($sql);
$sql = sprintf ("SELECT *
FROM tsesion
%s
ORDER BY fecha DESC", $filter);
break;
case "postgresql":
$sql = sprintf ("SELECT *
FROM tsesion
%s
ORDER BY fecha DESC", $filter);
break;
case "oracle":
$sql = sprintf ("SELECT *
FROM tsesion
%s
ORDER BY fecha DESC", $filter);
$result = oracle_recode_query ($sql, $set);
break;
}
$result = db_get_all_rows_sql ($sql); print_audit_csv($result);
print_audit_csv ($result);
?> ?>

View File

@ -262,7 +262,7 @@ if ($get_graphs){
$labels, $labels,
false, false,
false, false,
true, $graph_conf['percentil'] == 1,
false, false,
false, false,
$value['fullscale'] $value['fullscale']

View File

@ -1084,7 +1084,7 @@ if ($list_modules) {
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["nombre"])); $win_handle=dechex(crc32($module["id_agente_modulo"].$module["nombre"]));
// Try to display the SNMP module realtime graph // Try to display the SNMP module realtime graph
$rt_button .= get_module_realtime_link_graph($module); $rt_button = get_module_realtime_link_graph($module);
if (!empty($rt_button)) $data[8] = $rt_button . "&nbsp;&nbsp;"; if (!empty($rt_button)) $data[8] = $rt_button . "&nbsp;&nbsp;";
# Show events for boolean modules by default. # Show events for boolean modules by default.

View File

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

View File

@ -2162,6 +2162,18 @@ function is_snapshot_data ($data) {
return is_image_data($data); return is_image_data($data);
} }
/**
* Check if text is too long to put it into a black screen
*
* @param string Data value
* @return bool True if black window should be displayed
*/
function is_text_to_black_string ($data) {
if (is_image_data($data)) return false;
// Consider large text if data is greater than 200 characters
return ((int)strlen($data)) > 200;
}
/** /**
* Create an invisible div with a provided ID and value to * Create an invisible div with a provided ID and value to
* can retrieve it from javascript with function get_php_value(name) * can retrieve it from javascript with function get_php_value(name)

View File

@ -396,7 +396,7 @@ function __ ($string /*, variable arguments */) {
return $tranlateString; return $tranlateString;
} }
} }
elseif (enterprise_installed && elseif (enterprise_installed() &&
isset($config['translate_string_extension_installed']) && isset($config['translate_string_extension_installed']) &&
$config['translate_string_extension_installed'] == 1 && $config['translate_string_extension_installed'] == 1 &&
array_key_exists('translate_string.php', $extensions)) { array_key_exists('translate_string.php', $extensions)) {

View File

@ -3815,11 +3815,10 @@ function ui_print_module_string_value($value, $id_agente_module,
$value = io_safe_input($value); $value = io_safe_input($value);
} }
$is_snapshot = is_snapshot_data($value); $is_snapshot = is_snapshot_data($value);
$is_large_image = is_text_to_black_string ($value);
if (($config['command_snapshot']) && ($is_snapshot)) { if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) {
$handle = "snapshot" . "_" . $id_agente_module; $handle = "snapshot" . "_" . $id_agente_module;
$url = 'include/procesos.php?agente=' . $id_agente_module; $url = 'include/procesos.php?agente=' . $id_agente_module;
$win_handle = dechex(crc32($handle)); $win_handle = dechex(crc32($handle));
@ -3828,7 +3827,7 @@ function ui_print_module_string_value($value, $id_agente_module,
"id=" . $id_agente_module . "id=" . $id_agente_module .
"&refr=" . $current_interval . "&refr=" . $current_interval .
"&label=" . rawurlencode(urlencode(io_safe_output($module_name))) . "','" . $win_handle . "', 700,480)"; "&label=" . rawurlencode(urlencode(io_safe_output($module_name))) . "','" . $win_handle . "', 700,480)";
if (is_image_data($value)) { if ($is_snapshot) {
$salida = '<a href="javascript:' . $link . '">' . $salida = '<a href="javascript:' . $link . '">' .
html_print_image("images/photo.png", true, html_print_image("images/photo.png", true,
array("border" => '0', array("border" => '0',

View File

@ -213,7 +213,7 @@ function update_fictional_node(id_db_node) {
graph.nodes[i].networkmap_id = networkmap_to_link; graph.nodes[i].networkmap_id = networkmap_to_link;
$("#id_node_" + i + networkmap_id + " title").html(name); $("#id_node_" + i + networkmap_id + " title").html(name);
$("#id_node_" + i + networkmap_id + " tspan").html(name); $("#id_node_" + i + networkmap_id + " tspan").html(ellipsize(name, 30));
} }
}); });
@ -251,7 +251,7 @@ function update_node_name(id_db_node) {
graph.nodes[i]['raw_text'] = data['raw_text']; graph.nodes[i]['raw_text'] = data['raw_text'];
$("#id_node_" + i + networkmap_id + " title").html(data['raw_text']); $("#id_node_" + i + networkmap_id + " title").html(data['raw_text']);
$("#id_node_" + i + networkmap_id + " tspan").html(data['raw_text']); $("#id_node_" + i + networkmap_id + " tspan").html(ellipsize(data['raw_text'], 30));
} }
}); });
@ -773,7 +773,7 @@ function edit_node(data_node, dblClick) {
$("#dialog_node_edit") $("#dialog_node_edit")
.dialog("option", "title", .dialog("option", "title",
dialog_node_edit_title.replace("%s", node_selected['text'])); // It doesn't eval the possible XSS so it's ok dialog_node_edit_title.replace("%s", ellipsize(node_selected['text'], 40))); // It doesn't eval the possible XSS so it's ok
$("#dialog_node_edit").dialog("open"); $("#dialog_node_edit").dialog("open");
if (node_selected.id_agent == undefined || node_selected.id_agent == -2) { if (node_selected.id_agent == undefined || node_selected.id_agent == -2) {
@ -3658,7 +3658,7 @@ function draw_elements_graph() {
.append("tspan") .append("tspan")
.attr("style", "font-size: " + font_size + "px !important; font-family:Verdana; text-align:center; text-anchor:middle; fill:#000000") .attr("style", "font-size: " + font_size + "px !important; font-family:Verdana; text-align:center; text-anchor:middle; fill:#000000")
.text(function (d) { .text(function (d) {
return d.text; return ellipsize(d.text, 30);
}) })
.classed('dragable_node', true) //own dragable .classed('dragable_node', true) //own dragable
.on("click", selected_node) .on("click", selected_node)

View File

@ -1627,3 +1627,10 @@ function display_confirm_dialog (
} }
}); });
} }
function ellipsize (str, max, ellipse) {
if (max == null) max = 140;
if (ellipse == null) ellipse = "…";
return str.trim().length > max ? str.substr(0, max).trim() + ellipse : str;
}

View File

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

View File

@ -228,6 +228,14 @@ class ModuleGraph {
private function javascript_code() { private function javascript_code() {
ob_start(); ob_start();
global $config;
if ($config['flash_charts']) {
//Include the javascript for the js charts library
echo include_javascript_dependencies_flot_graph(true);
ui_require_javascript_file('pandora', 'include/javascript/',true);
}
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {

View File

@ -1375,8 +1375,9 @@ if (!empty($result)) {
} }
$is_snapshot = is_snapshot_data ( $module_value ); $is_snapshot = is_snapshot_data ( $module_value );
$is_large_image = is_text_to_black_string ( $module_value );
if (($config['command_snapshot']) && ($is_snapshot)) { if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) {
$link = ui_get_snapshot_link( array( $link = ui_get_snapshot_link( array(
'id_module' => $row['id_agente_modulo'], 'id_module' => $row['id_agente_modulo'],
'last_data' => $row['datos'], 'last_data' => $row['datos'],
@ -1385,7 +1386,7 @@ if (!empty($result)) {
'module_name' => $row['module_name'] 'module_name' => $row['module_name']
)); ));
if(!is_image_data($row['datos'])){ if($is_large_image){
$salida = '<a href="javascript:' . $link . '">' . $salida = '<a href="javascript:' . $link . '">' .
html_print_image('images/default_list.png', true, html_print_image('images/default_list.png', true,
array('border' => '0', array('border' => '0',

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
# 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.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
%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

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.722-180510 Version: 7.0NG.722-180521
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.0NG.722-180510" pandora_version="7.0NG.722-180521"
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.0NG.722"; my $pandora_version = "7.0NG.722";
my $pandora_build = "180510"; my $pandora_build = "180521";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -31,7 +31,7 @@ our @ISA = qw(Exporter);
# 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.0NG.722"; my $pandora_version = "7.0NG.722";
my $pandora_build = "180510"; my $pandora_build = "180521";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
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.0NG.722 %define version 7.0NG.722
%define release 180510 %define release 180521
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.722" PI_VERSION="7.0NG.722"
PI_BUILD="180510" PI_BUILD="180521"
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.0NG.722 PS180510"; my $version = "7.0NG.722 PS180521";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

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