mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge remote-tracking branch 'origin/develop' into ent-8676-consolas-visuales-en-consola-movil
This commit is contained in:
commit
8ef56aa076
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.760-220317
|
Version: 7.0NG.760-220318
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.760-220317"
|
pandora_version="7.0NG.760-220318"
|
||||||
|
|
||||||
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
|
||||||
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.760';
|
use constant AGENT_VERSION => '7.0NG.760';
|
||||||
use constant AGENT_BUILD => '220317';
|
use constant AGENT_BUILD => '220318';
|
||||||
|
|
||||||
# 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;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_agent_unix
|
%define name pandorafms_agent_unix
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_agent_unix
|
%define name pandorafms_agent_unix
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.760"
|
PI_VERSION="7.0NG.760"
|
||||||
PI_BUILD="220317"
|
PI_BUILD="220318"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{220317}
|
{220318}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -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.760 Build 220317")
|
#define PANDORA_VERSION ("7.0NG.760 Build 220318")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -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.760(Build 220317))"
|
VALUE "ProductVersion", "(7.0NG.760(Build 220318))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.760-220317
|
Version: 7.0NG.760-220318
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.760-220317"
|
pandora_version="7.0NG.760-220318"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -868,6 +868,7 @@ switch ($action) {
|
|||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
case 'netflow_data':
|
case 'netflow_data':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
|
case 'netflow_top_N':
|
||||||
$netflow_filter = $item['text'];
|
$netflow_filter = $item['text'];
|
||||||
// Filter.
|
// Filter.
|
||||||
$period = $item['period'];
|
$period = $item['period'];
|
||||||
@ -6583,6 +6584,16 @@ function chooseType() {
|
|||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'netflow_top_N':
|
||||||
|
$("#row_netflow_filter").show();
|
||||||
|
$("#row_description").show();
|
||||||
|
$("#row_period").show();
|
||||||
|
$("#row_max_values").show();
|
||||||
|
$("#row_resolution").show();
|
||||||
|
$("#row_servers").show();
|
||||||
|
$("#row_historical_db_check").hide();
|
||||||
|
break;
|
||||||
|
|
||||||
case 'IPAM_network':
|
case 'IPAM_network':
|
||||||
$("#row_network_filter").show();
|
$("#row_network_filter").show();
|
||||||
$("#row_alive_ip").show();
|
$("#row_alive_ip").show();
|
||||||
|
@ -1753,6 +1753,7 @@ switch ($action) {
|
|||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
case 'netflow_data':
|
case 'netflow_data':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
|
case 'netflow_top_N':
|
||||||
$values['text'] = get_parameter(
|
$values['text'] = get_parameter(
|
||||||
'netflow_filter'
|
'netflow_filter'
|
||||||
);
|
);
|
||||||
@ -2553,6 +2554,7 @@ switch ($action) {
|
|||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
case 'netflow_data':
|
case 'netflow_data':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
|
case 'netflow_top_N':
|
||||||
$values['text'] = get_parameter(
|
$values['text'] = get_parameter(
|
||||||
'netflow_filter'
|
'netflow_filter'
|
||||||
);
|
);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC220317';
|
$build_version = 'PC220318';
|
||||||
$pandora_version = 'v7.0NG.760';
|
$pandora_version = 'v7.0NG.760';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -13630,7 +13630,7 @@ function api_get_netflow_get_stats($discard_1, $discard_2, $params)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse function parameters
|
// Parse function parameters.
|
||||||
$start_date = $params['data'][0];
|
$start_date = $params['data'][0];
|
||||||
$end_date = $params['data'][1];
|
$end_date = $params['data'][1];
|
||||||
$filter = json_decode(base64_decode($params['data'][2]), true);
|
$filter = json_decode(base64_decode($params['data'][2]), true);
|
||||||
@ -13647,10 +13647,38 @@ function api_get_netflow_get_stats($discard_1, $discard_2, $params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param $trash1 Don't use.
|
||||||
|
* @param $trash2 Don't use.
|
||||||
|
* @param array $params Call parameters.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function api_get_netflow_get_top_N($trash1, $trash2, $params)
|
||||||
|
{
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse function parameters.
|
||||||
|
$start_date = $params['data'][0];
|
||||||
|
$end_date = $params['data'][1];
|
||||||
|
$filter = json_decode(base64_decode($params['data'][2]), true);
|
||||||
|
$max = $params['data'][3];
|
||||||
|
|
||||||
|
// Get netflow data.
|
||||||
|
$data = netflow_get_top_N($start_date, $end_date, $filter, $max, '');
|
||||||
|
|
||||||
|
returnData('json', $data);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// http://localhost/pandora_console/include/api.php?op=get&op2=netflow_get_summary&other=1348562410|1348648810|_base64_encode(json_encode($filter))&other_mode=url_encode_separator_|&apipass=pandora&user=pandora&pass=pandora'
|
// http://localhost/pandora_console/include/api.php?op=get&op2=netflow_get_summary&other=1348562410|1348648810|_base64_encode(json_encode($filter))&other_mode=url_encode_separator_|&apipass=pandora&user=pandora&pass=pandora'
|
||||||
function api_get_netflow_get_summary($discard_1, $discard_2, $params)
|
function api_get_netflow_get_summary($discard_1, $discard_2, $params)
|
||||||
{
|
{
|
||||||
if (defined('METACONSOLE')) {
|
if (is_metaconsole() === true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,6 +321,72 @@ function netflow_data_table($data, $start_date, $end_date, $aggregate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show a table with netflow top N data.
|
||||||
|
*
|
||||||
|
* @param array $data Netflow data.
|
||||||
|
* @param integer $total_bytes Total bytes count to calculate percent data.
|
||||||
|
*
|
||||||
|
* @return string HTML data table.
|
||||||
|
*/
|
||||||
|
function netflow_top_n_table(array $data, int $total_bytes)
|
||||||
|
{
|
||||||
|
global $nfdump_date_format;
|
||||||
|
|
||||||
|
$values = [];
|
||||||
|
$table = new stdClass();
|
||||||
|
$table->class = 'w100p';
|
||||||
|
$table->cellspacing = 0;
|
||||||
|
$table->data = [];
|
||||||
|
|
||||||
|
$table->head = [];
|
||||||
|
$table->head[0] = '<b>'.__('Source IP').'</b>';
|
||||||
|
$table->head[1] = '<b>'.__('Destination IP').'</b>';
|
||||||
|
$table->head[2] = '<b>'.__('Bytes').'</b>';
|
||||||
|
$table->head[3] = '<b>'.__('% Traffic').'</b>';
|
||||||
|
$table->head[4] = '<b>'.__('Avg. Throughput').'</b>';
|
||||||
|
$table->style[0] = 'padding: 4px';
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
foreach ($data as $value) {
|
||||||
|
$table->data[$i][0] = $value['ip_src'];
|
||||||
|
$table->data[$i][1] = $value['ip_dst'];
|
||||||
|
$table->data[$i][2] = network_format_bytes($value['bytes']);
|
||||||
|
|
||||||
|
$traffic = '-';
|
||||||
|
|
||||||
|
if ($total_bytes > 0) {
|
||||||
|
$traffic = sprintf(
|
||||||
|
'%.2f',
|
||||||
|
(($value['bytes'] / $total_bytes) * 100)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[$i][3] = $traffic.' %';
|
||||||
|
|
||||||
|
$units = [
|
||||||
|
'bps',
|
||||||
|
'Kbps',
|
||||||
|
'Mbps',
|
||||||
|
'Gbps',
|
||||||
|
'Tbps',
|
||||||
|
];
|
||||||
|
|
||||||
|
$pow = floor((($value['bps'] > 0) ? log($value['bps']) : 0) / log(1024));
|
||||||
|
$pow = min($pow, (count($units) - 1));
|
||||||
|
|
||||||
|
$value['bps'] /= pow(1024, $pow);
|
||||||
|
|
||||||
|
$table->data[$i][4] = round($value['bps'], 2).' '.$units[$pow];
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html_print_table($table, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a table with a traffic summary.
|
* Show a table with a traffic summary.
|
||||||
*
|
*
|
||||||
@ -395,6 +461,67 @@ function netflow_is_net($address)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns netflow top N connections for the given period in an array (based on total traffic).
|
||||||
|
*
|
||||||
|
* @param string $start_date Period start date.
|
||||||
|
* @param string $end_date Period end date.
|
||||||
|
* @param array $filter Netflow filter.
|
||||||
|
* @param integer $max Maximum number of aggregates.
|
||||||
|
* @param string $connection_name Node name when data is get in meta.
|
||||||
|
*
|
||||||
|
* @return array An array with netflow stats.
|
||||||
|
*/
|
||||||
|
function netflow_get_top_N(
|
||||||
|
string $start_date,
|
||||||
|
string $end_date,
|
||||||
|
array $filter,
|
||||||
|
int $max,
|
||||||
|
string $connection_name=''
|
||||||
|
) {
|
||||||
|
global $nfdump_date_format;
|
||||||
|
|
||||||
|
// Requesting remote data.
|
||||||
|
if (is_metaconsole() === true && empty($connection_name) === false) {
|
||||||
|
$data = metaconsole_call_remote_api(
|
||||||
|
$connection_name,
|
||||||
|
'netflow_get_top_N',
|
||||||
|
$start_date.'|'.$end_date.'|'.base64_encode(json_encode($filter)).'|'.$max
|
||||||
|
);
|
||||||
|
|
||||||
|
return json_decode($data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$options = '-o "fmt:%sap,%dap,%ibyt,%bps" -q -n '.$max.' -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
|
||||||
|
|
||||||
|
$command = netflow_get_command($options, $filter);
|
||||||
|
|
||||||
|
// Execute nfdump.
|
||||||
|
exec($command, $lines);
|
||||||
|
|
||||||
|
if (is_array($lines) === false) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$values = [];
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
$parsed_line = explode(',', $line);
|
||||||
|
$parsed_line = array_map('trim', $parsed_line);
|
||||||
|
|
||||||
|
$values[$i]['ip_src'] = $parsed_line[0];
|
||||||
|
$values[$i]['ip_dst'] = $parsed_line[1];
|
||||||
|
$values[$i]['bytes'] = $parsed_line[2];
|
||||||
|
$values[$i]['bps'] = $parsed_line[3];
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns netflow data for the given period in an array.
|
* Returns netflow data for the given period in an array.
|
||||||
*
|
*
|
||||||
@ -707,7 +834,7 @@ function netflow_get_summary($start_date, $end_date, $filter, $connection_name='
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Requesting remote data.
|
// Requesting remote data.
|
||||||
if (defined('METACONSOLE') && $connection_name != '') {
|
if (is_metaconsole() === true && $connection_name != '') {
|
||||||
$data = metaconsole_call_remote_api($connection_name, 'netflow_get_summary', "$start_date|$end_date|".base64_encode(json_encode($filter)));
|
$data = metaconsole_call_remote_api($connection_name, 'netflow_get_summary', "$start_date|$end_date|".base64_encode(json_encode($filter)));
|
||||||
return json_decode($data, true);
|
return json_decode($data, true);
|
||||||
}
|
}
|
||||||
@ -1051,6 +1178,7 @@ function netflow_get_chart_types()
|
|||||||
'netflow_area' => __('Area graph'),
|
'netflow_area' => __('Area graph'),
|
||||||
'netflow_summary' => __('Summary'),
|
'netflow_summary' => __('Summary'),
|
||||||
'netflow_data' => __('Data table'),
|
'netflow_data' => __('Data table'),
|
||||||
|
'netflow_top_N' => __('Top-N connections'),
|
||||||
'netflow_mesh' => __('Circular mesh'),
|
'netflow_mesh' => __('Circular mesh'),
|
||||||
'netflow_host_treemap' => __('Host detailed traffic'),
|
'netflow_host_treemap' => __('Host detailed traffic'),
|
||||||
];
|
];
|
||||||
@ -1218,6 +1346,54 @@ function netflow_draw_item(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'netflow_top_N':
|
||||||
|
$data_summary = netflow_get_summary(
|
||||||
|
$start_date,
|
||||||
|
$end_date,
|
||||||
|
$filter,
|
||||||
|
$connection_name
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($data_summary) === true) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_top_n = netflow_get_top_N(
|
||||||
|
$start_date,
|
||||||
|
$end_date,
|
||||||
|
$filter,
|
||||||
|
$max_aggregates,
|
||||||
|
$connection_name
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($data_top_n) === true) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($output === 'HTML' || $output === 'PDF') {
|
||||||
|
$html = '<table class="w100p">';
|
||||||
|
$html .= '<tr>';
|
||||||
|
$html .= "<td class='w50p'>";
|
||||||
|
$html .= netflow_summary_table($data_summary);
|
||||||
|
$html .= '</td>';
|
||||||
|
$html .= '</tr>';
|
||||||
|
$html .= '<tr>';
|
||||||
|
$html .= "<td class='w100p'>";
|
||||||
|
$html .= netflow_top_n_table($data_top_n, $data_summary['totalbytes']);
|
||||||
|
$html .= '</td>';
|
||||||
|
$html .= '</tr>';
|
||||||
|
$html .= '</table>';
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
} else if ($output === 'XML') {
|
||||||
|
$xml = '<aggregate>'.$aggregate."</aggregate>\n";
|
||||||
|
$xml .= '<resolution>'.$interval_length."</resolution>\n";
|
||||||
|
// Same as netflow_aggregate_area_xml.
|
||||||
|
$xml .= netflow_aggregate_area_xml($data_top_n);
|
||||||
|
return $xml;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'netflow_mesh':
|
case 'netflow_mesh':
|
||||||
$data = netflow_get_relationships_raw_data(
|
$data = netflow_get_relationships_raw_data(
|
||||||
$start_date,
|
$start_date,
|
||||||
@ -1304,6 +1480,46 @@ function netflow_draw_item(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get data of a netflow report item.
|
||||||
|
*
|
||||||
|
* @param string $start_date Period start date.
|
||||||
|
* @param string $end_date Period end date.
|
||||||
|
* @param array $filter Netflow filter.
|
||||||
|
* @param integer $max_aggregates Maximum number of aggregates.
|
||||||
|
* @param string $connection_name Node name when data is get in meta.
|
||||||
|
*
|
||||||
|
* @return array Netflow item data (summary and top N data).
|
||||||
|
*/
|
||||||
|
function netflow_get_item_data(
|
||||||
|
string $start_date,
|
||||||
|
string $end_date,
|
||||||
|
array $filter,
|
||||||
|
int $max_aggregates,
|
||||||
|
string $connection_name
|
||||||
|
) {
|
||||||
|
$data_summary = netflow_get_summary(
|
||||||
|
$start_date,
|
||||||
|
$end_date,
|
||||||
|
$filter,
|
||||||
|
$connection_name
|
||||||
|
);
|
||||||
|
|
||||||
|
$data_top_n = netflow_get_top_N(
|
||||||
|
$start_date,
|
||||||
|
$end_date,
|
||||||
|
$filter,
|
||||||
|
$max_aggregates,
|
||||||
|
$connection_name
|
||||||
|
);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'summary' => $data_summary,
|
||||||
|
'top_n' => $data_top_n,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render an aggregated area chart as an XML.
|
* Render an aggregated area chart as an XML.
|
||||||
*
|
*
|
||||||
|
@ -606,6 +606,18 @@ function reporting_make_reporting_data(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'netflow_top_N':
|
||||||
|
$report['contents'][] = reporting_netflow(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type,
|
||||||
|
$force_width_chart,
|
||||||
|
$force_height_chart,
|
||||||
|
'netflow_top_N',
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'monitor_report':
|
case 'monitor_report':
|
||||||
$report['contents'][] = reporting_monitor_report(
|
$report['contents'][] = reporting_monitor_report(
|
||||||
$report,
|
$report,
|
||||||
@ -5569,6 +5581,10 @@ function reporting_netflow(
|
|||||||
$return['type'] = 'netflow_summary';
|
$return['type'] = 'netflow_summary';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'netflow_top_N':
|
||||||
|
$return['type'] = 'netflow_top_N';
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$return['type'] = 'unknown';
|
$return['type'] = 'unknown';
|
||||||
break;
|
break;
|
||||||
@ -5588,6 +5604,10 @@ function reporting_netflow(
|
|||||||
$content['name'] = __('Netflow Data');
|
$content['name'] = __('Netflow Data');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'netflow_top_N':
|
||||||
|
$content['name'] = __('Netflow top-N connections');
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$content['name'] = __('Unknown report');
|
$content['name'] = __('Unknown report');
|
||||||
break;
|
break;
|
||||||
@ -5627,26 +5647,61 @@ function reporting_netflow(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
switch ($type) {
|
if ($type_netflow === 'netflow_top_N') {
|
||||||
case 'dinamic':
|
// Always aggregate by destination port.
|
||||||
case 'static':
|
$filter['aggregate'] = 'dstport';
|
||||||
case 'data':
|
|
||||||
$return['chart'] = netflow_draw_item(
|
|
||||||
($report['datetime'] - $content['period']),
|
|
||||||
$report['datetime'],
|
|
||||||
$content['top_n'],
|
|
||||||
$type_netflow,
|
|
||||||
$filter,
|
|
||||||
$content['top_n_value'],
|
|
||||||
$content['server_name'],
|
|
||||||
$pdf ? 'PDF' : 'HTML'
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'data':
|
switch ($type) {
|
||||||
default:
|
case 'dinamic':
|
||||||
// Nothing to do.
|
case 'static':
|
||||||
break;
|
$return['chart'] = netflow_draw_item(
|
||||||
|
($report['datetime'] - $content['period']),
|
||||||
|
$report['datetime'],
|
||||||
|
$content['top_n'],
|
||||||
|
$type_netflow,
|
||||||
|
$filter,
|
||||||
|
$content['top_n_value'],
|
||||||
|
$content['server_name'],
|
||||||
|
(($pdf === true) ? 'PDF' : 'HTML')
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'data':
|
||||||
|
$return['data'] = netflow_get_item_data(
|
||||||
|
($report['datetime'] - $content['period']),
|
||||||
|
$report['datetime'],
|
||||||
|
$filter,
|
||||||
|
$content['top_n_value'],
|
||||||
|
$content['server_name']
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Nothing to do.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch ($type) {
|
||||||
|
case 'dinamic':
|
||||||
|
case 'static':
|
||||||
|
case 'data':
|
||||||
|
$return['chart'] = netflow_draw_item(
|
||||||
|
($report['datetime'] - $content['period']),
|
||||||
|
$report['datetime'],
|
||||||
|
$content['top_n'],
|
||||||
|
$type_netflow,
|
||||||
|
$filter,
|
||||||
|
$content['top_n_value'],
|
||||||
|
$content['server_name'],
|
||||||
|
$pdf ? 'PDF' : 'HTML'
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'data':
|
||||||
|
default:
|
||||||
|
// Nothing to do.
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$return['subtitle'] = netflow_generate_subtitle_report(
|
$return['subtitle'] = netflow_generate_subtitle_report(
|
||||||
|
@ -326,6 +326,7 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
case 'netflow_data':
|
case 'netflow_data':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
|
case 'netflow_top_N':
|
||||||
reporting_html_graph($table, $item);
|
reporting_html_graph($table, $item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -906,6 +906,10 @@ function reports_get_report_types($template=false, $not_editor=false)
|
|||||||
'optgroup' => __('Netflow'),
|
'optgroup' => __('Netflow'),
|
||||||
'name' => __('Netflow summary table'),
|
'name' => __('Netflow summary table'),
|
||||||
];
|
];
|
||||||
|
$types['netflow_top_N'] = [
|
||||||
|
'optgroup' => __('Netflow'),
|
||||||
|
'name' => __('Netflow top-N connections'),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['enterprise_installed'] && $template === false && !is_metaconsole()) {
|
if ($config['enterprise_installed'] && $template === false && !is_metaconsole()) {
|
||||||
|
@ -1214,3 +1214,7 @@ input[type="image"] {
|
|||||||
.databox_color {
|
.databox_color {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mono {
|
||||||
|
font-family: source-code, mono, monospace;
|
||||||
|
}
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
<div style='height: 10px'>
|
<div style='height: 10px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.760';
|
$version = '7.0NG.760';
|
||||||
$build = '220317';
|
$build = '220318';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
@ -81,6 +81,8 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
|
|||||||
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
||||||
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
||||||
echo '<link rel="stylesheet" href="../../include/styles/pandora_black.css" type="text/css"/>';
|
echo '<link rel="stylesheet" href="../../include/styles/pandora_black.css" type="text/css"/>';
|
||||||
|
} else {
|
||||||
|
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -100,7 +102,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
|
|||||||
$last_data = preg_replace('/>/', '>', $last_data);
|
$last_data = preg_replace('/>/', '>', $last_data);
|
||||||
$last_data = preg_replace('/\n/i', '<br>', $last_data);
|
$last_data = preg_replace('/\n/i', '<br>', $last_data);
|
||||||
$last_data = preg_replace('/\s/i', ' ', $last_data);
|
$last_data = preg_replace('/\s/i', ' ', $last_data);
|
||||||
echo "<div id='result_div' class='result_div'>";
|
echo "<div id='result_div' class='result_div mono'>";
|
||||||
echo $last_data;
|
echo $last_data;
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
?>
|
?>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
%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
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-server
|
package: pandorafms-server
|
||||||
Version: 7.0NG.760-220317
|
Version: 7.0NG.760-220318
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.760-220317"
|
pandora_version="7.0NG.760-220318"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -46,7 +46,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.760";
|
my $pandora_version = "7.0NG.760";
|
||||||
my $pandora_build = "220317";
|
my $pandora_build = "220318";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
|
@ -34,7 +34,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.760";
|
my $pandora_version = "7.0NG.760";
|
||||||
my $pandora_build = "220317";
|
my $pandora_build = "220318";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.760
|
%define version 7.0NG.760
|
||||||
%define release 220317
|
%define release 220318
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.760"
|
PI_VERSION="7.0NG.760"
|
||||||
PI_BUILD="220317"
|
PI_BUILD="220318"
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.760 Build 220317";
|
my $version = "7.0NG.760 Build 220318";
|
||||||
|
|
||||||
# Pandora server configuration
|
# Pandora server configuration
|
||||||
my %conf;
|
my %conf;
|
||||||
@ -318,7 +318,7 @@ sub pandora_purgedb ($$) {
|
|||||||
} else {
|
} else {
|
||||||
my @blacklist_types = ("'SLA_services'", "'custom_graph'", "'sql_graph_vbar'", "'sql_graph_hbar'",
|
my @blacklist_types = ("'SLA_services'", "'custom_graph'", "'sql_graph_vbar'", "'sql_graph_hbar'",
|
||||||
"'sql_graph_pie'", "'database_serialized'", "'sql'", "'inventory'", "'inventory_changes'",
|
"'sql_graph_pie'", "'database_serialized'", "'sql'", "'inventory'", "'inventory_changes'",
|
||||||
"'netflow_area'", "'netflow_data'", "'netflow_summary'");
|
"'netflow_area'", "'netflow_data'", "'netflow_summary'", "'netflow_top_N'");
|
||||||
my $blacklist_types_str = join(',', @blacklist_types);
|
my $blacklist_types_str = join(',', @blacklist_types);
|
||||||
|
|
||||||
# Deleted modules
|
# Deleted modules
|
||||||
|
@ -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.760 Build 220317";
|
my $version = "7.0NG.760 Build 220318";
|
||||||
|
|
||||||
# save program name for logging
|
# save program name for logging
|
||||||
my $progname = basename($0);
|
my $progname = basename($0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user