mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge remote-tracking branch 'origin/develop' into ent-4545-Bug-creacion-infrome-con-graficas-MAX-Value-fallo-tabla
Conflicts: pandora_console/include/functions_reporting.php
This commit is contained in:
commit
e16855396a
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.738-190911
|
Version: 7.0NG.738-190913
|
||||||
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.738-190911"
|
pandora_version="7.0NG.738-190913"
|
||||||
|
|
||||||
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
|
||||||
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.738';
|
use constant AGENT_VERSION => '7.0NG.738';
|
||||||
use constant AGENT_BUILD => '190911';
|
use constant AGENT_BUILD => '190913';
|
||||||
|
|
||||||
# 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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
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.738"
|
PI_VERSION="7.0NG.738"
|
||||||
PI_BUILD="190911"
|
PI_BUILD="190913"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{190911}
|
{190913}
|
||||||
|
|
||||||
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.738(Build 190911)")
|
#define PANDORA_VERSION ("7.0NG.738(Build 190913)")
|
||||||
|
|
||||||
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.738(Build 190911))"
|
VALUE "ProductVersion", "(7.0NG.738(Build 190913))"
|
||||||
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.738-190911
|
Version: 7.0NG.738-190913
|
||||||
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.738-190911"
|
pandora_version="7.0NG.738-190913"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -44,24 +44,16 @@ $groups = groups_get_all();
|
|||||||
// Add the All group to the beginning to be always the first
|
// Add the All group to the beginning to be always the first
|
||||||
// Use this instead array_unshift to keep the array keys
|
// Use this instead array_unshift to keep the array keys
|
||||||
$groups = ([0 => __('All')] + $groups);
|
$groups = ([0 => __('All')] + $groups);
|
||||||
$html = '';
|
$groups_selected = [];
|
||||||
$style = 'style="padding: 2px 10px; display: inline-block;"';
|
|
||||||
foreach ($groups as $id => $name) {
|
foreach ($groups as $id => $name) {
|
||||||
$checked = in_array($id, $file['groups']);
|
if (in_array($id, $file['groups'])) {
|
||||||
$all_checked = false;
|
$groups_selected[] = $id;
|
||||||
if ($id === 0) {
|
|
||||||
$checkbox = html_print_checkbox_extended('groups[]', $id, $checked, false, '', 'class="chkb_all"', true);
|
|
||||||
$all_checked = $checked;
|
|
||||||
} else {
|
|
||||||
$checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "<div $style>$name $checkbox</div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = [];
|
$row = [];
|
||||||
$row[0] = __('Groups');
|
$row[0] = __('Groups');
|
||||||
$row[1] = $html;
|
$row[1] = html_print_select($groups, 'groups[]', $groups_selected, '', '', '', true, true, '', '', '');
|
||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
$table->colspan[][1] = 3;
|
$table->colspan[][1] = 3;
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ function files_repo_add_file($file_input_name='upfile', $description='', $groups
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$attachment_path = io_safe_output($config['attachment_store']);
|
$attachment_path = io_safe_output($config['attachment_store']);
|
||||||
$files_repo_path = $attachment_path.'/'.'files_repo';
|
$files_repo_path = $attachment_path.'/files_repo';
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC190911';
|
$build_version = 'PC190913';
|
||||||
$pandora_version = 'v7.0NG.738';
|
$pandora_version = 'v7.0NG.738';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -4785,12 +4785,10 @@ function reporting_value($report, $content, $type, $pdf=false)
|
|||||||
'period' => $content['period'],
|
'period' => $content['period'],
|
||||||
'width' => '600px',
|
'width' => '600px',
|
||||||
'pure' => false,
|
'pure' => false,
|
||||||
// true
|
|
||||||
'date' => $report['datetime'],
|
'date' => $report['datetime'],
|
||||||
'only_image' => $only_image,
|
'only_image' => $only_image,
|
||||||
'homeurl' => ui_get_full_url(false, false, false, false),
|
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||||
'ttl' => 1,
|
'ttl' => 1,
|
||||||
// 2
|
|
||||||
'type_graph' => $config['type_module_charts'],
|
'type_graph' => $config['type_module_charts'],
|
||||||
'time_interval' => $content['lapse'],
|
'time_interval' => $content['lapse'],
|
||||||
'server_id' => $id_meta,
|
'server_id' => $id_meta,
|
||||||
@ -4800,323 +4798,105 @@ function reporting_value($report, $content, $type, $pdf=false)
|
|||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'max':
|
case 'max':
|
||||||
if ($content['lapse_calc'] == 0) {
|
|
||||||
$value = reporting_get_agentmodule_data_max(
|
|
||||||
$content['id_agent_module'],
|
|
||||||
$content['period'],
|
|
||||||
$report['datetime']
|
|
||||||
);
|
|
||||||
if (!$config['simple_module_value']) {
|
|
||||||
$formated_value = $value;
|
|
||||||
} else {
|
|
||||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$value = '
|
|
||||||
<table border="0" style="margin:0 auto;text-align:center;">
|
|
||||||
<tr>
|
|
||||||
<td width="400px;" height="20%;">';
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
|
||||||
$value .= '
|
|
||||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
|
||||||
<tr>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Agent').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Module').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Maximum').'
|
|
||||||
</th>
|
|
||||||
<tr>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.$agent_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.$module_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
</td>
|
|
||||||
<td rowspan="2" width="150px">
|
|
||||||
</td>
|
|
||||||
<td rowspan="2">';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
|
||||||
$params['force_interval'] = 'max_only';
|
|
||||||
$value .= grafico_modulo_sparse($params);
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
|
||||||
$value .= '
|
|
||||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
|
||||||
<tr>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Lapse').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Maximum').'
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>';
|
|
||||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
|
|
||||||
$date_reference = getdate();
|
|
||||||
|
|
||||||
for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) {
|
|
||||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).'</td><td>';
|
|
||||||
|
|
||||||
if ($i > $time_begin['utimestamp']) {
|
|
||||||
$value .= format_for_graph(
|
|
||||||
reporting_get_agentmodule_data_max(
|
|
||||||
$content['id_agent_module'],
|
|
||||||
$content['lapse'],
|
|
||||||
($i + $content['lapse'])
|
|
||||||
),
|
|
||||||
$config['graph_precision']
|
|
||||||
).' '.$unit.'</td></tr>';
|
|
||||||
} else {
|
|
||||||
$value .= 'N/A</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
|
|
||||||
$formated_value = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'min':
|
case 'min':
|
||||||
if ($content['lapse_calc'] == 0) {
|
|
||||||
$value = reporting_get_agentmodule_data_min(
|
|
||||||
$content['id_agent_module'],
|
|
||||||
$content['period'],
|
|
||||||
$report['datetime']
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!$config['simple_module_value']) {
|
|
||||||
$formated_value = $value;
|
|
||||||
} else {
|
|
||||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$value = '
|
|
||||||
<table border="0" style="margin:0 auto;text-align:center;">
|
|
||||||
<tr>
|
|
||||||
<td width="400px;" height="20%;">';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
|
||||||
$value .= '
|
|
||||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
|
||||||
<tr>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Agent').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Module').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Minimum').'
|
|
||||||
</th>
|
|
||||||
<tr>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.$agent_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.$module_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
</td>
|
|
||||||
<td rowspan="2" width="150px">
|
|
||||||
</td>
|
|
||||||
<td rowspan="2">';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
|
||||||
$params['force_interval'] = 'min_only';
|
|
||||||
$value .= grafico_modulo_sparse($params);
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
|
||||||
$value .= '
|
|
||||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
|
||||||
<tr>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Lapse').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Minimum').'
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>';
|
|
||||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
|
|
||||||
$date_reference = getdate();
|
|
||||||
|
|
||||||
for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) {
|
|
||||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).'</td><td>';
|
|
||||||
|
|
||||||
if ($i > $time_begin['utimestamp']) {
|
|
||||||
$value .= format_for_graph(
|
|
||||||
reporting_get_agentmodule_data_min(
|
|
||||||
$content['id_agent_module'],
|
|
||||||
$content['lapse'],
|
|
||||||
($i + $content['lapse'])
|
|
||||||
),
|
|
||||||
$config['graph_precision']
|
|
||||||
).' '.$unit.'</td></tr>';
|
|
||||||
} else {
|
|
||||||
$value .= 'N/A</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
|
|
||||||
$formated_value = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'avg':
|
case 'avg':
|
||||||
if ($content['lapse_calc'] == 0) {
|
if ($content['lapse_calc'] == 0) {
|
||||||
$value = reporting_get_agentmodule_data_average(
|
switch ($type) {
|
||||||
$content['id_agent_module'],
|
case 'max':
|
||||||
$content['period'],
|
$value = reporting_get_agentmodule_data_max(
|
||||||
$report['datetime']
|
$content['id_agent_module'],
|
||||||
);
|
$content['period'],
|
||||||
|
$report['datetime']
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'min':
|
||||||
|
$value = reporting_get_agentmodule_data_min(
|
||||||
|
$content['id_agent_module'],
|
||||||
|
$content['period'],
|
||||||
|
$report['datetime']
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'avg':
|
||||||
|
$value = reporting_get_agentmodule_data_average(
|
||||||
|
$content['id_agent_module'],
|
||||||
|
$content['period'],
|
||||||
|
$report['datetime']
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$config['simple_module_value']) {
|
if (!$config['simple_module_value']) {
|
||||||
$formated_value = $value;
|
$formated_value = $value;
|
||||||
} else {
|
} else {
|
||||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value = '
|
$return['visual_format'] = $content['visual_format'];
|
||||||
<table border="0" style="margin:0 auto;text-align:center;">
|
|
||||||
<tr>
|
|
||||||
<td width="400px;" height="20%;">';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
switch ($type) {
|
||||||
$value .= '
|
case 'max':
|
||||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
$params['force_interval'] = 'max_only';
|
||||||
<tr>
|
$value = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
break;
|
||||||
'.__('Agent').'
|
|
||||||
</th>
|
case 'min':
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
$params['force_interval'] = 'min_only';
|
||||||
'.__('Module').'
|
$value = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||||
</th>
|
break;
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Average').'
|
case 'avg':
|
||||||
</th>
|
$params['force_interval'] = 'avg_only';
|
||||||
<tr>
|
$value = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||||
<td style="padding:5px;">
|
break;
|
||||||
'.$agent_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.$module_name.'
|
|
||||||
</td>
|
|
||||||
<td style="padding:5px;">
|
|
||||||
'.format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$value .= '
|
$return['data'][] = [
|
||||||
</td>
|
__('Agent') => $agent_name,
|
||||||
<td rowspan="2" width="150px">
|
__('Module') => $module_name,
|
||||||
</td>
|
__('Maximun') => $value,
|
||||||
<td rowspan="2">';
|
];
|
||||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
|
||||||
$params['force_interval'] = 'avg_only';
|
if ($content['visual_format'] != 1) {
|
||||||
$value .= grafico_modulo_sparse($params);
|
$graph = grafico_modulo_sparse($params);
|
||||||
|
$return['data'][] = ['value' => $graph];
|
||||||
}
|
}
|
||||||
|
|
||||||
$value .= '
|
if ($content['visual_format'] != 2) {
|
||||||
|
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>';
|
|
||||||
|
|
||||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
|
||||||
$value .= '
|
|
||||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
|
||||||
<tr>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Lapse').'
|
|
||||||
</th>
|
|
||||||
<th style="padding:5px;background-color:#82b92e;">
|
|
||||||
'.__('Average').'
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>';
|
|
||||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
|
|
||||||
$date_reference = getdate();
|
|
||||||
|
|
||||||
for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) {
|
for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) {
|
||||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).'</td><td>';
|
$row = [];
|
||||||
|
$row[__('Lapse')] = date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) ));
|
||||||
|
|
||||||
if ($i > $time_begin['utimestamp']) {
|
if ($i > $time_begin['utimestamp']) {
|
||||||
$value .= format_for_graph(
|
switch ($type) {
|
||||||
reporting_get_agentmodule_data_average(
|
case 'max':
|
||||||
$content['id_agent_module'],
|
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision']).' '.$unit;
|
||||||
$content['lapse'],
|
break;
|
||||||
($i + $content['lapse'])
|
|
||||||
),
|
|
||||||
$config['graph_precision']
|
|
||||||
).' '.$unit.'</td></tr>';
|
|
||||||
} else {
|
|
||||||
$value .= 'N/A</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$value .= '</table>';
|
case 'min':
|
||||||
|
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision']).' '.$unit;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'avg':
|
||||||
|
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision']).' '.$unit;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$row[__('Maximun')] = 'N/A';
|
||||||
|
}
|
||||||
|
|
||||||
|
$return['data'][] = $row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$value .= '
|
if ($config['metaconsole']) {
|
||||||
|
metaconsole_restore_db();
|
||||||
</td>
|
}
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
|
|
||||||
$formated_value = $value;
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2784,20 +2784,130 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e
|
|||||||
$font_size = '3';
|
$font_size = '3';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->colspan['data']['cell'] = 3;
|
if (isset($item['visual_format']) && $item['visual_format'] != 0
|
||||||
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
&& ($item['type'] == 'max_value' || $item['type'] == 'min_value' || $item['type'] == 'avg_value')
|
||||||
|
) {
|
||||||
|
$table2 = new stdClass();
|
||||||
|
$table2->width = '100%';
|
||||||
|
switch ($item['type']) {
|
||||||
|
case 'max_value':
|
||||||
|
$table2->head = [
|
||||||
|
__('Agent'),
|
||||||
|
__('Module'),
|
||||||
|
__('Maximun'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
$table->data['data']['cell'] = '<p style="font: bold '.$font_size.'em Arial, Sans-serif; color: #000000;">';
|
case 'min_value':
|
||||||
|
$table2->head = [
|
||||||
|
__('Agent'),
|
||||||
|
__('Module'),
|
||||||
|
__('Minimun'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
if ($check_empty && empty($item['data']['value'])) {
|
case 'avg_value':
|
||||||
$table->data['data']['cell'] .= __('Unknown');
|
$table2->head = [
|
||||||
} else if ($only_value) {
|
__('Agent'),
|
||||||
$table->data['data']['cell'] .= $item['data']['value'];
|
__('Module'),
|
||||||
|
__('Average'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table2->data = [];
|
||||||
|
|
||||||
|
$data = $item['data'][0];
|
||||||
|
|
||||||
|
$row = [
|
||||||
|
$data[__('Agent')],
|
||||||
|
$data[__('Module')],
|
||||||
|
$data[__('Maximun')],
|
||||||
|
];
|
||||||
|
|
||||||
|
$table2->data[] = $row;
|
||||||
|
|
||||||
|
$table2->title = $item['title'];
|
||||||
|
$table2->titleclass = 'title_table_pdf';
|
||||||
|
$table2->titlestyle = 'text-align:left;';
|
||||||
|
$table->colspan[1][0] = 3;
|
||||||
|
$table->colspan[2][0] = 3;
|
||||||
|
$table->colspan[3][0] = 3;
|
||||||
|
|
||||||
|
array_push($table->data, html_print_table($table2, true));
|
||||||
|
unset($item['data'][0]);
|
||||||
|
|
||||||
|
if ($item['visual_format'] != 1) {
|
||||||
|
$value = $item['data'][1]['value'];
|
||||||
|
array_push($table->data, $value);
|
||||||
|
unset($item['data'][1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($item['visual_format'] != 2) {
|
||||||
|
$table1 = new stdClass();
|
||||||
|
$table1->width = '100%';
|
||||||
|
switch ($item['type']) {
|
||||||
|
case 'max_value':
|
||||||
|
$table1->head = [
|
||||||
|
__('Lapse'),
|
||||||
|
__('Maximun'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'min_value':
|
||||||
|
$table1->head = [
|
||||||
|
__('Lapse'),
|
||||||
|
__('Minimun'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'avg_value':
|
||||||
|
$table1->head = [
|
||||||
|
__('Lapse'),
|
||||||
|
__('Average'),
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table1->data = [];
|
||||||
|
foreach ($item['data'] as $data) {
|
||||||
|
if (!is_numeric($data[__('Maximun')])) {
|
||||||
|
$row = [
|
||||||
|
$data[__('Lapse')],
|
||||||
|
$data[__('Maximun')],
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$row = [
|
||||||
|
$data[__('Lapse')],
|
||||||
|
remove_right_zeros(number_format($data[__('Maximun')], $config['graph_precision'])),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$table1->data[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table1->title = $item['title'];
|
||||||
|
$table1->titleclass = 'title_table_pdf';
|
||||||
|
$table1->titlestyle = 'text-align:left;';
|
||||||
|
|
||||||
|
array_push($table->data, html_print_table($table1, true));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$table->data['data']['cell'] .= $item['data']['formated_value'];
|
$table->colspan['data']['cell'] = 3;
|
||||||
}
|
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
||||||
|
|
||||||
$table->data['data']['cell'] .= '</p>';
|
$table->data['data']['cell'] = '<p style="font: bold '.$font_size.'em Arial, Sans-serif; color: #000000;">';
|
||||||
|
|
||||||
|
if ($check_empty && empty($item['data']['value'])) {
|
||||||
|
$table->data['data']['cell'] .= __('Unknown');
|
||||||
|
} else if ($only_value) {
|
||||||
|
$table->data['data']['cell'] .= $item['data']['value'];
|
||||||
|
} else {
|
||||||
|
$table->data['data']['cell'] .= $item['data']['formated_value'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data['data']['cell'] .= '</p>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
<div style='height: 10px'>
|
<div style='height: 10px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.738';
|
$version = '7.0NG.738';
|
||||||
$build = '190911';
|
$build = '190913';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
# 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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
# 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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
%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.738-190911
|
Version: 7.0NG.738-190913
|
||||||
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.738-190911"
|
pandora_version="7.0NG.738-190913"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -45,7 +45,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.738";
|
my $pandora_version = "7.0NG.738";
|
||||||
my $pandora_build = "190911";
|
my $pandora_build = "190913";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
|
@ -32,7 +32,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.738";
|
my $pandora_version = "7.0NG.738";
|
||||||
my $pandora_build = "190911";
|
my $pandora_build = "190913";
|
||||||
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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
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.738
|
%define version 7.0NG.738
|
||||||
%define release 190911
|
%define release 190913
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.738"
|
PI_VERSION="7.0NG.738"
|
||||||
PI_BUILD="190911"
|
PI_BUILD="190913"
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.738 PS190911";
|
my $version = "7.0NG.738 PS190913";
|
||||||
|
|
||||||
# Pandora server configuration
|
# Pandora server configuration
|
||||||
my %conf;
|
my %conf;
|
||||||
|
@ -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.738 PS190911";
|
my $version = "7.0NG.738 PS190913";
|
||||||
|
|
||||||
# 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