Merge branch 'develop' into 'ent-4004-Estilos-Discovery'

Conflicts:
  pandora_console/godmode/wizards/HostDevices.class.php
Former-commit-id: de7b4b069e1c5f673b567fcb3271ec867d0fbae1
This commit is contained in:
Tatiana Llorente 2019-05-10 09:55:54 +02:00
commit a9834dc415
53 changed files with 422 additions and 374 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.734-190508 Version: 7.0NG.734-190510
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.734'; use constant AGENT_VERSION => '7.0NG.734';
use constant AGENT_BUILD => '190508'; use constant AGENT_BUILD => '190510';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.734" PI_VERSION="7.0NG.734"
PI_BUILD="190508" PI_BUILD="190510"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190508} {190510}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.734(Build 190508)") #define PANDORA_VERSION ("7.0NG.734(Build 190510)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.734-190508 Version: 7.0NG.734-190510
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -0,0 +1,5 @@
START TRANSACTION;
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event';
COMMIT;

View File

@ -122,7 +122,7 @@ function execution_time()
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) { if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>"; return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
} else { } else {
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>"; return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For more information about this data, check the Execution Time graph</a>";
} }
} }
@ -173,9 +173,9 @@ function license_capacity()
$status_license_capacity = ''; $status_license_capacity = '';
$current_count = db_get_value_sql('SELECT count(*) FROM tagente'); $current_count = db_get_value_sql('SELECT count(*) FROM tagente');
if ($current_count > ($license_limit * 90 / 100)) { if ($current_count > ($license_limit * 90 / 100)) {
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>"; $status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity exceeds 90 percent</a>";
} else { } else {
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>"; $status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity is less than 90 percent</a>";
} }
return $status_license_capacity; return $status_license_capacity;
@ -202,9 +202,9 @@ function interval_average_of_network_modules()
$average_time = ((int) $total_module_interval_time / $total_network_modules); $average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) { if ($average_time < 180) {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load (average time $average_time) and a very fine configuration is required</a>"; $status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is overloaded (average time $average_time) and a very fine configuration is required</a>";
} else { } else {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge (average time $average_time) </a>"; $status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is not overloaded (average time $average_time) </a>";
} }
if ($average_time == 0) { if ($average_time == 0) {
@ -221,9 +221,9 @@ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLO
function files_attachment_folder($total_files) function files_attachment_folder($total_files)
{ {
if ($total_files <= 700) { if ($total_files <= 700) {
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>"; $status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains less than 700 files.</a>";
} else { } else {
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>"; $status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains more than 700 files.</a>";
} }
return $status_total_files; return $status_total_files;
@ -236,9 +236,9 @@ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size) function status_tagente_datos($tagente_datos_size)
{ {
if ($tagente_datos_size <= 3000000) { if ($tagente_datos_size <= 3000000) {
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>"; $tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table contains an acceptable amount of data.</a>";
} else { } else {
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>"; $tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table contains too much data. A historical database is recommended.</a>";
} }
return $tagente_datos_size; return $tagente_datos_size;
@ -302,9 +302,9 @@ function status_fragmentation_tables($tables_fragmentation_max_rec_value, $table
{ {
$status_tables_frag = ''; $status_tables_frag = '';
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) { if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>"; $status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is higher than recommended. They should be defragmented.</a>";
} else { } else {
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>"; $status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is correct.</a>";
} }
return $status_tables_frag; return $status_tables_frag;
@ -320,9 +320,9 @@ if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n"; echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) { if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
echo "\nThis command line script gives information about Pandora FMS database. echo "\nThis command line script contains information about Pandora FMS database.
This program only can be executed from console, and need a parameter, the This program can only be executed from the console, and it needs a parameter, the
full path to Pandora FMS 'config.php' file. full path to Pandora FMS 'config.php' file.
Usage: Usage:
php pandora_diag.php path_to_pandora_console php pandora_diag.php path_to_pandora_console
@ -705,7 +705,7 @@ render_info_data(
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)'); render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)'); render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables'); render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>'; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>';
@ -734,14 +734,14 @@ render_info_data(
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>'; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
render_row($attachment_total_files, 'Total files in the attachment folder'); render_row($attachment_total_files, 'Total files in the attached folder');
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder'); render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>'; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
render_row($tagente_datos_size, 'Total data in the tagente_datos table'); render_row($tagente_datos_size, 'Total data in tagente_datos table');
render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table'); render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
render_row(execution_time(), 'Degradation of the execution time when executing a count'); render_row(execution_time(), 'Execution time degradation when executing a count');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>'; echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
@ -784,6 +784,6 @@ render_info_data(
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>"; echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo '<span>'.__( echo '<span>'.__(
'(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to '(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
keep up-to-date database to get the best performance and results in Pandora' keep the database up-to-date to get the best performance and results in Pandora'
).'</span><br><br><br>'; ).'</span><br><br><br>';

View File

@ -1170,6 +1170,7 @@ html_print_input_hidden('module_relations_count', $relations_count);
ui_require_jquery_file('json'); ui_require_jquery_file('json');
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -33,6 +33,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
$update_command = (bool) get_parameter('update_command'); $update_command = (bool) get_parameter('update_command');
$id = (int) get_parameter('id'); $id = (int) get_parameter('id');
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
$alert = [];
// Header // Header
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
@ -86,7 +87,15 @@ if ($update_command) {
$result = ''; $result = '';
} else { } else {
$result = alerts_update_alert_command($id, $values); $result = alerts_update_alert_command($id, $values);
if ($result) {
$info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}'; $info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}';
$alert['fields_values'] = io_json_mb_encode($fields_values);
$alert['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
$alert['name'] = $name;
$alert['command'] = $command;
$alert['description'] = $description;
$alert['id_group'] = $id_group;
}
} }
if ($result) { if ($result) {
@ -110,7 +119,10 @@ $fields_descriptions = '';
$fields_values = ''; $fields_values = '';
$id_group = 0; $id_group = 0;
if ($id) { if ($id) {
if (!$result) {
$alert = alerts_get_alert_command($id); $alert = alerts_get_alert_command($id);
}
$name = $alert['name']; $name = $alert['name'];
$command = $alert['command']; $command = $alert['command'];
$description = $alert['description']; $description = $alert['description'];

View File

@ -242,7 +242,6 @@ if ($filemanager) {
$chunck_url = '&create=1'; $chunck_url = '&create=1';
} }
$homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false;
filemanager_file_explorer( filemanager_file_explorer(
$real_directory, $real_directory,
$directory, $directory,
@ -253,7 +252,7 @@ if ($filemanager) {
'index.php?sec=gservers&sec2=godmode/servers/plugin'.$chunck_url.'&plugin_command=[FILE_FULLPATH]&id_plugin='.$id_plugin, 'index.php?sec=gservers&sec2=godmode/servers/plugin'.$chunck_url.'&plugin_command=[FILE_FULLPATH]&id_plugin='.$id_plugin,
true, true,
0775, 0775,
$homedir_filemanager false
); );
} }

View File

@ -66,8 +66,6 @@ $real_directory = realpath($config['homedir'].'/'.$directory);
echo '<h4>'.__('Index of %s', $directory).'</h4>'; echo '<h4>'.__('Index of %s', $directory).'</h4>';
$homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false;
filemanager_file_explorer( filemanager_file_explorer(
$real_directory, $real_directory,
$directory, $directory,
@ -78,5 +76,5 @@ filemanager_file_explorer(
'', '',
false, false,
'', '',
$homedir_filemanager false
); );

View File

@ -331,7 +331,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
theme : "advanced", theme : "advanced",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright", theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright, | ,code",
theme_advanced_buttons2 : "", theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "", theme_advanced_buttons3 : "",
convert_urls : false, convert_urls : false,

View File

@ -661,22 +661,25 @@ class Wizard
$output_submit = ''; $output_submit = '';
$output = ''; $output = '';
if ($print_white_box === true) if ($print_white_box === true) {
$output .= '<div class="white_box">'; $output .= '<div class="white_box">';
}
$output .= '<ul class="wizard">'; $output .= '<ul class="wizard">';
foreach ($inputs as $input) { foreach ($inputs as $input) {
if ($input['arguments']['type']!='submit') if ($input['arguments']['type'] != 'submit') {
$output .= $this->printBlock($input, true); $output .= $this->printBlock($input, true);
else } else {
$output_submit .= $this->printBlock($input, true); $output_submit .= $this->printBlock($input, true);
} }
}
$output .= '</ul>'; $output .= '</ul>';
if ($print_white_box === true) if ($print_white_box === true) {
$output .= '</div>'; $output .= '</div>';
}
$output .= '<ul class="wizard">'.$output_submit.'</ul>'; $output .= '<ul class="wizard">'.$output_submit.'</ul>';
$output .= '</form>'; $output .= '</form>';

View File

@ -418,15 +418,15 @@ if ($get_extended_event) {
} }
// Tabs. // Tabs.
$tabs = "<ul style='background:#ffffff !important; border-top: 0px; border-left: 0px; border-right: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color: #D3D3D3;'>"; $tabs = "<ul class='events_tabs'>";
$tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('General').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png', true).'<span>'.__('General').'</span></a></li>';
if (events_has_extended_info($event['id_evento']) === true) { if (events_has_extended_info($event['id_evento']) === true) {
$tabs .= "<li><a href='#extended_event_related_page' id='link_related'>".html_print_image('images/zoom.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Related').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_related_page' id='link_related'>".html_print_image('images/zoom.png', true).'<span>'.__('Related').'</span></a></li>';
} }
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Details').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png', true).'<span>'.__('Details').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Agent fields').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png', true).'<span>'.__('Agent fields').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Comments').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png', true).'<span>'.__('Comments').'</span></a></li>';
if (!$readonly if (!$readonly
&& ((tags_checks_event_acl( && ((tags_checks_event_acl(
@ -546,7 +546,7 @@ if ($get_extended_event) {
$loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>'; $loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>';
$out = '<div id="tabs" style="height:95%; overflow: auto">'.$tabs.$notifications.$loading.$general.$details.$related.$custom_fields.$comments.$responses.$custom_data.html_print_input_hidden('id_event', $event['id_evento']).'</div>'; $out = '<div id="tabs">'.$tabs.$notifications.$loading.$general.$details.$related.$custom_fields.$comments.$responses.$custom_data.html_print_input_hidden('id_event', $event['id_evento']).'</div>';
$js = '<script> $js = '<script>
$(function() { $(function() {

View File

@ -82,11 +82,9 @@ if ($get_extended_info == 1) {
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->style[0] = 'min-width:120px; text-align: left;';
$table->style[1] = 'text-align: left;';
$table->cellspacing = 2; $table->cellspacing = 2;
$table->cellpadding = 2; $table->cellpadding = 2;
$table->class = 'alternate rounded_cells'; $table->class = 'events_show_more_table';
$output = []; $output = [];
$output[] = '<b>'.__('Timestamp').'</b>'; $output[] = '<b>'.__('Timestamp').'</b>';

View File

@ -1120,11 +1120,11 @@ if (check_login()) {
$draw_events = 0; $draw_events = 0;
} }
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;'.'id='.$module['id_agente_modulo'].'&amp;'.'label='.rawurlencode( $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;'.'id='.$module['id_agente_modulo'].'&amp;'.'label='.rawurlencode(
urlencode( urlencode(
base64_encode($module['nombre']) base64_encode($module['nombre'])
) )
).'&amp;'.'refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."')"; ).'&amp;'.'refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
if (!is_snapshot_data($module['datos'])) { if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;'; $data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
} }

View File

@ -37,6 +37,9 @@ $api_password = get_parameter('apipass', '');
$password = get_parameter('pass', ''); $password = get_parameter('pass', '');
$user = get_parameter('user', ''); $user = get_parameter('user', '');
$info = get_parameter('info', ''); $info = get_parameter('info', '');
$other = parseOtherParameter($otherSerialize, $otherMode);
$other = parseOtherParameter($otherSerialize, $otherMode); $other = parseOtherParameter($otherSerialize, $otherMode);
$apiPassword = io_output_password(db_get_value_filter('value', 'tconfig', ['token' => 'api_password'])); $apiPassword = io_output_password(db_get_value_filter('value', 'tconfig', ['token' => 'api_password']));
@ -104,6 +107,7 @@ if ($correctLogin) {
if ($op == 'set' && $id) { if ($op == 'set' && $id) {
switch ($op2) { switch ($op2) {
case 'update_agent': case 'update_agent':
case 'add_module_in_conf': case 'add_module_in_conf':
case 'update_module_in_conf': case 'update_module_in_conf':
case 'delete_module_in_conf': case 'delete_module_in_conf':
@ -184,6 +188,7 @@ if ($correctLogin) {
break; break;
default: default:
// break; // break;
} }
} }

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC190508'; $build_version = 'PC190510';
$pandora_version = 'v7.0NG.734'; $pandora_version = 'v7.0NG.734';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -3541,25 +3541,21 @@ function series_type_graph_array($data, $show_elements_graph)
break; break;
} }
if (isset($show_elements_graph['labels']) if (isset($show_elements_graph['labels'][$value['agent_module_id']])
&& is_array($show_elements_graph['labels']) && is_array($show_elements_graph['labels'])
&& (count($show_elements_graph['labels']) > 0) && (count($show_elements_graph['labels']) > 0)
) { ) {
if ($show_elements_graph['unit']) { $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' ';
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].': ';
} else {
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': ';
}
} else { } else {
if (strpos($key, 'baseline') !== false) { if (strpos($key, 'baseline') !== false) {
if ($show_elements_graph['unit']) { if ($value['unit']) {
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].'Baseline '; $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].'Baseline ';
} else { } else {
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].'Baseline '; $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].'Baseline ';
} }
} else { } else {
if ($show_elements_graph['unit']) { if ($value['unit']) {
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': ';
} else { } else {
$name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': ';
} }

View File

@ -1,36 +1,19 @@
<?php <?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category API
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config; global $config;
// Set character encoding to UTF-8 // Set character encoding to UTF-8 - fixes a lot of multibyte character headaches
// fixes a lot of multibyte character headaches.
require_once 'functions_agents.php'; require_once 'functions_agents.php';
require_once 'functions_modules.php'; require_once 'functions_modules.php';
require_once $config['homedir'].'/include/functions_profile.php'; require_once $config['homedir'].'/include/functions_profile.php';
@ -254,7 +237,7 @@ function returnData($returnType, $data, $separator=';')
case 'json': case 'json':
$data = array_apply_io_safe_output($data); $data = array_apply_io_safe_output($data);
header('Content-type: application/json'); header('Content-type: application/json');
// Allows extra parameters to json_encode, like JSON_FORCE_OBJECT. // Allows extra parameters to json_encode, like JSON_FORCE_OBJECT
if ($separator == ';') { if ($separator == ';') {
$separator = null; $separator = null;
} }
@ -559,6 +542,7 @@ $module_field_column_mampping = [
'module_critical_inverse' => 'critical_inverse as module_critical_inverse', 'module_critical_inverse' => 'critical_inverse as module_critical_inverse',
'module_warning_inverse' => 'warning_inverse as module_warning_inverse', 'module_warning_inverse' => 'warning_inverse as module_warning_inverse',
]; ];
// module related field mappings 2/2 (output field => column for 'tagente_estado') // module related field mappings 2/2 (output field => column for 'tagente_estado')
// module_id_agent_modulo is not in this list // module_id_agent_modulo is not in this list
$estado_fields_to_columns_mapping = [ $estado_fields_to_columns_mapping = [
@ -3030,20 +3014,21 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3)
/** /**
* Create a network module in agent. * Create a network module in agent. And return the id_agent_module of new module.
* And return the id_agent_module of new module.
* *
* @param string $id Name of agent to add the module. * @param string $id Name of agent to add the module.
* @param string $thrash1 Don't use. * @param $thrash1 Don't use.
* @param array $other It's array, $other as param is <name_module>;<disabled>;<id_module_type>; * @param array $other it's array, $other as param is <name_module>;<disabled>;<id_module_type>;
* <id_module_group>;<min_warning>;<max_warning>;<str_warning>;<min_critical>;<max_critical>;<str_critical>;<ff_threshold>; * <id_module_group>;<min_warning>;<max_warning>;<str_warning>;<min_critical>;<max_critical>;<str_critical>;<ff_threshold>;
* <history_data>;<ip_target>;<module_port>;<snmp_community>;<snmp_oid>;<module_interval>;<post_process>; * <history_data>;<ip_target>;<module_port>;<snmp_community>;<snmp_oid>;<module_interval>;<post_process>;
* <min>;<max>;<custom_id>;<description>;<disabled_types_event>;<module_macros>; * <min>;<max>;<custom_id>;<description>;<disabled_types_event>;<module_macros>;
* <each_ff>;<ff_threshold_normal>;<ff_threshold_warning>;<ff_threshold_critical>; in this order * <each_ff>;<ff_threshold_normal>;<ff_threshold_warning>;<ff_threshold_critical>; in this order
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>). * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
* @param string $thrash3 Don't use. * example:
* @example: api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|* *
* @return mixed Return. * api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|
*
* @param $thrash3 Don't use
*/ */
function api_set_create_network_module($id, $thrash1, $other, $thrash3) function api_set_create_network_module($id, $thrash1, $other, $thrash3)
{ {
@ -3105,23 +3090,22 @@ function api_set_create_network_module($id, $thrash1, $other, $thrash3)
'min_ff_event_critical' => $other['data'][27], 'min_ff_event_critical' => $other['data'][27],
'critical_inverse' => $other['data'][28], 'critical_inverse' => $other['data'][28],
'warning_inverse' => $other['data'][29], 'warning_inverse' => $other['data'][29],
'ff_type' => $other['data'][30],
]; ];
if (! $values['descripcion']) { if (! $values['descripcion']) {
$values['descripcion'] = ''; $values['descripcion'] = '';
// Column 'descripcion' cannot be null. // Column 'descripcion' cannot be null
} }
if (! $values['module_macros']) { if (! $values['module_macros']) {
$values['module_macros'] = ''; $values['module_macros'] = '';
// Column 'module_macros' cannot be null. // Column 'module_macros' cannot be null
} }
$idModule = modules_create_agent_module($idAgent, $name, $values, true); $idModule = modules_create_agent_module($idAgent, $name, $values, true);
if (is_error($idModule)) { if (is_error($idModule)) {
// TODO: Improve the error returning more info. // TODO: Improve the error returning more info
returnError('error_create_network_module', __('Error in creation network module.')); returnError('error_create_network_module', __('Error in creation network module.'));
} else { } else {
returnData('string', ['type' => 'string', 'data' => $idModule]); returnData('string', ['type' => 'string', 'data' => $idModule]);
@ -3238,7 +3222,6 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3)
'critical_inverse', 'critical_inverse',
'warning_inverse', 'warning_inverse',
'policy_linked', 'policy_linked',
'ff_type',
]; ];
$values = []; $values = [];
@ -3343,23 +3326,22 @@ function api_set_create_plugin_module($id, $thrash1, $other, $thrash3)
'min_ff_event_critical' => $other['data'][32], 'min_ff_event_critical' => $other['data'][32],
'critical_inverse' => $other['data'][33], 'critical_inverse' => $other['data'][33],
'warning_inverse' => $other['data'][34], 'warning_inverse' => $other['data'][34],
'ff_type' => $other['data'][35],
]; ];
if (! $values['descripcion']) { if (! $values['descripcion']) {
$values['descripcion'] = ''; $values['descripcion'] = '';
// Column 'descripcion' cannot be null. // Column 'descripcion' cannot be null
} }
if (! $values['module_macros']) { if (! $values['module_macros']) {
$values['module_macros'] = ''; $values['module_macros'] = '';
// Column 'module_macros' cannot be null. // Column 'module_macros' cannot be null
} }
$idModule = modules_create_agent_module($idAgent, $name, $values, true); $idModule = modules_create_agent_module($idAgent, $name, $values, true);
if (is_error($idModule)) { if (is_error($idModule)) {
// TODO: Improve the error returning more info. // TODO: Improve the error returning more info
returnError('error_create_plugin_module', __('Error in creation plugin module.')); returnError('error_create_plugin_module', __('Error in creation plugin module.'));
} else { } else {
returnData('string', ['type' => 'string', 'data' => $idModule]); returnData('string', ['type' => 'string', 'data' => $idModule]);
@ -3405,7 +3387,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3)
return; return;
} }
// If we want to change the module to a new agent. // If we want to change the module to a new agent
if ($other['data'][0] != '') { if ($other['data'][0] != '') {
if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) {
return; return;
@ -3422,7 +3404,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3)
} }
} }
// Check if agent exists. // Check if agent exists
$check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]);
if (!$check_id_agent) { if (!$check_id_agent) {
returnError('error_update_data_module', __('Error updating plugin module. Id_agent doesn\'t exist.')); returnError('error_update_data_module', __('Error updating plugin module. Id_agent doesn\'t exist.'));
@ -3466,7 +3448,6 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3)
'critical_inverse', 'critical_inverse',
'warning_inverse', 'warning_inverse',
'policy_linked', 'policy_linked',
'ff_type',
]; ];
$values = []; $values = [];
@ -3565,23 +3546,22 @@ function api_set_create_data_module($id, $thrash1, $other, $thrash3)
'ff_timeout' => $other['data'][23], 'ff_timeout' => $other['data'][23],
'critical_inverse' => $other['data'][24], 'critical_inverse' => $other['data'][24],
'warning_inverse' => $other['data'][25], 'warning_inverse' => $other['data'][25],
'ff_type' => $other['data'][26],
]; ];
if (! $values['descripcion']) { if (! $values['descripcion']) {
$values['descripcion'] = ''; $values['descripcion'] = '';
// Column 'descripcion' cannot be null. // Column 'descripcion' cannot be null
} }
if (! $values['module_macros']) { if (! $values['module_macros']) {
$values['module_macros'] = ''; $values['module_macros'] = '';
// Column 'module_macros' cannot be null. // Column 'module_macros' cannot be null
} }
$idModule = modules_create_agent_module($idAgent, $name, $values, true); $idModule = modules_create_agent_module($idAgent, $name, $values, true);
if (is_error($idModule)) { if (is_error($idModule)) {
// TODO: Improve the error returning more info. // TODO: Improve the error returning more info
returnError('error_create_data_module', __('Error in creation data module.')); returnError('error_create_data_module', __('Error in creation data module.'));
} else { } else {
returnData('string', ['type' => 'string', 'data' => $idModule]); returnData('string', ['type' => 'string', 'data' => $idModule]);
@ -3838,7 +3818,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3)
return; return;
} }
// If we want to change the module to a new agent. // If we want to change the module to a new agent
if ($other['data'][0] != '') { if ($other['data'][0] != '') {
if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) {
return; return;
@ -3855,7 +3835,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3)
} }
} }
// Check if agent exists. // Check if agent exists
$check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]);
if (!$check_id_agent) { if (!$check_id_agent) {
returnError('error_update_data_module', __('Error updating data module. Id_agent doesn\'t exist.')); returnError('error_update_data_module', __('Error updating data module. Id_agent doesn\'t exist.'));
@ -3890,7 +3870,6 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3)
'critical_inverse', 'critical_inverse',
'warning_inverse', 'warning_inverse',
'policy_linked', 'policy_linked',
'ff_type',
]; ];
$values = []; $values = [];
@ -3968,7 +3947,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3)
$disabled_types_event[EVENTS_GOING_UNKNOWN] = (int) !$other['data'][27]; $disabled_types_event[EVENTS_GOING_UNKNOWN] = (int) !$other['data'][27];
$disabled_types_event = json_encode($disabled_types_event); $disabled_types_event = json_encode($disabled_types_event);
// SNMP version 3. // SNMP version 3
if ($other['data'][14] == '3') { if ($other['data'][14] == '3') {
if ($other['data'][23] != 'AES' and $other['data'][23] != 'DES') { if ($other['data'][23] != 'AES' and $other['data'][23] != 'DES') {
returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_priv_method doesn\'t exist. Set it to \'AES\' or \'DES\'. ')); returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_priv_method doesn\'t exist. Set it to \'AES\' or \'DES\'. '));
@ -4021,7 +4000,6 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3)
'min_ff_event_normal' => $other['data'][31], 'min_ff_event_normal' => $other['data'][31],
'min_ff_event_warning' => $other['data'][32], 'min_ff_event_warning' => $other['data'][32],
'min_ff_event_critical' => $other['data'][33], 'min_ff_event_critical' => $other['data'][33],
'ff_type' => $other['data'][34],
]; ];
} else { } else {
$values = [ $values = [
@ -4054,19 +4032,18 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3)
'min_ff_event_normal' => $other['data'][25], 'min_ff_event_normal' => $other['data'][25],
'min_ff_event_warning' => $other['data'][26], 'min_ff_event_warning' => $other['data'][26],
'min_ff_event_critical' => $other['data'][27], 'min_ff_event_critical' => $other['data'][27],
'ff_type' => $other['data'][28],
]; ];
} }
if (! $values['descripcion']) { if (! $values['descripcion']) {
$values['descripcion'] = ''; $values['descripcion'] = '';
// Column 'descripcion' cannot be null. // Column 'descripcion' cannot be null
} }
$idModule = modules_create_agent_module($idAgent, $name, $values, true); $idModule = modules_create_agent_module($idAgent, $name, $values, true);
if (is_error($idModule)) { if (is_error($idModule)) {
// TODO: Improve the error returning more info. // TODO: Improve the error returning more info
returnError('error_create_snmp_module', __('Error in creation SNMP module.')); returnError('error_create_snmp_module', __('Error in creation SNMP module.'));
} else { } else {
returnData('string', ['type' => 'string', 'data' => $idModule]); returnData('string', ['type' => 'string', 'data' => $idModule]);
@ -4114,7 +4091,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
return; return;
} }
// If we want to change the module to a new agent. // If we want to change the module to a new agent
if ($other['data'][0] != '') { if ($other['data'][0] != '') {
if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) {
return; return;
@ -4131,7 +4108,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
} }
} }
// Check if agent exists. // Check if agent exists
$check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]);
if (!$check_id_agent) { if (!$check_id_agent) {
returnError('error_update_data_module', __('Error updating snmp module. Id_agent doesn\'t exist.')); returnError('error_update_data_module', __('Error updating snmp module. Id_agent doesn\'t exist.'));
@ -4139,7 +4116,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
} }
} }
// SNMP version 3. // SNMP version 3
if ($other['data'][13] == '3') { if ($other['data'][13] == '3') {
if ($other['data'][22] != 'AES' and $other['data'][22] != 'DES') { if ($other['data'][22] != 'AES' and $other['data'][22] != 'DES') {
returnError( returnError(
@ -4203,7 +4180,6 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
'min_ff_event_warning', 'min_ff_event_warning',
'min_ff_event_critical', 'min_ff_event_critical',
'policy_linked', 'policy_linked',
'ff_type',
]; ];
} else { } else {
$snmp_module_fields = [ $snmp_module_fields = [
@ -4235,7 +4211,6 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
'min_ff_event_warning', 'min_ff_event_warning',
'min_ff_event_critical', 'min_ff_event_critical',
'policy_linked', 'policy_linked',
'ff_type',
]; ];
} }
@ -4333,7 +4308,6 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2)
'min_ff_event_normal' => $other['data'][20], 'min_ff_event_normal' => $other['data'][20],
'min_ff_event_warning' => $other['data'][21], 'min_ff_event_warning' => $other['data'][21],
'min_ff_event_critical' => $other['data'][22], 'min_ff_event_critical' => $other['data'][22],
'ff_type' => $other['data'][23],
]; ];
$name_check = db_get_value('name', 'tnetwork_component', 'name', $id); $name_check = db_get_value('name', 'tnetwork_component', 'name', $id);
@ -4434,7 +4408,6 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2)
'min_ff_event_normal' => $other['data'][24], 'min_ff_event_normal' => $other['data'][24],
'min_ff_event_warning' => $other['data'][25], 'min_ff_event_warning' => $other['data'][25],
'min_ff_event_critical' => $other['data'][26], 'min_ff_event_critical' => $other['data'][26],
'ff_type' => $other['data'][27],
]; ];
$name_check = db_get_value('name', 'tnetwork_component', 'name', $id); $name_check = db_get_value('name', 'tnetwork_component', 'name', $id);
@ -4570,7 +4543,6 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2)
'min_ff_event_normal' => $other['data'][29], 'min_ff_event_normal' => $other['data'][29],
'min_ff_event_warning' => $other['data'][30], 'min_ff_event_warning' => $other['data'][30],
'min_ff_event_critical' => $other['data'][31], 'min_ff_event_critical' => $other['data'][31],
'ff_type' => $other['data'][32],
]; ];
} else { } else {
$values = [ $values = [
@ -4602,7 +4574,6 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2)
'min_ff_event_normal' => $other['data'][25], 'min_ff_event_normal' => $other['data'][25],
'min_ff_event_warning' => $other['data'][26], 'min_ff_event_warning' => $other['data'][26],
'min_ff_event_critical' => $other['data'][27], 'min_ff_event_critical' => $other['data'][27],
'ff_type' => $other['data'][28],
]; ];
} }
@ -4683,7 +4654,6 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2)
'min_ff_event_warning' => $other['data'][8], 'min_ff_event_warning' => $other['data'][8],
'min_ff_event_critical' => $other['data'][9], 'min_ff_event_critical' => $other['data'][9],
'ff_timeout' => $other['data'][10], 'ff_timeout' => $other['data'][10],
'ff_type' => $other['data'][11],
]; ];
$name_check = enterprise_hook( $name_check = enterprise_hook(
@ -6439,7 +6409,6 @@ function api_set_add_data_module_policy($id, $thrash1, $other, $thrash3)
$values['min_ff_event_warning'] = $other['data'][21]; $values['min_ff_event_warning'] = $other['data'][21];
$values['min_ff_event_critical'] = $other['data'][22]; $values['min_ff_event_critical'] = $other['data'][22];
$values['ff_timeout'] = $other['data'][23]; $values['ff_timeout'] = $other['data'][23];
$values['ff_type'] = $other['data'][24];
if ($name_module_policy !== false) { if ($name_module_policy !== false) {
if ($name_module_policy[0]['name'] == $other['data'][0]) { if ($name_module_policy[0]['name'] == $other['data'][0]) {
@ -6681,7 +6650,6 @@ function api_set_add_network_module_policy($id, $thrash1, $other, $thrash3)
$values['min_ff_event_normal'] = $other['data'][24]; $values['min_ff_event_normal'] = $other['data'][24];
$values['min_ff_event_warning'] = $other['data'][25]; $values['min_ff_event_warning'] = $other['data'][25];
$values['min_ff_event_critical'] = $other['data'][26]; $values['min_ff_event_critical'] = $other['data'][26];
$values['ff_type'] = $other['data'][27];
if ($name_module_policy !== false) { if ($name_module_policy !== false) {
if ($name_module_policy[0]['name'] == $other['data'][0]) { if ($name_module_policy[0]['name'] == $other['data'][0]) {
@ -6891,7 +6859,6 @@ function api_set_add_plugin_module_policy($id, $thrash1, $other, $thrash3)
$values['min_ff_event_normal'] = $other['data'][29]; $values['min_ff_event_normal'] = $other['data'][29];
$values['min_ff_event_warning'] = $other['data'][30]; $values['min_ff_event_warning'] = $other['data'][30];
$values['min_ff_event_critical'] = $other['data'][31]; $values['min_ff_event_critical'] = $other['data'][31];
$values['ff_type'] = $other['data'][32];
if ($name_module_policy !== false) { if ($name_module_policy !== false) {
if ($name_module_policy[0]['name'] == $other['data'][0]) { if ($name_module_policy[0]['name'] == $other['data'][0]) {
@ -7309,7 +7276,6 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3)
'min_ff_event_normal' => $other['data'][30], 'min_ff_event_normal' => $other['data'][30],
'min_ff_event_warning' => $other['data'][31], 'min_ff_event_warning' => $other['data'][31],
'min_ff_event_critical' => $other['data'][32], 'min_ff_event_critical' => $other['data'][32],
'ff_type' => $other['data'][33],
]; ];
} else { } else {
$values = [ $values = [
@ -7339,7 +7305,6 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3)
'min_ff_event_normal' => $other['data'][24], 'min_ff_event_normal' => $other['data'][24],
'min_ff_event_warning' => $other['data'][25], 'min_ff_event_warning' => $other['data'][25],
'min_ff_event_critical' => $other['data'][26], 'min_ff_event_critical' => $other['data'][26],
'ff_type' => $other['data'][27],
]; ];
} }
@ -8829,14 +8794,7 @@ function api_set_alert_actions($id, $id2, $other, $trash1)
} }
$firesMin = $other['data'][2]; $firesMin = $other['data'][2];
if (!$firesMin) {
$firesMin = 0;
}
$firesMax = $other['data'][3]; $firesMax = $other['data'][3];
if (!$firesMax) {
$firesMax = 0;
}
$values = [ $values = [
'id_alert_template_module' => $idAlertTemplateModule, 'id_alert_template_module' => $idAlertTemplateModule,
@ -13311,7 +13269,6 @@ function api_set_apply_module_template($id_template, $id_agent, $thrash3, $thras
'min_ff_event_normal' => $row2['min_ff_event_normal'], 'min_ff_event_normal' => $row2['min_ff_event_normal'],
'min_ff_event_warning' => $row2['min_ff_event_warning'], 'min_ff_event_warning' => $row2['min_ff_event_warning'],
'min_ff_event_critical' => $row2['min_ff_event_critical'], 'min_ff_event_critical' => $row2['min_ff_event_critical'],
'ff_type' => $row2['ff_type'],
]; ];
$name = $row2['name']; $name = $row2['name'];

View File

@ -1987,9 +1987,9 @@ function events_page_responses($event, $childrens_ids=[])
$table_responses->width = '100%'; $table_responses->width = '100%';
$table_responses->data = []; $table_responses->data = [];
$table_responses->head = []; $table_responses->head = [];
$table_responses->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table_responses->style[0] = 'height:30px';
$table_responses->style[1] = 'text-align: left; height: 23px; text-align: right;'; $table_responses->style[2] = 'text-align:right;';
$table_responses->class = 'alternate rounded_cells'; $table_responses->class = 'events_show_more_table';
if (tags_checks_event_acl($config['id_user'], $event['id_grupo'], 'EM', $event['clean_tags'], $childrens_ids)) { if (tags_checks_event_acl($config['id_user'], $event['id_grupo'], 'EM', $event['clean_tags'], $childrens_ids)) {
// Owner. // Owner.
@ -2056,7 +2056,7 @@ function events_page_responses($event, $childrens_ids=[])
-1, -1,
true true
); );
$data[1] .= html_print_button( $data[2] .= html_print_button(
__('Update'), __('Update'),
'owner_button', 'owner_button',
false, false,
@ -2136,7 +2136,7 @@ function events_page_responses($event, $childrens_ids=[])
); );
if (!$status_blocked) { if (!$status_blocked) {
$data[1] .= html_print_button( $data[2] .= html_print_button(
__('Update'), __('Update'),
'status_button', 'status_button',
false, false,
@ -2151,7 +2151,8 @@ function events_page_responses($event, $childrens_ids=[])
// Comments. // Comments.
$data = []; $data = [];
$data[0] = __('Comment'); $data[0] = __('Comment');
$data[1] = html_print_button( $data[1] = '';
$data[2] = html_print_button(
__('Add comment'), __('Add comment'),
'comment_button', 'comment_button',
false, false,
@ -2173,8 +2174,9 @@ function events_page_responses($event, $childrens_ids=[])
// Delete. // Delete.
$data = []; $data = [];
$data[0] = __('Delete event'); $data[0] = __('Delete event');
$data[1] = '<form method="post">'; $data[1] = '';
$data[1] .= html_print_button( $data[2] = '<form method="post">';
$data[2] .= html_print_button(
__('Delete event'), __('Delete event'),
'delete_button', 'delete_button',
false, false,
@ -2182,13 +2184,13 @@ function events_page_responses($event, $childrens_ids=[])
'class="sub cancel"', 'class="sub cancel"',
true true
); );
$data[1] .= html_print_input_hidden('delete', 1, true); $data[2] .= html_print_input_hidden('delete', 1, true);
$data[1] .= html_print_input_hidden( $data[2] .= html_print_input_hidden(
'validate_ids', 'validate_ids',
$event['id_evento'], $event['id_evento'],
true true
); );
$data[1] .= '</form>'; $data[2] .= '</form>';
$table_responses->data[] = $data; $table_responses->data[] = $data;
} }
@ -2229,7 +2231,7 @@ function events_page_responses($event, $childrens_ids=[])
$server_id = 0; $server_id = 0;
} }
$data[1] .= html_print_button( $data[2] .= html_print_button(
__('Execute'), __('Execute'),
'custom_response_button', 'custom_response_button',
false, false,
@ -2249,14 +2251,14 @@ function events_page_responses($event, $childrens_ids=[])
$('.params_rows').remove(); $('.params_rows').remove();
$('#responses_table') $('#responses_table')
.append('<tr class=\"params_rows\"><td style=\"text-align:left; font-weight: bolder;\">".__('Description')."</td><td style=\"text-align:left;\">'+description+'</td></tr>'); .append('<tr class=\"params_rows\"><td>".__('Description')."</td><td style=\"text-align:left; height:30px;\" colspan=\"2\">'+description+'</td></tr>');
if (params.length == 1 && params[0] == '') { if (params.length == 1 && params[0] == '') {
return; return;
} }
$('#responses_table') $('#responses_table')
.append('<tr class=\"params_rows\"><td style=\"text-align:left; padding-left:20px;\" colspan=\"2\">".__('Parameters')."</td></tr>'); .append('<tr class=\"params_rows\"><td style=\"text-align:left; padding-left:20px; height:30px;\" colspan=\"3\">".__('Parameters')."</td></tr>');
for (i = 0; i < params.length; i++) { for (i = 0; i < params.length; i++) {
add_row_param('responses_table',params[i]); add_row_param('responses_table',params[i]);
@ -2521,9 +2523,7 @@ function events_page_custom_fields($event)
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table->class = 'events_show_more_table';
$table->style[1] = 'text-align: left; height: 23px;';
$table->class = 'alternate rounded_cells';
$all_customs_fields = (bool) check_acl( $all_customs_fields = (bool) check_acl(
$config['id_user'], $config['id_user'],
@ -2671,11 +2671,9 @@ function events_page_details($event, $server='')
$table_details->width = '100%'; $table_details->width = '100%';
$table_details->data = []; $table_details->data = [];
$table_details->head = []; $table_details->head = [];
$table_details->cellspacing = 2; $table_details->cellspacing = 0;
$table_details->cellpadding = 2; $table_details->cellpadding = 0;
$table_details->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table_details->class = 'events_show_more_table';
$table_details->style[1] = 'text-align: left; height: 23px;';
$table_details->class = 'alternate rounded_cells';
/* /*
* Useless switch. * Useless switch.
@ -2985,9 +2983,7 @@ function events_page_custom_data($event)
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->style[0] = 'width:35%; font-weight: bold; text-align: left;'; $table->class = 'events_show_more_table';
$table->style[1] = 'text-align: left;';
$table->class = 'alternate rounded_cells';
$json_custom_data = base64_decode($event['custom_data']); $json_custom_data = base64_decode($event['custom_data']);
$custom_data = json_decode($json_custom_data); $custom_data = json_decode($json_custom_data);
@ -3137,14 +3133,12 @@ function events_page_general($event)
// General. // General.
$table_general = new stdClass; $table_general = new stdClass;
$table_general->cellspacing = 2; $table_general->cellspacing = 0;
$table_general->cellpadding = 2; $table_general->cellpadding = 0;
$table_general->width = '100%'; $table_general->width = '100%';
$table_general->data = []; $table_general->data = [];
$table_general->head = []; $table_general->head = [];
$table_general->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table_general->class = 'events_show_more_table';
$table_general->style[1] = 'text-align: left; height: 23px;';
$table_general->class = 'alternate rounded_cells';
$data = []; $data = [];
$data[0] = __('Event ID'); $data[0] = __('Event ID');
@ -3185,10 +3179,12 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Type'); $data[0] = __('Type');
$data[1] = events_print_type_img( $data[1] = events_print_type_description($event['event_type'], true);
$data[2] = events_print_type_img(
$event['event_type'], $event['event_type'],
true true
).' '.events_print_type_description($event['event_type'], true); );
$table_general->data[] = $data; $table_general->data[] = $data;
$data = []; $data = [];
@ -3208,8 +3204,8 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Severity'); $data[0] = __('Severity');
$event_criticity = get_priority_name($event['criticity']); $event_criticity = get_priority_name($event['criticity']);
$data[1] = $event_criticity;
$data[1] = html_print_image( $data[2] = html_print_image(
$img_sev, $img_sev,
true, true,
[ [
@ -3219,7 +3215,6 @@ function events_page_general($event)
'title' => $event_criticity, 'title' => $event_criticity,
] ]
); );
$data[1] .= ' '.$event_criticity;
$table_general->data[] = $data; $table_general->data[] = $data;
// Get Status. // Get Status.
@ -3227,7 +3222,8 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Status'); $data[0] = __('Status');
$data[1] = html_print_image($event_st['img'], true).' '.$event_st['title']; $data[1] = $event_st['title'];
$data[2] = html_print_image($event_st['img'], true);
$table_general->data[] = $data; $table_general->data[] = $data;
// If event is validated, show who and when acknowleded it. // If event is validated, show who and when acknowleded it.
@ -3250,12 +3246,11 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Group'); $data[0] = __('Group');
$data[1] = ''; $data[1] = groups_get_name($event['id_grupo']);
if (!$config['show_group_name']) { if (!$config['show_group_name']) {
$data[1] = ui_print_group_icon($event['id_grupo'], true); $data[2] = ui_print_group_icon($event['id_grupo'], true);
} }
$data[1] .= groups_get_name($event['id_grupo']);
$table_general->data[] = $data; $table_general->data[] = $data;
$data = []; $data = [];
@ -3293,6 +3288,16 @@ function events_page_general($event)
$table_general->data[] = $data; $table_general->data[] = $data;
$table_data = $table_general->data;
$table_data_total = count($table_data);
for ($i = 0; $i <= $table_data_total; $i++) {
if (count($table_data[$i]) == 2) {
$table_general->colspan[$i][1] = 2;
$table_general->style[2] = 'text-align:center; width:10%;';
}
}
$general = '<div id="extended_event_general_page" class="extended_event_pages">'.html_print_table($table_general, true).'</div>'; $general = '<div id="extended_event_general_page" class="extended_event_pages">'.html_print_table($table_general, true).'</div>';
return $general; return $general;
@ -3316,9 +3321,7 @@ function events_page_comments($event, $childrens_ids=[])
$table_comments->width = '100%'; $table_comments->width = '100%';
$table_comments->data = []; $table_comments->data = [];
$table_comments->head = []; $table_comments->head = [];
$table_comments->style[0] = 'width:35%; vertical-align: top; text-align: left;'; $table_comments->class = 'events_show_more_table';
$table_comments->style[1] = 'text-align: left;';
$table_comments->class = 'alternate rounded_cells';
$event_comments = $event['user_comment']; $event_comments = $event['user_comment'];
$event_comments = str_replace(["\n", '&#x0a;'], '<br>', $event_comments); $event_comments = str_replace(["\n", '&#x0a;'], '<br>', $event_comments);
@ -3423,9 +3426,9 @@ function events_page_comments($event, $childrens_ids=[])
$childrens_ids $childrens_ids
))) && $config['show_events_in_local'] == false || $config['event_replication'] == false ))) && $config['show_events_in_local'] == false || $config['event_replication'] == false
) { ) {
$comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea('comment', 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea('comment', 3, 10, '', 'style="min-height: 15px; padding:0; width: 100%; disabled"', true);
$comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'), 'comment_button', false, 'event_comment();', 'class="sub next"', true).'</div><br></div>'; $comments_form .= '<br><div style="text-align:right; margin-top:10px;">'.html_print_button(__('Add comment'), 'comment_button', false, 'event_comment();', 'class="sub next"', true).'</div><br></div>';
} else { } else {
$comments_form = ui_print_message( $comments_form = ui_print_message(
__('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.') __('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')

View File

@ -120,18 +120,13 @@ if (!function_exists('mime_content_type')) {
global $config; global $config;
if (isset($config['homedir_filemanager'])) {
$homedir_filemanager = trim(io_safe_output($config['homedir_filemanager']));
} else {
$homedir_filemanager = trim($config['homedir']);
}
$homedir_filemanager = trim($config['homedir']);
$sec2 = get_parameter('sec2'); $sec2 = get_parameter('sec2');
if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') {
$homedir_filemanager .= '/attachment/collection/'; $homedir_filemanager .= '/attachment/collection/';
} }
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip'); $upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
if ($upload_file_or_zip) { if ($upload_file_or_zip) {
@ -738,6 +733,7 @@ function filemanager_file_explorer(
$data[4] .= html_print_input_hidden('delete_file', 1, true); $data[4] .= html_print_input_hidden('delete_file', 1, true);
$relative_dir = str_replace($homedir_filemanager, '', str_replace('\\', '/', dirname($fileinfo['realpath']))); $relative_dir = str_replace($homedir_filemanager, '', str_replace('\\', '/', dirname($fileinfo['realpath'])));
if ($relative_dir[0] == '/') { if ($relative_dir[0] == '/') {
$relative_dir = substr($relative_dir, 1); $relative_dir = substr($relative_dir, 1);
} }

View File

@ -256,6 +256,7 @@ function grafico_modulo_sparse_data(
$array_data['sum'.$series_suffix]['agent_name'] = $data_module_graph['agent_name']; $array_data['sum'.$series_suffix]['agent_name'] = $data_module_graph['agent_name'];
$array_data['sum'.$series_suffix]['module_name'] = $data_module_graph['module_name']; $array_data['sum'.$series_suffix]['module_name'] = $data_module_graph['module_name'];
$array_data['sum'.$series_suffix]['agent_alias'] = $data_module_graph['agent_alias']; $array_data['sum'.$series_suffix]['agent_alias'] = $data_module_graph['agent_alias'];
$array_data['sum'.$series_suffix]['unit'] = $data_module_graph['unit'];
// This is for a specific type of report that consists in passing an interval and doing the average sum and avg. // This is for a specific type of report that consists in passing an interval and doing the average sum and avg.
if ($params['force_interval'] != '') { if ($params['force_interval'] != '') {
@ -759,6 +760,7 @@ function grafico_modulo_sparse($params)
$data_module_graph['c_min'] = $module_data['min_critical']; $data_module_graph['c_min'] = $module_data['min_critical'];
$data_module_graph['c_max'] = $module_data['max_critical']; $data_module_graph['c_max'] = $module_data['max_critical'];
$data_module_graph['c_inv'] = $module_data['critical_inverse']; $data_module_graph['c_inv'] = $module_data['critical_inverse'];
$data_module_graph['unit'] = $module_data['unit'];
} else { } else {
$data_module_graph = false; $data_module_graph = false;
} }
@ -1225,11 +1227,11 @@ function graphic_combined_module(
foreach ($sources as $source) { foreach ($sources as $source) {
array_push($modules, $source['id_agent_module']); array_push($modules, $source['id_agent_module']);
array_push($weights, $source['weight']); array_push($weights, $source['weight']);
if ($source['label'] != '') { if ($source['label'] != '' || $params_combined['labels']) {
$item['type'] = 'custom_graph'; $item['type'] = 'custom_graph';
$item['id_agent'] = agents_get_module_id($source['id_agent_module']); $item['id_agent'] = agents_get_module_id($source['id_agent_module']);
$item['id_agent_module'] = $source['id_agent_module']; $item['id_agent_module'] = $source['id_agent_module'];
$labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']); $labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($item, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
} }
} }
} }
@ -1357,6 +1359,7 @@ function graphic_combined_module(
$data_module_graph['c_max'] = $module_data['max_critical']; $data_module_graph['c_max'] = $module_data['max_critical'];
$data_module_graph['c_inv'] = $module_data['critical_inverse']; $data_module_graph['c_inv'] = $module_data['critical_inverse'];
$data_module_graph['module_id'] = $agent_module_id; $data_module_graph['module_id'] = $agent_module_id;
$data_module_graph['unit'] = $module_data['unit'];
// stract data // stract data
$array_data_module = grafico_modulo_sparse_data( $array_data_module = grafico_modulo_sparse_data(

View File

@ -1790,7 +1790,6 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
*/ */
function html_print_textarea($name, $rows, $columns, $value='', $attributes='', $return=false, $class='') function html_print_textarea($name, $rows, $columns, $value='', $attributes='', $return=false, $class='')
{ {
$output = '<textarea id="textarea_'.$name.'" name="'.$name.'" cols="'.$columns.'" rows="'.$rows.'" '.$attributes.'" class="'.$class.'">'; $output = '<textarea id="textarea_'.$name.'" name="'.$name.'" cols="'.$columns.'" rows="'.$rows.'" '.$attributes.'" class="'.$class.'">';
// $output .= io_safe_input ($value); // $output .= io_safe_input ($value);
$output .= ($value); $output .= ($value);

View File

@ -4439,6 +4439,9 @@ function reporting_value($report, $content, $type, $pdf=false)
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$return['agents'] = [$content['id_agent']];
$return['id_agent'] = $content['id_agent'];
$return['id_agent_module'] = $content['id_agent_module'];
$return['agent_name'] = $agent_name; $return['agent_name'] = $agent_name;
$return['module_name'] = $module_name; $return['module_name'] = $module_name;
@ -7267,6 +7270,7 @@ function reporting_custom_graph(
'modules_series' => $graphs[0]['modules_series'], 'modules_series' => $graphs[0]['modules_series'],
'id_graph' => $id_graph, 'id_graph' => $id_graph,
'type_report' => $type_report, 'type_report' => $type_report,
'labels' => $content['style']['label'],
]; ];
$return['chart'] = graphic_combined_module( $return['chart'] = graphic_combined_module(
@ -11659,7 +11663,7 @@ function reporting_translate_sla_status_for_graph($status)
* *
* @return html Return table of header. * @return html Return table of header.
*/ */
function reporting_header_table_for_pdf(string $title='', string $description='') function reporting_header_table_for_pdf($title='', $description='')
{ {
$result_pdf .= '<pagebreak>'; $result_pdf .= '<pagebreak>';
$result_pdf .= '<table class="header_table databox">'; $result_pdf .= '<table class="header_table databox">';

View File

@ -1026,11 +1026,9 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1046,7 +1044,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_agent']; $table1->data[0][0] = $item['chart']['by_agent'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1064,7 +1061,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_user_validator']; $table1->data[0][0] = $item['chart']['by_user_validator'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1082,7 +1078,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_criticity']; $table1->data[0][0] = $item['chart']['by_criticity'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1100,7 +1095,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; $table1->data[0][0] = $item['chart']['validated_vs_unvalidated'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1117,7 +1111,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
@ -1233,11 +1226,9 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1253,7 +1244,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_agent']; $table1->data[0][0] = $item['chart']['by_agent'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1271,7 +1261,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_user_validator']; $table1->data[0][0] = $item['chart']['by_user_validator'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1289,7 +1278,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_criticity']; $table1->data[0][0] = $item['chart']['by_criticity'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1307,7 +1295,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; $table1->data[0][0] = $item['chart']['validated_vs_unvalidated'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -1326,7 +1313,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
@ -2021,11 +2007,9 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -2042,7 +2026,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_user_validator']; $table1->data[0][0] = $item['chart']['by_user_validator'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -2060,7 +2043,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['by_criticity']; $table1->data[0][0] = $item['chart']['by_criticity'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -2078,7 +2060,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; $table1->data[0][0] = $item['chart']['validated_vs_unvalidated'];
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty';
$pdf_export .= html_print_table($table1, true); $pdf_export .= html_print_table($table1, true);
$pdf_export .= '<br>'; $pdf_export .= '<br>';
} else { } else {
@ -2095,7 +2076,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
if ($pdf) { if ($pdf) {
$table0 = new stdClass(); $table0 = new stdClass();
$table0->width = '99%'; $table0->width = '99%';
$table0->class = 'table-beauty';
$table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events'];
$pdf_export = html_print_table($table0, true); $pdf_export = html_print_table($table0, true);
@ -2438,7 +2418,7 @@ function reporting_html_alert_report($table, $item, $pdf=0)
$table->data['alerts']['cell'] = html_print_table($table1, true); $table->data['alerts']['cell'] = html_print_table($table1, true);
if ($pdf) { if ($pdf) {
$table1->class = 'table-beauty pdf_alert_table'; $table1->class = 'pdf_alert_table';
return html_print_table($table1, true); return html_print_table($table1, true);
} }
} }
@ -4937,7 +4917,7 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
if ($for_pdf) { if ($for_pdf) {
$table->titlestyle = 'background: #373737; color: #FFF; display: table-cell; font-size: 12px; border: 1px solid grey'; $table->titlestyle = 'background: #373737; color: #FFF; display: table-cell; font-size: 12px; border: 1px solid grey';
$table->class = 'table_sla table_beauty'; $table->class = 'table_sla';
for ($i = 0; $i < count($table->head); $i++) { for ($i = 0; $i < count($table->head); $i++) {
$table->headstyle[$i] = 'background: #666; color: #FFF; display: table-cell; font-size: 11px; border: 1px solid grey'; $table->headstyle[$i] = 'background: #666; color: #FFF; display: table-cell; font-size: 11px; border: 1px solid grey';

View File

@ -365,9 +365,9 @@ function get_event_name(event_id, meta, history) {
function add_row_param(id_table, param) { function add_row_param(id_table, param) {
$("#" + id_table).append( $("#" + id_table).append(
'<tr class="params_rows"><td style="text-align:left; padding-left:40px;">' + '<tr class="params_rows"><td style="text-align:left; padding-left:40px; font-weight: normal; font-style: italic;">' +
param + param +
'</td><td style="text-align:left"><input type="text" name="' + '</td><td style="text-align:left" colspan="2"><input type="text" name="' +
param + param +
'" id="' + '" id="' +
param + param +

View File

@ -747,9 +747,11 @@ var TreeController = {
} }
} else { } else {
try { try {
winopeng( winopeng_var(
element.moduleGraph.url, element.moduleGraph.url,
element.moduleGraph.handle element.moduleGraph.handle,
1000,
650
); );
} catch (error) { } catch (error) {
// console.log(error); // console.log(error);

View File

@ -3598,6 +3598,78 @@ div.simple_value > a > span.text p {
cursor: pointer; cursor: pointer;
} }
.events_show_more_table {
border-spacing: 0px;
text-align: left;
}
/* Modal window - Show More */
table.events_show_more_table tr:nth-child(odd) td {
background-color: #ffffff;
}
table.events_show_more_table tr:nth-child(even) td {
background-color: #f5f5f5;
border-top: 1px solid #cacaca;
border-bottom: 1px solid #cacaca;
}
table.events_show_more_table tr td {
height: 22px;
padding: 4px;
}
table.events_show_more_table tr td:first-child {
width: 35%;
font-weight: bold;
padding-left: 20px;
}
ul.events_tabs {
background: #ffffff !important;
border: 0px;
display: flex;
justify-content: space-between;
padding: 0px !important;
}
ul.events_tabs:before,
ul.events_tabs:after {
content: none !important;
}
ul.events_tabs > li {
margin: 0 !important;
width: 20%;
text-align: center;
float: none !important;
outline-width: 0;
}
ul.events_tabs > li.ui-state-default {
background: #fff !important;
border: none !important;
border-bottom: 2px solid black !important;
}
ul.events_tabs > li a {
text-align: center;
float: none !important;
padding: 8px !important;
display: block;
}
ul.events_tabs > li span {
position: relative;
top: -6px;
left: 5px;
margin-right: 10px;
}
ul.events_tabs > li.ui-tabs-active {
border-bottom: 2px solid #82b92e !important;
border-top: 2px solid #82b92e !important;
}
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* - modal window and edit user - * - modal window and edit user -
@ -5438,3 +5510,48 @@ table.info_table.policy_sub_table {
margin-top: 0px; margin-top: 0px;
align-items: flex-start; align-items: flex-start;
} }
/*
* ---------------------------------------------------------------------
* - MODULE GRAPHS
* ---------------------------------------------------------------------
*/
.module_graph_menu_dropdown {
padding-top: 20px;
padding-bottom: 20px;
position: absolute;
top: 10px;
width: 100%;
z-index: 1001;
}
.module_graph_menu_content,
.module_graph_menu_header {
width: 92%;
border: 1px solid #e2e2e2;
margin: 0 auto;
box-sizing: border-box;
background-color: #fff;
}
.module_graph_menu_header {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
padding: 6px 10px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
}
.module_graph_menu_header span > img {
vertical-align: middle;
padding-left: 5px;
}
.module_graph_menu_content {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 15px;
border-top: none;
}

View File

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

View File

@ -96,7 +96,7 @@ if ($refresh > 0) {
--> -->
</script> </script>
</head> </head>
<body bgcolor="#ffffff" style='background:#ffffff;'> <body style='background:#ffffff;'>
<?php <?php
// ACL // ACL
$all_groups = agents_get_all_groups_agent($agent_id); $all_groups = agents_get_all_groups_agent($agent_id);
@ -136,7 +136,8 @@ if ($date > $now) {
$urlImage = ui_get_full_url(false); $urlImage = ui_get_full_url(false);
echo '<div style="margin-left: 70px; padding-top: 10px;">'; // Graph.
echo '<div style="padding-top:80px;">';
$height = 400; $height = 400;
$width = '90%'; $width = '90%';
@ -177,27 +178,14 @@ if ($date > $now) {
echo '</div>'; echo '</div>';
//
// SIDE MENU
//
$side_layer_params = [];
// TOP TEXT
$side_layer_params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>".html_print_image('/images/config.disabled.png', true, ['width' => '16px'], false, false, false, true).' '.__('Graph configuration menu').'</div>';
$side_layer_params['body_text'] = "<div class='menu_sidebar_outer'>";
$side_layer_params['body_text'] .= __('Please, make your changes and apply with the <i>Reload</i> button');
// MENU
$side_layer_params['body_text'] .= '<form method="get" action="interface_traffic_graph_win.php">';
$side_layer_params['body_text'] .= html_print_input_hidden('params', base64_encode($params_json), true);
// FORM TABLE // FORM TABLE
$table = html_get_predefined_table('transparent', 2); $table = html_get_predefined_table('transparent', 2);
$table->width = '98%'; $table->width = '100%';
$table->id = 'stat_win_form_div'; $table->id = 'stat_win_form_div';
$table->style[0] = 'text-align:left; padding: 7px;'; $table->style[0] = 'text-align:left;';
$table->style[1] = 'text-align:left;'; $table->style[1] = 'text-align:left;';
$table->styleTable = 'border-spacing: 4px;'; $table->styleTable = 'margin-bottom: 20px;';
$table->class = 'alternate'; $table->class = 'events_show_more_table';
$data = []; $data = [];
$data[0] = __('Refresh time'); $data[0] = __('Refresh time');
@ -255,40 +243,32 @@ if ($date > $now) {
$table->rowclass[] = ''; $table->rowclass[] = '';
$form_table = html_print_table($table, true); $form_table = html_print_table($table, true);
$form_table .= '<div style="width:100%; text-align:right;">'.html_print_submit_button(
__('Reload'),
'submit',
false,
'class="sub upd"',
true
).'</div>';
unset($table);
$table->id = 'stat_win_form'; // Menu.
$table->width = '100%'; $menu_form = "<form method='get' action='interface_traffic_graph_win.php'>".html_print_input_hidden('params', base64_encode($params_json), true);
$table->cellspacing = 2;
$table->cellpadding = 2;
$table->class = 'databox';
$data = []; if (!empty($server_id)) {
$data[0] = html_print_div(['content' => $form_table, 'style' => 'overflow: auto; height: 220px'], true); $menu_form .= html_print_input_hidden('server', $server_id, true);
$table->data[] = $data; }
$table->rowclass[] = '';
$data = []; echo $menu_form;
$data[0] = '<div style="width:100%; text-align:right;">'.html_print_submit_button(__('Reload'), 'submit', false, 'class="sub upd"', true).'</div>'; echo '<div class="module_graph_menu_dropdown">
$table->data[] = $data; <div id="module_graph_menu_header" class="module_graph_menu_header">
$table->rowclass[] = ''; '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
$side_layer_params['body_text'] .= html_print_table($table, true); '.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
$side_layer_params['body_text'] .= '</form>'; </div>
$side_layer_params['body_text'] .= '</div>'; <div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
// outer </div>';
// ICONS echo '</form>';
$side_layer_params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
$side_layer_params['icon_open'] = '/images/graphmenu_arrow.png';
// SIZE
$side_layer_params['width'] = 500;
// POSITION
$side_layer_params['position'] = 'left';
html_print_side_layer($side_layer_params);
// Hidden div to forced title // Hidden div to forced title
html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]); html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
@ -341,4 +321,22 @@ ui_include_time_picker(true);
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]); $.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
forced_title_callback(); forced_title_callback();
// Menu.
$('#module_graph_menu_header').on('click', function(){
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
var arrow_up = 'arrow_up_green';
var arrow_down = 'arrow_down_green';
if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){
$('.module_graph_menu_content').show();
$('.module_graph_menu_content').removeClass('module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
}
else{
$('.module_graph_menu_content').hide();
$('.module_graph_menu_content').addClass('module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
}
});
</script> </script>

View File

@ -89,7 +89,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
}; };
</script> </script>
</head> </head>
<body bgcolor="#ffffff" style='background:#ffffff;'> <body style='background:#ffffff;'>
<?php <?php
echo "<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>"; echo "<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>";
@ -175,8 +175,9 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
echo '<div style="margin-left: 65px; padding-top: 10px;">';
// Graph.
echo '<div style="padding-top: 60px;">';
$width = '90%'; $width = '90%';
$height = '450'; $height = '450';
@ -228,39 +229,16 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
echo '</div>'; echo '</div>';
//
// SIDE MENU
//
$params = [];
// TOP TEXT
// Use the no_meta parameter because this image is only in the base console
$params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>".html_print_image('images/wrench_blanco.png', true, ['width' => '16px'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_w.png', true).'</div>';
$params['body_text'] = "<div class='menu_sidebar_outer'>";
$params['body_text'] .= __('Please, make your changes and apply with the <i>Reload</i> button');
// MENU
$params['body_text'] .= '<form method="get" action="stat_win.php">';
$params['body_text'] .= html_print_input_hidden('id', $id, true);
$params['body_text'] .= html_print_input_hidden('label', $label, true);
if (!empty($server_id)) { // FORM TABLE.
$params['body_text'] .= html_print_input_hidden('server', $server_id, true);
}
if (isset($_GET['type'])) {
$type = get_parameter_get('type');
$params['body_text'] .= html_print_input_hidden('type', $type, true);
}
// FORM TABLE
$table = html_get_predefined_table('transparent', 2); $table = html_get_predefined_table('transparent', 2);
$table->width = '98%'; $table->width = '100%';
$table->id = 'stat_win_form_div'; $table->id = 'stat_win_form_div';
$table->style[0] = 'text-align:left; padding: 7px;'; $table->style[0] = 'text-align:left;';
$table->style[1] = 'text-align:left;'; $table->style[1] = 'text-align:left;';
// $table->size[0] = '50%'; $table->styleTable = 'margin-bottom: 20px;';
$table->styleTable = 'border-spacing: 4px;'; $table->class = 'events_show_more_table';
$table->class = 'alternate';
$data = []; $data = [];
$data[0] = __('Refresh time'); $data[0] = __('Refresh time');
@ -407,42 +385,29 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
true true
).'</div>'; ).'</div>';
unset($table);
$table = new stdClass(); // Menu.
$table->id = 'stat_win_form'; $menu_form = "<form method='get' action='stat_win.php'>".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true);
$table->width = '100%';
$table->cellspacing = 2;
$table->cellpadding = 2;
$table->class = 'databox';
$data = []; if (!empty($server_id)) {
$data[0] = html_print_div( $menu_form .= html_print_input_hidden('server', $server_id, true);
[ }
'id' => 'field_list',
'content' => $form_table,
'style' => 'overflow: auto; height: 220px',
],
true
);
$table->data[] = $data;
$table->rowclass[] = '';
$params['body_text'] .= html_print_table($table, true); if (isset($_GET['type'])) {
$params['body_text'] .= '</form>'; $type = get_parameter_get('type');
$params['body_text'] .= '</div>'; $menu_form .= html_print_input_hidden('type', $type, true);
// outer }
// ICONS
$params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
$params['icon_open'] = '/images/graphmenu_arrow.png';
// SIZE echo $menu_form;
$params['width'] = 500; echo '<div class="module_graph_menu_dropdown">
<div id="module_graph_menu_header" class="module_graph_menu_header">
// POSITION '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
$params['position'] = 'left'; <span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
html_print_side_layer($params); </div>
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
</div>';
echo '</form>';
// Hidden div to forced title // Hidden div to forced title
html_print_div( html_print_div(
@ -491,11 +456,21 @@ ui_include_time_picker(true);
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]); $.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
$(window).ready(function() { // Menu.
$("#field_list").css('height', ($(window).height() - 160) + 'px'); $('#module_graph_menu_header').on('click', function(){
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
var arrow_up = 'arrow_up_green';
var arrow_down = 'arrow_down_green';
if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){
$('.module_graph_menu_content').show();
$('.module_graph_menu_content').removeClass('module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
}
else{
$('.module_graph_menu_content').hide();
$('.module_graph_menu_content').addClass('module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
}
}); });
$(window).resize(function() {
$("#field_list").css('height', ($(document).height() - 160) + 'px');
});
</script> </script>

View File

@ -896,7 +896,7 @@ if ($group_rep == 2) {
// Checkbox // Checkbox
$data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true); $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true);
} else if (isset($table->header[$i]) || true) { } else if (isset($table->header[$i]) || true) {
$data[$i] = ''; $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true);
} }
} }

View File

@ -69,9 +69,6 @@ $real_directory = realpath($config['homedir'].'/'.$directory);
ui_print_info_message(__('MIB files will be installed on the system. Please note that a MIB may depend on other MIB. To customize trap definitions use the SNMP trap editor.')); ui_print_info_message(__('MIB files will be installed on the system. Please note that a MIB may depend on other MIB. To customize trap definitions use the SNMP trap editor.'));
// echo '<h4>' . __('Index of %s', $directory) . '</h4>';
$homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false;
filemanager_file_explorer( filemanager_file_explorer(
$real_directory, $real_directory,
$directory, $directory,
@ -82,5 +79,5 @@ filemanager_file_explorer(
'', '',
false, false,
'', '',
$homedir_filemanager false
); );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1158,7 +1158,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0,''),(2,'De
INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','',''),(2,'critical','Critical&#x20;modules','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','',''),(5,'configuration','','','',''); INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','',''),(2,'critical','Critical&#x20;modules','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','',''),(5,'configuration','','','','');
INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,'',0),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,'',0),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'',0),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'',0); INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,'',0),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'',0),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'',0);
INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', '');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.734-190508 Version: 7.0NG.734-190510
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -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.734"; my $pandora_version = "7.0NG.734";
my $pandora_build = "190508"; my $pandora_build = "190510";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -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.734"; my $pandora_version = "7.0NG.734";
my $pandora_build = "190508"; my $pandora_build = "190510";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.734 %define version 7.0NG.734
%define release 190508 %define release 190510
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.734" PI_VERSION="7.0NG.734"
PI_BUILD="190508" PI_BUILD="190510"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -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.734 PS190508"; my $version = "7.0NG.734 PS190510";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

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