Merge remote-tracking branch 'origin/develop' into features/oracle

This commit is contained in:
Alejandro Gallardo Escobar 2015-05-14 11:09:37 +02:00
commit d212fd5543
36 changed files with 174 additions and 91 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.0dev-150504
Version: 6.0dev-150514
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="6.0dev-150504"
pandora_version="6.0dev-150514"
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

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150504';
use constant AGENT_BUILD => '150514';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
@ -1228,7 +1228,7 @@ sub guess_os_version ($) {
################################################################################
sub exec_module ($) {
my $module = shift;
print "THREAD " . threads->tid() . " EXECUTING MODULE " . $module->{'name'} . "\n";
# Need something to execute
if ($module->{'func'} == 0) {
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);

View File

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

View File

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

View File

@ -19,7 +19,7 @@
server_ip $ServerIP$
server_path /var/spool/pandora/data_in
temporal "C:\Program Files\pandora_agent\temp"
temporal "C:\%ProgramFiles%\pandora_agent\temp"
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
#broker_agent name_agent

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{150504}
{150514}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.0dev(Build 150504)")
#define PANDORA_VERSION ("6.0dev(Build 150514)")
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", "(6.0dev(Build 150504))"
VALUE "ProductVersion", "(6.0dev(Build 150514))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 6.0dev-150504
Version: 6.0dev-150514
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="6.0dev-150504"
pandora_version="6.0dev-150514"
package_pear=0
package_pandora=1

View File

@ -20,24 +20,43 @@ $graph = $_POST['graph'];
$graph_title = $_POST['graph_title'];
$refresh = $_POST['refresh'];
$os = strtolower(PHP_OS);
if (substr($os, 0, 3) === 'win') {
$os = 'windows';
}
switch($graph) {
case 'cpu_load':
$data = exec("top -bn 2 -d 0.01 | grep '^Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'");
if ( $os == 'windows')
$data = exec('wmic cpu get loadpercentage|find /I /V "Loadpercentage" | findstr /r "[0-9]" ');
else
$data = exec("top -bn 2 -d 0.01 | grep '^Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'");
break;
case 'pending_packets':
$data = exec("ls /var/spool/pandora/data_in/*.data | wc -l");
break;
case 'disk_io_wait':
$data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'");
if ( $os == 'windows')
$data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'");
else
$data = exec("vmstat 1 3 | tail -1 | awk '{ print $16 }'");
break;
case 'mysql_load':
$data = exec("ps aux | grep mysqld | grep -v safe | grep -v grep | awk '{ print $3 }'");
if ( $os == 'windows')
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(mysqld)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else
$data = exec("ps aux | grep mysqld | grep -v safe | grep -v grep | awk '{ print $3 }'");
break;
case 'apache_load':
$data = exec("ps aux | grep apache2 | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'");
if ( $os == 'windows')
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else
$data = exec("ps aux | grep apache2 | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'");
break;
case 'server_load':
$data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'");
if ( $os == 'windows')
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(pandora_server)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
else
$data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'");
break;
case 'snmp_interface':
$snmp_address = $_POST['snmp_address'];

View File

@ -994,7 +994,7 @@ if ($update_module || $create_module) {
// Make changes in the conf file if necessary
enterprise_include_once('include/functions_config_agents.php');
if (!policies_is_module_in_policy($id_agent_module)) {
if (!enterprise_hook('policies_is_module_in_policy', array($id_agent_module))) {
enterprise_hook('config_agents_write_module_in_conf',
array($id_agente, io_safe_output($old_configuration_data),
io_safe_output($configuration_data), $disabled));

View File

@ -302,7 +302,7 @@ $(document).ready (function () {
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' && old_recovery_value != ''){
if (old_value != '' || old_recovery_value != ''){
$("[name=field" + i + "_value]").val(old_value);
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
}

View File

@ -498,7 +498,8 @@ switch ($action) {
break;
}
$urlForm = $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport;
$urlForm = $config['homeurl'] .
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport;
echo '<form action="' . $urlForm . '" method="post">';
html_print_input_hidden('id_item', $idItem);
@ -518,7 +519,7 @@ else
" . __('Item Editor') . "
</th>
</tr>
</thead>";
</thead>";
}
?>
<tbody>
@ -552,8 +553,8 @@ else
</tr>
<tr id="row_netflow_filter" style="" class="datos">
<td><?php echo __('Filter');?></td>
<td><?php
<td>
<?php
$own_info = get_user_info ($config['id_user']);
// Get group list that user has access
@ -1082,7 +1083,12 @@ else
</tr>
<tr id="row_show_resume" style="" class="datos">
<td><?php echo __('Show resume') . ui_print_help_tip(__('Show a resume table with max, min, average of total modules on the report bottom'), true);?></td>
<td><?php html_print_checkbox('checkbox_show_resume', 1, $show_resume);?></td>
<td>
<?php
html_print_checkbox('checkbox_show_resume', 1,
$show_resume);
?>
</td>
</tr>
<tr id="row_event_filter" style="" class="datos">
<td><?php echo __('Event filter'); ?></td>
@ -1109,14 +1115,24 @@ else
html_print_checkbox ('event_graph_by_agent', true, $event_graph_by_agent);
?>
</span>
<?
<span id="row_event_graph_by_user">
<?php
echo __('By user validator');
html_print_checkbox ('event_graph_by_user_validator', true, $event_graph_by_user_validator);
?>
</span>
<span id="row_event_graph_by_criticity">
<?php
echo __('By criticity');
html_print_checkbox ('event_graph_by_criticity', true, $event_graph_by_criticity);
?>
</span>
<span id="row_event_graph_by_validated">
<?php
echo __('Validated vs unvalidated');
html_print_checkbox ('event_graph_validated_vs_unvalidated', true, $event_graph_validated_vs_unvalidated);
?>
</span>
</td>
</tr>
<tr id="row_show_in_two_columns" style="" class="datos">
@ -1170,7 +1186,8 @@ function print_SLA_list($width, $action, $idItem = null) {
global $config;
global $meta;
$report_item_type = db_get_value ('type', 'treport_content', 'id_rc', $idItem);
$report_item_type = db_get_value('type', 'treport_content', 'id_rc',
$idItem);
?>
<table class="databox" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="100%">
<thead>
@ -1222,17 +1239,17 @@ function print_SLA_list($width, $action, $idItem = null) {
$server_name_element = '';
if ($meta && $server_name != '')
$server_name_element .= ' (' . $server_name . ')';
echo '<tr id="sla_' . $item['id'] . '" style="" class="datos">';
echo '<td class="sla_list_agent_col">' . printSmallFont($nameAgent) . $server_name_element . '</td>';
echo '<td class="sla_list_module_col">' . printSmallFont($nameModule) . '</td>';
if (enterprise_installed() && $report_item_type == 'SLA_services') {
enterprise_include_once("include/functions_services.php");
$nameService = enterprise_hook('services_get_name', array($item['id_agent_module']));
echo '<td class="sla_list_service_col">' . printSmallFont($nameService) . '</th>';
}
echo '<td class="sla_list_sla_min_col">' . $item['sla_min'] . '</td>';
echo '<td class="sla_list_sla_max_col">' . $item['sla_max'] . '</td>';
echo '<td class="sla_list_sla_limit_col">' . $item['sla_limit'] . '</td>';
@ -1325,6 +1342,7 @@ function print_SLA_list($width, $action, $idItem = null) {
function print_General_list($width, $action, $idItem = null) {
global $config;
global $meta;
if (!isset($meta))
$meta = false;
@ -1359,10 +1377,13 @@ function print_General_list($width, $action, $idItem = null) {
case 'update':
case 'edit':
echo '<tbody id="list_general">';
$itemsGeneral = db_get_all_rows_filter('treport_content_item', array('id_report_content' => $idItem));
$itemsGeneral = db_get_all_rows_filter(
'treport_content_item',
array('id_report_content' => $idItem));
if ($itemsGeneral === false) {
$itemsGeneral = array();
}
foreach ($itemsGeneral as $item) {
$server_name = $item ['server_name'];
// Metaconsole db connection
@ -1373,13 +1394,17 @@ function print_General_list($width, $action, $idItem = null) {
continue;
}
}
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
$idAgent = db_get_value_filter(
'id_agente', 'tagente_modulo',
array('id_agente_modulo' => $item['id_agent_module']));
$nameAgent = agents_get_name ($idAgent);
$nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module']));
$server_name_element = '';
if ($meta && $server_name != '')
$server_name_element .= ' (' . $server_name . ')';
$server_name_element .= ' (' . $server_name . ')';
echo '<tr id="general_' . $item['id'] . '" style="" class="datos">
<td>' . printSmallFont($nameAgent) . $server_name_element . '</td>
@ -1389,6 +1414,8 @@ function print_General_list($width, $action, $idItem = null) {
<a href="javascript: deleteGeneralRow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
</td>
</tr>';
if ($meta) {
//Restore db connection
metaconsole_restore_db();
@ -1427,8 +1454,19 @@ function print_General_list($width, $action, $idItem = null) {
ui_print_agent_autocomplete_input($params);
?>
</td>
<td><select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
<td><?php html_print_select ($operation, 'id_operation_module_general', 0, false, '', '', false, false, true, 'width: 200px', false); ?></td>
<td>
<select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px">
<option value="0"><?php echo __('Select an Agent first'); ?></option>
</select>
</td>
<td>
<?php
html_print_select($operation,
'id_operation_module_general', 0,
false, '', '', false, false, true,
'width: 200px', false);
?>
</td>
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
</tr>
</tbody>
@ -1460,7 +1498,8 @@ $(document).ready (function () {
minuteText: '<?php echo __('Minute');?>',
secondText: '<?php echo __('Second');?>',
currentText: '<?php echo __('Now');?>',
closeText: '<?php echo __('Close');?>'});
closeText: '<?php echo __('Close');?>'
});
});
function create_custom_graph() {
@ -1699,13 +1738,13 @@ function addSLARow() {
var slaMin = $("input[name=sla_min]").val();
var slaMax = $("input[name=sla_max]").val();
var slaLimit = $("input[name=sla_limit]").val();
var serviceId = $("select#id_service>option:selected").val();
var serviceName = $("select#id_service>option:selected").text();
if (((idAgent != '') && (slaMin != '') && (slaMax != '')
&& (slaLimit != '')) || serviceId != '') {
if (nameAgent != '') {
//Truncate nameAgent
var params = [];
@ -1722,7 +1761,7 @@ function addSLARow() {
nameAgent = data;
}
});
//Truncate nameModule
var params = [];
params.push("truncate_text=1");
@ -1748,7 +1787,7 @@ function addSLARow() {
params.push("sla_max=" + slaMax);
params.push("sla_limit=" + slaLimit);
params.push("server_id=" + serverId);
if (serviceId != '') {
params.push("id_service=" + serviceId);
}
@ -1835,6 +1874,7 @@ function addGeneralRow() {
nameModule = data;
}
});
//Truncate nameOperation
var params = [];
params.push("truncate_text=1");
@ -1850,6 +1890,7 @@ function addGeneralRow() {
nameOperation = data;
}
});
var params = [];
params.push("add_general=1");
params.push("id=" + $("input[name=id_item]").val());
@ -1935,7 +1976,10 @@ function chooseType() {
$("#row_module_multi").hide();
$("#row_event_filter").hide();
$("#row_event_graphs").hide();
$("#row_event_graph_by_agent").show();
$("#row_event_graph_by_agent").hide();
$("#row_event_graph_by_user").hide();
$("#row_event_graph_by_criticity").hide();
$("#row_event_graph_by_validated").hide();
$("#row_netflow_filter").hide();
$("#row_max_values").hide();
$("#row_resolution").hide();
@ -1963,6 +2007,11 @@ function chooseType() {
$("#row_show_in_two_columns").show();
$("#row_event_filter").show();
$("#row_event_graphs").show();
$("#row_event_graph_by_agent").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show();
break;
case 'simple_graph':
$("#row_only_avg").show();
@ -2024,7 +2073,7 @@ function chooseType() {
$("#row_only_display_wrong").show();
$("#row_working_time").show();
$("#row_sort").show();
$(".sla_list_agent_col").hide();
$(".sla_list_module_col").hide();
$(".sla_list_service_col").show();
@ -2177,8 +2226,11 @@ function chooseType() {
$("#row_show_in_two_columns").show();
$("#row_event_filter").show();
$("#row_event_graphs").show();
$("#row_event_graph_by_agent").hide();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show();
$('#agent_autocomplete').hide();
$('#agent_autocomplete_events').show();
break;
@ -2189,6 +2241,11 @@ function chooseType() {
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_event_graph_by_agent").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show();
$('#agent_autocomplete').hide();
$('#agent_autocomplete_events').show();
break;

View File

@ -442,18 +442,6 @@ if ($list_modules) {
break;
}
break;
case 'data':
switch ($sort) {
case 'up':
$selectDataUp = $selected;
$order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
break;
case 'down':
$selectDataDown = $selected;
$order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
break;
}
break;
case 'last_contact':
switch ($sort) {
case 'up':
@ -703,9 +691,7 @@ if ($list_modules) {
'<a href="' . $url . '&sort_field=status&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor=' .$status_filter_monitor.' &status_text_monitor='. $status_text_monitor.'&status_module_group= '.$status_module_group.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectStatusUp, "alt" => "up")) . '</a>' .
'<a href="' . $url . '&sort_field=status&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor=' .$status_filter_monitor.' &status_text_monitor='. $status_text_monitor.'&status_module_group= '.$status_module_group.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectStatusDown, "alt" => "down")) . '</a>';
$table->head[6] = __('Warn');
$table->head[7] = __('Data') . ' ' .
'<a href="' . $url . '&sort_field=data&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor=' .$status_filter_monitor.' &status_text_monitor='. $status_text_monitor.'&status_module_group= '.$status_module_group.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectDataUp, "alt" => "up")) . '</a>' .
'<a href="' . $url . '&sort_field=data&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor=' .$status_filter_monitor.' &status_text_monitor='. $status_text_monitor.'&status_module_group= '.$status_module_group.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectDataDown, "alt" => "down")) . '</a>';
$table->head[7] = __('Data');
$table->head[8] = __('Graph');
$table->head[9] = __('Last contact') . ' ' .
'<a href="' . $url . '&sort_field=last_contact&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor=' .$status_filter_monitor.' &status_text_monitor='. $status_text_monitor.'&status_module_group= '.$status_module_group.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' .

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC150504';
$build_version = 'PC150514';
$pandora_version = 'v6.0dev';
// Do not overwrite default timezone set if defined.
@ -120,7 +120,9 @@ config_process_config();
config_prepare_session();
require_once ($config["homedir"].'/include/load_session.php');
$resultado = session_start();
if(session_id() == '') {
$resultado = session_start();
}
if (!isset($config["homeurl_static"])) {

View File

@ -1691,7 +1691,9 @@ function check_login ($output = true) {
}
else {
require_once($config["homedir"].'/mobile/include/user.class.php');
session_start ();
if(session_id() == '') {
session_start ();
}
session_write_close ();
if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];

View File

@ -119,7 +119,7 @@ function config_update_config () {
case 'general':
if (!config_update_value ('language', (string) get_parameter ('language')))
$error_update[] = __('Language code for Pandora');
if (!config_update_value ('remote_config', (string) get_parameter ('remote_config')))
if (!config_update_value ('remote_config', io_safe_input((string) get_parameter ('remote_config'))))
$error_update[] = __('Remote config directory');
if (!config_update_value ('loginhash_pwd', io_input_password((string) get_parameter ('loginhash_pwd'))))
$error_update[] = __('Auto login (hash) password');
@ -130,7 +130,7 @@ function config_update_config () {
$error_update[] = __('Automatic check for updates');
if (!config_update_value ('https', (bool) get_parameter ('https')))
$error_update[] = __('Enforce https');
if (!config_update_value ('attachment_store', (string) get_parameter ('attachment_store')))
if (!config_update_value ('attachment_store', io_safe_input((string) get_parameter ('attachment_store'))))
$error_update[] = __('Attachment store');
if (!config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API')))
$error_update[] = __('IP list with API access');
@ -413,7 +413,7 @@ function config_update_config () {
$error_update[] = __('Show QR code header');
if (!config_update_value ('status_images_set', (string) get_parameter ('status_images_set')))
$error_update[] = __('Status icon set');
if (!config_update_value ('fontpath', (string) get_parameter ('fontpath')))
if (!config_update_value ('fontpath', io_safe_input((string) get_parameter ('fontpath'))))
$error_update[] = __('Font path');
if (!config_update_value ('font_size', get_parameter('font_size')))
$error_update[] = __('Font size');
@ -451,7 +451,7 @@ function config_update_config () {
$error_update[] = __('Fixed menu');
if (!config_update_value ('paginate_module', get_parameter('paginate_module')))
$error_update[] = __('Paginate module');
if (!config_update_value ('graphviz_bin_dir', get_parameter('graphviz_bin_dir')))
if (!config_update_value ('graphviz_bin_dir', io_safe_input(get_parameter('graphviz_bin_dir'))))
$error_update[] = __('Custom graphviz directory');
if (!config_update_value ('networkmap_max_width', get_parameter('networkmap_max_width')))
$error_update[] = __('Networkmap max width');
@ -461,7 +461,7 @@ function config_update_config () {
$error_update[] = __('Show the group name instead the group icon.');
if (!config_update_value ('custom_graph_widht', (int) get_parameter('custom_graph_widht', 1)))
$error_update[] = __('Default line thickness for the Custom Graph.');
if (!config_update_value ('render_proc', (int) get_parameter('render_proc', 0)))
if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false)))
$error_update[] = __('Render data of module type is proc.');
@ -625,7 +625,7 @@ function config_update_config () {
enterprise_include_once('include/functions_policies.php');
$enterprise = enterprise_include_once ('include/functions_skins.php');
if ($enterprise !== ENTERPRISE_NOT_HOOK) {
$config['relative_path'] = get_parameter('relative_path', $config['relative_path']);
$config['relative_path'] = get_parameter('relative_path', io_safe_input($config['relative_path']));
}
}
@ -653,7 +653,7 @@ function config_process_config () {
if (isset ($config['homeurl']) && (strlen($config['homeurl']) > 0)) {
if ($config['homeurl'][0] != '/') {
$config['homeurl'] = '/'.$config['homeurl'];
$config['homeurl'] = '/'.io_safe_input($config['homeurl']);
}
}
@ -862,21 +862,21 @@ function config_process_config () {
// dir.
if (!isset ($config['attachment_store'])) {
config_update_value('attachment_store',
$config['homedir'] . '/attachment');
io_safe_input($config['homedir']) . '/attachment');
}
else {
//Fixed when the user moves the pandora console to another dir
//after the first uses.
if (!is_dir($config['attachment_store'])) {
config_update_value('attachment_store',
$config['homedir'] . '/attachment');
io_safe_input($config['homedir']) . '/attachment');
}
}
if (!isset ($config['fontpath'])) {
config_update_value('fontpath',
$config['homedir'] . '/include/fonts/smallfont.ttf');
io_safe_input($config['homedir']) . '/include/fonts/smallfont.ttf');
}
if (!isset ($config['style'])) {
@ -1329,6 +1329,12 @@ function config_process_config () {
config_update_value ('session_timeout', 90);
}
if (!isset ($config["max_file_size"])) {
config_update_value ('max_file_size', "2M");
}
/* Finally, check if any value was overwritten in a form */
config_update_config();
}
@ -1462,6 +1468,7 @@ function config_check () {
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
$PHPmax_execution_time = ini_get('max_execution_time');
$PHPsafe_mode = ini_get('safe_mode');
$PHPdisable_functions = ini_get('disable_functions');
if ($PHPsafe_mode === '1') {
set_pandora_error_for_header(
@ -1496,6 +1503,12 @@ function config_check () {
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '500M')) . '<br><br>' . __('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
sprintf(__("Not recommended '%s' value in PHP configuration"), 'memory_limit'));
}
if (preg_match("/system/", $PHPdisable_functions) or preg_match("/exec/", $PHPdisable_functions)) {
set_pandora_error_for_header(
__("Variable disable_functions containts functions system() or exec(), in PHP configuration file (php.ini)"). '<br /><br />' .
__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'), __("Problems with disable functions in PHP.INI"));
}
}
function config_return_in_bytes($val) {
@ -1557,7 +1570,7 @@ function config_prepare_session() {
if (isset($_COOKIE[session_name()]))
setcookie(session_name(), $_COOKIE[session_name()], time() + $sessionCookieExpireTime, "/");
ini_set("post_max_size",$config["max_file_size"]);
ini_set("upload_max_filesize",$config["max_file_size"]);
ini_set("post_max_size", $config["max_file_size"]);
ini_set("upload_max_filesize", $config["max_file_size"]);
}
?>

View File

@ -1383,7 +1383,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$height, $color, $module_name_list, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", "", $water_mark, $config['fontpath'], $fixed_font_size,
"", $ttl, $homeurl, $background_color);
$unit, $ttl, $homeurl, $background_color);
break;
case CUSTOM_GRAPH_STACKED_LINE:
return stacked_line_graph($flash_charts, $graph_values,

View File

@ -800,6 +800,7 @@ function visual_map_print_item($mode = "read", $layoutData,
break;
case STATIC_GRAPH:
case GROUP_ITEM:
echo "<div style='width:150px'>";
if ($layoutData['image'] != null) {
@ -861,6 +862,7 @@ function visual_map_print_item($mode = "read", $layoutData,
echo '<br />';
}
echo io_safe_output($text);
echo "</div>";
break;
case PERCENTILE_BAR:

View File

@ -511,8 +511,8 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
$('#extra_'+graph_id).text(from+'-'+to);
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/2)+'px');
$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/4)+'px');
//$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
$('#extra_'+graph_id).show();
}
});
@ -860,7 +860,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
$('#timestamp_'+graph_id).text(labels_long[j]);
}
$('#timestamp_'+graph_id).css('top', plot.offset().top-$('#timestamp_'+graph_id).height()*1.5);
//$('#timestamp_'+graph_id).css('top', plot.offset().top-$('#timestamp_'+graph_id).height()*1.5);
var timesize = $('#timestamp_'+graph_id).width();

View File

@ -66,7 +66,9 @@ if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.ph
}
// Real start
session_start ();
if(session_id() == '') {
session_start ();
}
require_once ("include/config.php");

View File

@ -63,7 +63,7 @@
<div style='height: 10px'>
<?php
$version = '6.0dev';
$build = '150504';
$build = '150514';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -178,7 +178,7 @@ $interface_traffic_modules = array(
array_values($interface_traffic_modules),
$config['homeurl'],
array_keys($interface_traffic_modules),
array_fill(0, count($interface_traffic_modules),"bytes/s"),
array("bytes"),
false);
echo '</div>';

View File

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

View File

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

View File

@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'),
('step_compact','1'),
('db_scheme_version','6.0dev'),
('db_scheme_build','PD150504'),
('db_scheme_build','PD150514'),
('show_unknown','0'),
('show_lastalerts','1'),
('style','pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 6.0dev-150504
Version: 6.0dev-150514
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="6.0dev-150504"
pandora_version="6.0dev-150514"
package_cpan=0
package_pandora=1

View File

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

View File

@ -270,7 +270,7 @@ sub get_agent_from_name ($$) {
return undef if (! defined ($name) || $name eq '');
return get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE tagente.nombre = ?', $name);
return get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE tagente.nombre = ?', safe_input($name));
}
##########################################################################

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.0dev
%define release 150504
%define release 150514
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.0dev
%define release 150504
%define release 150514
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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