Merge remote-tracking branch 'origin/develop' into ent-3975-mejorar-la-actualizacion-de-los-datos-y-elementos-de-la-consola-visual

This commit is contained in:
Alejandro Gallardo Escobar 2019-05-17 14:16:23 +02:00
commit 2c8dd3b5e5
76 changed files with 3783 additions and 5794 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190513}
{190517}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -998,20 +998,23 @@ function process_upload_xml($xml)
{
$hook_enterprise = enterprise_include('extensions/resource_registration/functions.php');
// Extract component
// Extract component.
process_upload_xml_component($xml);
$group_filter = get_parameter('group');
// Extract visual map
// Extract visual map.
process_upload_xml_visualmap($xml, $group_filter);
// Extract policies
// Extract policies.
if ($hook_enterprise === true) {
process_upload_xml_policy($xml, $group_filter);
$centralized_management = !is_central_policies_on_node();
if ($centralized_management) {
process_upload_xml_policy($xml, $group_filter);
}
}
// Extract reports
// Extract reports.
process_upload_xml_report($xml, $group_filter);
}
@ -1038,6 +1041,11 @@ function resource_registration_extension_main()
return;
}
$centralized_management = !is_central_policies_on_node();
if (!$centralized_management) {
ui_print_warning_message(__('This node is configured with centralized mode. Go to metaconsole to create a policy.'));
}
echo '<div class=notify>';
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__("You can get more resurces in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a>");
echo '</div>';

View File

@ -1,5 +1,16 @@
START TRANSACTION;
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event';
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
COMMIT;
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event';
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome&#x20;to&#x20;Pandora&#x20;FMS&#x20;Console', '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;',NOW());
COMMIT;

View File

@ -761,6 +761,23 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnews`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnews` (
`id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`author` varchar(255) NOT NULL DEFAULT '',
`subject` varchar(255) NOT NULL DEFAULT '',
`text` TEXT NOT NULL,
`timestamp` DATETIME NOT NULL DEFAULT 0,
`id_group` int(10) NOT NULL default 0,
`modal` tinyint(1) DEFAULT 0,
`expire` tinyint(1) DEFAULT 0,
`expire_timestamp` DATETIME NOT NULL DEFAULT 0,
PRIMARY KEY(`id_news`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
@ -778,6 +795,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(
ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@ -1197,6 +1215,7 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria&#x20;IMS&#x20;API&#x20;path\",\"Integria&#x20;IMS&#x20;API&#x20;pass\",\"Integria&#x20;IMS&#x20;user\",\"Integria&#x20;IMS&#x20;user&#x20;pass\",\"Ticket&#x20;title\",\"Ticket&#x20;group&#x20;ID\",\"Ticket&#x20;priority\",\"Email&#x20;copy\",\"Ticket&#x20;owner\",\"Ticket&#x20;description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very&#x20;Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria&#x20;IMS&#x20;Ticket';
UPDATE `talert_commands` SET `description` = 'This&#x20;alert&#x20;send&#x20;an&#x20;email&#x20;using&#x20;internal&#x20;Pandora&#x20;FMS&#x20;Server&#x20;SMTP&#x20;capabilities&#x20;&#40;defined&#x20;in&#x20;each&#x20;server,&#x20;using:&#x0d;&#x0a;_field1_&#x20;as&#x20;destination&#x20;email&#x20;address,&#x20;and&#x0d;&#x0a;_field2_&#x20;as&#x20;subject&#x20;for&#x20;message.&#x20;&#x0d;&#x0a;_field3_&#x20;as&#x20;text&#x20;of&#x20;message.&#x20;&#x0d;&#x0a;_field4_&#x20;as&#x20;content&#x20;type&#x20;&#40;text/plain&#x20;or&#x20;html/text&#41;.', `fields_descriptions` = '[\"Destination&#x20;address\",\"Subject\",\"Text\",\"Content&#x20;Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0;
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
@ -1216,13 +1235,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 27);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '734');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- ---------------------------------------------------------------------
@ -1392,7 +1411,6 @@ UPDATE treport_custom_sql SET `sql` = 'select&#x20;t1.alias&#x20;as&#x20;agent_n
-- ----------------------------------------------------------------------
-- Table `treport_content`
-- ---------------------------------------------------------------------
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300';
@ -1413,6 +1431,7 @@ ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAUL
ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
@ -2103,3 +2122,16 @@ ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
-- Update table `tuser_task`
-- ----------------------------------------------------------------------
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
------------------------------------------------------------------------
------ ADD message in table 'tnews'
------------------------------------------------------------------------
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome&#x20;to&#x20;Pandora&#x20;FMS&#x20;Console', '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;',NOW());
-- ----------------------------------------------------------------------
-- Alter table `talert_templates`
-- ----------------------------------------------------------------------
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');

View File

@ -197,12 +197,15 @@ if (!empty($all_data)) {
}
foreach ($news as $article) {
$text = io_safe_output($article['text']);
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
echo '<tr><th class="green_title">'.$article['subject'].'</th></tr>';
echo '<tr><td>'.__('by').' <b>'.$article['author'].'</b> <i>'.ui_print_timestamp($article['timestamp'], true).'</i> '.$comparation_suffix.'</td></tr>';
echo '<tr><td class="datos">';
if ($article['id_news'] == 1) {
echo '<center><img src="./images/welcome_image.png" alt="img colabora con nosotros - Support" width="191" height="207"></center>';
}
echo nl2br($text);
echo '</td></tr>';
}

View File

@ -167,27 +167,18 @@ if ($disk_conf_delete) {
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->head = [];
$table->style = [];
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = [];
$table->align[2] = 'center';
if (!$new_agent && $alias != '') {
$table->data[0][0] = __('Agent name').ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true);
$table->data[0][1] = html_print_input_text('agente', $nombre_agente, '', 50, 100, true);
$table_agent_name = '<div class="label_select"><p class="input_label">'.__('Agent name').': '.ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true).'</p>';
$table_agent_name .= '<div class="label_select_parent">';
$table_agent_name .= '<div class="label_select_child_left">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name">';
$table->data[0][2] = __('QR Code Agent view');
$table_qr_code = '<div class="agent_qr white_box"><p class="input_label">'.__('QR Code Agent view').': </p>';
if ($id_agente) {
$table->data[0][1] .= '&nbsp;<b>'.__('ID')."</b>&nbsp; $id_agente &nbsp;";
$table->data[0][1] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">';
$table->data[0][1] .= html_print_image(
$table_agent_name .= '<span>'.__('ID').' '.$id_agente.'</span>';
$table_agent_name .= '<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image(
'images/zoom.png',
true,
[
@ -195,20 +186,23 @@ if (!$new_agent && $alias != '') {
'title' => __('Agent detail'),
]
);
$table->data[0][1] .= '</a>';
$table_agent_name .= '</a>';
}
}
// Remote configuration available
if (!$new_agent) {
$agent_options_update = 'agent_options_update';
// Delete link from here.
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
// Remote configuration available.
if (isset($filename)) {
if (file_exists($filename['md5'])) {
$agent_name = agents_get_name($id_agente);
$agent_name = io_safe_output($agent_name);
$agent_md5 = md5($agent_name, false);
$table->data[0][1] .= '&nbsp;&nbsp;'.'<a href="index.php?'.'sec=gagente&amp;'.'sec2=godmode/agentes/configurar_agente&amp;'.'tab=remote_configuration&amp;'.'id_agente='.$id_agente.'&amp;'.'disk_conf='.$agent_md5.'">';
$table->data[0][1] .= html_print_image(
$table_agent_name .= '<a href="index.php?'.'sec=gagente&amp;'.'sec2=godmode/agentes/configurar_agente&amp;'.'tab=remote_configuration&amp;'.'id_agente='.$id_agente.'&amp;'.'disk_conf='.$agent_md5.'">';
$table_agent_name .= html_print_image(
'images/application_edit.png',
true,
[
@ -216,35 +210,44 @@ if (!$new_agent) {
'title' => __('This agent can be remotely configured'),
]
);
$table->data[0][1] .= '</a>'.ui_print_help_tip(
$table_agent_name .= '</a>'.ui_print_help_tip(
__('You can remotely edit this agent configuration'),
true
);
}
}
$table_agent_name .= '</div></div></div>';
}
// Delete link from here
if (!$new_agent) {
$table->data[0][1] .= "&nbsp;&nbsp;<span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
}
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</span>';
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
if ($new_agent) {
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');
$label_select_child_left = 'label_select_child_left';
$label_select_parent = 'label_select_parent';
}
$table->data[2][0] = __('IP Address');
$table->data[2][1] = html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).html_print_checkbox('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table_alias = '<div class="label_select"><p class="input_label">'.__('Alias').': '.ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</p>';
$table_alias .= '<div class='.$label_select_parent.'>';
$table_alias .= '<div class='.$label_select_child_left.'>'.html_print_input_text('alias', $alias, '', 50, 100, true).'</div>';
if ($new_agent) {
$table_alias .= '<div class="label_select_child_right">'.html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name').'</div>';
}
$table_alias .= '</div></div>';
$table_ip = '<div class="label_select"><p class="input_label">'.__('IP Address').': </p>';
$table_ip .= '<div class="label_select_parent">';
$table_ip .= '<div class="label_select_child_left">'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true).'</div>';
$table_ip .= '</div></div>';
if ($id_agente) {
$table->data[2][1] .= '&nbsp;&nbsp;&nbsp;&nbsp;';
$ip_all = agents_get_addresses($id_agente);
$table->data[2][1] .= html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true);
$table->data[2][1] .= '&nbsp;'.html_print_checkbox('delete_ip', 1, false, true).__('Delete selected');
$table_ip .= '<div class="label_select">';
$table_ip .= '<div class="label_select_parent">';
$table_ip .= '<div class="label_select_child_left">'.html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true).'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('delete_ip', 1, false, true).__('Delete selected').'</div>';
$table_ip .= '</div></div>';
}
?>
@ -254,13 +257,12 @@ if ($id_agente) {
}
</style>
<?php
if (!$new_agent) {
$table->rowspan[2][2] = 3;
if (!$new_agent && $alias != '') {
if ($id_agente) {
$table->data[2][2] = "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
} else {
$table->data[2][2] = __('Only it is show when<br />the agent is saved.');
$table_qr_code .= "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
}
$table_qr_code .= '</div>';
}
$groups = users_get_groups($config['id_user'], 'AR', false);
@ -277,28 +279,32 @@ if (is_array($modules)) {
}
}
$table->data[4][0] = __('Primary group');
// Cannot change primary group if user have not permission for that group
$table_primary_group = '<div class="label_select"><p class="input_label">'.__('Primary group').': </p>';
$table_primary_group .= '<div class="label_select_parent">';
// Cannot change primary group if user have not permission for that group.
if (isset($groups[$grupo]) || $new_agent) {
$table->data[4][1] = html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
$table_primary_group .= html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
} else {
$table->data[4][1] = groups_get_name($grupo);
$table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true);
$table_primary_group .= groups_get_name($grupo);
$table_primary_group .= html_print_input_hidden('grupo', $grupo, true);
}
$table->data[4][1] .= ' <span id="group_preview">';
$table->data[4][1] .= ui_print_group_icon($grupo, true);
$table->data[4][1] .= '</span>';
$table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">';
$table_primary_group .= ui_print_group_icon($grupo, true);
$table_primary_group .= '</span></div></div></div>';
$table->data[5][0] = __('Interval');
$table->data[5][1] = html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
$table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').': </p>';
$table_interval .= '<div class="label_select_parent">';
$table_interval .= html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
if ($intervalo < SECONDS_5MINUTES) {
$table->data[5][1] .= clippy_context_help('interval_agent_min');
$table_interval .= clippy_context_help('interval_agent_min');
}
$table->data[6][0] = __('OS');
$table->data[6][1] = html_print_select_from_sql(
$table_interval .= '</div></div>';
$table_os = '<div class="label_select"><p class="input_label">'.__('OS').': </p>';
$table_os .= '<div class="label_select_parent">';
$table_os .= html_print_select_from_sql(
'SELECT id_os, name FROM tconfig_os',
'id_os',
$id_os,
@ -307,18 +313,19 @@ $table->data[6][1] = html_print_select_from_sql(
'0',
true
);
$table->data[6][1] .= ' <span id="os_preview">';
$table->data[6][1] .= ui_print_os_icon($id_os, false, true);
$table->data[6][1] .= '</span>';
$table_os .= '<div class="label_select_child_icons"> <span id="os_preview">';
$table_os .= ui_print_os_icon($id_os, false, true);
$table_os .= '</span></div></div></div>';
// Network server
// Network server.
$servers = servers_get_names();
if (!array_key_exists($server_name, $servers)) {
$server_Name = 0;
// Set the agent have not server.
}
$table->data[7][0] = __('Server');
$table_server = '<div class="label_select"><p class="input_label">'.__('Server').': </p>';
$table_server .= '<div class="label_select_parent">';
if ($new_agent) {
// Set first server by default.
$servers_get_names = servers_get_names();
@ -326,7 +333,7 @@ if ($new_agent) {
$server_name = reset($array_keys_servers_get_names);
}
$table->data[7][1] = html_print_select(
$table_server .= html_print_select(
servers_get_names(),
'server_name',
$server_name,
@ -334,36 +341,35 @@ $table->data[7][1] = html_print_select(
__('None'),
0,
true
).' '.ui_print_help_icon('agent_server', true);
).'<div class="label_select_child_icons">'.ui_print_help_icon('agent_server', true).'</div></div></div>';
// Description
$table->data[8][0] = __('Description');
$table->data[8][1] = html_print_input_text(
// Description.
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').': </p>';
$table_description .= html_print_input_text(
'comentarios',
$comentarios,
'',
45,
200,
true
);
).'</div>';
html_print_table($table);
unset($table);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
echo '<div class="first_row">
<div class="agent_options '.$agent_options_update.' white_box">
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
</div>';
if (!$new_agent && $alias != '') {
echo $table_qr_code;
}
$table->head = [];
$table->style = [];
$table->style[0] = 'font-weight: bold; ';
$table->style[4] = 'font-weight: bold;';
$table->data = [];
echo '</div>';
if (enterprise_installed()) {
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
$table->data['secondary_groups'][0] = __('Secondary groups').ui_print_help_icon('secondary_groups', true);
$table->data['secondary_groups'][1] = html_print_select_groups(
$table_adv_secondary_groups = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': '.ui_print_help_icon('secondary_groups', true).'</p></div>';
$table_adv_secondary_groups_left = html_print_select_groups(
false,
// Use the current user to select the groups
'AR',
@ -390,7 +396,7 @@ if (enterprise_installed()) {
// CSS classnames (default)
false,
// Not disabled (default)
false,
'width:50%; min-width:170px; text-align:center',
// Inline styles (default)
false,
// Option style select (default)
@ -404,29 +410,31 @@ if (enterprise_installed()) {
// Do not show the primary group in this selection
);
$table->data['secondary_groups'][2] = html_print_input_image(
$table_adv_secondary_groups_arrows = html_print_input_image(
'add_secondary',
'images/darrowright.png',
'images/darrowright_green.png',
1,
'',
true,
[
'id' => 'right_autorefreshlist',
'title' => __('Add secondary groups'),
'onclick' => 'agent_manager_add_secondary_groups(event, '.$id_agente.');',
]
).'<br /><br /><br /><br />'.html_print_input_image(
).html_print_input_image(
'remove_secondary',
'images/darrowleft.png',
'images/darrowleft_green.png',
1,
'',
true,
[
'id' => 'left_autorefreshlist',
'title' => __('Remove secondary groups'),
'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.');',
]
);
$table->data['secondary_groups'][3] = html_print_select(
$table_adv_secondary_groups_right .= html_print_select(
$secondary_groups_selected['for_select'],
// Values
'secondary_groups_selected',
@ -441,8 +449,16 @@ if (enterprise_installed()) {
// Nothing selected
true,
// Return HTML (not echo)
true
true,
// Multiple selection
true,
// Sort
'',
// Class
false,
// Disabled
'width:50%; min-width:170px; text-align:center'
// Style
);
// safe operation mode
@ -457,47 +473,42 @@ if (enterprise_installed()) {
$safe_mode_modules[$m['id_module']] = $m['name'];
}
$table->data[2][0] = __('Safe operation mode').ui_print_help_tip(
$table_adv_safe = '<div class="label_select_simple label_simple_items"><p class="input_label input_label_simple">'.__('Safe operation mode').': '.ui_print_help_tip(
__(
'This mode allow %s to disable all modules
of this agent while the selected module is on CRITICAL status',
get_product_name()
),
true
);
$table->data[2][1] = html_print_checkbox('safe_mode', 1, $safe_mode, true);
$table->data[2][1] .= '&nbsp;&nbsp;'.__('Module').'&nbsp;'.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true);
).'</p>';
$table_adv_safe .= html_print_checkbox_switch('safe_mode', 1, $safe_mode, true);
$table_adv_safe .= __('Module').'&nbsp;'.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true).'</div>';
}
// Remote configuration
$table->data[5][0] = __('Remote configuration');
$table_adv_remote = '<div class="label_select"><p class="input_label">'.__('Remote configuration').': </p>';
if (!$new_agent) {
$table->data[5][1] = '<em>'.__('Not available').'</em>';
if (isset($filename)) {
if (file_exists($filename['md5'])) {
$table->data[5][1] = date('F d Y H:i:s', fileatime($filename['md5']));
// Delete remote configuration
$table->data[5][1] .= '<a href="index.php?'.'sec=gagente&amp;'.'sec2=godmode/agentes/configurar_agente&amp;'.'tab=main&amp;'.'disk_conf_delete=1&amp;'.'id_agente='.$id_agente.'">';
$table->data[5][1] .= html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete remote configuration file'),
'style' => 'vertical-align: middle;',
]
).'</a>';
$table->data[5][1] .= '</a>'.ui_print_help_tip(
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
true
);
}
}
if (!$new_agent && isset($filename) && file_exists($filename['md5'])) {
$table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5']));
// Delete remote configuration
$table_adv_remote .= '<a href="index.php?'.'sec=gagente&amp;'.'sec2=godmode/agentes/configurar_agente&amp;'.'tab=main&amp;'.'disk_conf_delete=1&amp;'.'id_agente='.$id_agente.'">';
$table_adv_remote .= html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete remote configuration file'),
'style' => 'vertical-align: middle;',
]
).'</a>';
$table_adv_remote .= '</a>'.ui_print_help_tip(
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
true
);
} else {
$table->data[5][1] = '<em>'.__('Not available').'</em>';
$table_adv_remote .= '<em>'.__('Not available').'</em>';
}
$table_adv_remote .= '</div>';
$cps_array[-1] = __('Disabled');
if ($cps > 0) {
@ -511,16 +522,16 @@ if (enterprise_installed()) {
$cps_array[$cps_inc] = __('Enabled');
}
$table->data[6][0] = __('Cascade protection services');
$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true);
$table_adv_cascade = '<div class="label_select"><p class="input_label">'.__('Cascade protection services').': ';
$table_adv_cascade .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true).'</p>';
$table_adv_cascade .= html_print_select($cps_array, 'cps', $cps, '', '', 0, true).'</div>';
}
// Custom ID
$table->data[0][0] = __('Custom ID');
$table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
$table_adv_custom_id = '<div class="label_select"><p class="input_label">'.__('Custom ID').': </p>';
$table_adv_custom_id .= html_print_input_text('custom_id', $custom_id, '', 16, 255, true).'</div>';
$table->data[1][0] = __('Parent');
$table_adv_parent = '<div class="label_select"><p class="input_label">'.__('Parent').': </p>';
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
@ -532,75 +543,79 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$params['cascade_protection'] = true;
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
$table_adv_parent .= '<div class="label_simple_items">';
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
if (enterprise_installed()) {
$table->data[1][1] .= html_print_checkbox('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').'&nbsp;'.ui_print_help_icon('cascade_protection', true);
$table_adv_parent .= html_print_checkbox_switch('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').'&nbsp;'.ui_print_help_icon('cascade_protection', true);
}
$table->data[1][1] .= '&nbsp;&nbsp;'.__('Module').'&nbsp;'.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true);
$table_adv_parent .= __('Module').'&nbsp;'.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true).'</div></div>';
// Learn mode / Normal mode
$table->data[3][0] = __('Module definition').ui_print_help_icon('module_definition', true);
$table->data[3][1] = __('Learning mode').' '.html_print_radio_button_extended(
$table_adv_module_mode = '<div class="label_select"><p class="input_label">'.__('Module definition').': '.ui_print_help_icon('module_definition', true).'</p>';
$table_adv_module_mode .= '<div class="switch_radio_button">';
$table_adv_module_mode .= html_print_radio_button_extended(
'modo',
1,
'',
__('Learning mode'),
$modo,
false,
'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"',
'',
true
);
$table->data[3][1] .= __('Normal mode').' '.html_print_radio_button_extended(
$table_adv_module_mode .= html_print_radio_button_extended(
'modo',
0,
'',
__('Normal mode'),
$modo,
false,
'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"',
'',
true
);
$table->data[3][1] .= __('Autodisable mode').' '.html_print_radio_button_extended(
$table_adv_module_mode .= html_print_radio_button_extended(
'modo',
2,
'',
__('Autodisable mode'),
$modo,
false,
'show_modules_not_learning_mode_context_help();',
'style="margin-right: 40px;"',
'',
true
);
$table_adv_module_mode .= '</div></div>';
// Status (Disabled / Enabled)
$table->data[4][0] = __('Status');
$table->data[4][1] = __('Disabled').' '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).' '.html_print_radio_button_extended('disabled', 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[4][1] .= __('Enabled').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table_adv_status = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
$table_adv_status .= html_print_checkbox_switch('disabled', 1, $disabled, true).'</div>';
// Url address.
if (enterprise_installed()) {
$table->data[4][2] = __('Url address').ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true);
$table->data[4][3] = html_print_input_text(
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': '.ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true).'</p>';
$table_adv_url .= html_print_input_text(
'url_description',
$url_description,
'',
45,
255,
true
);
).'</div>';
} else {
$table->data[5][0] = __('Url address');
$table->data[5][1] = html_print_input_text(
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>';
$table_adv_url .= html_print_input_text(
'url_description',
$url_description,
'',
45,
255,
true
);
).'</div>';
}
$table->data[5][2] = __('Quiet');
$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true);
$table_adv_quiet = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Quiet').': ';
$table_adv_quiet .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true).'</p>';
$table_adv_quiet .= html_print_checkbox_switch('quiet', 1, $quiet, true).'</div>';
$listIcons = gis_get_array_list_icons();
@ -611,7 +626,7 @@ foreach ($listIcons as $index => $value) {
$path = 'images/gis_map/icons/';
// TODO set better method the path
$table->data[0][2] = __('Agent icon').ui_print_help_tip(__('Agent icon for GIS Maps.'), true);
$table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('Agent icon').': '.ui_print_help_tip(__('Agent icon for GIS Maps.'), true).'</p>';
if ($icon_path == '') {
$display_icons = 'none';
// Hack to show no icon. Use any given image to fix not found image errors
@ -629,7 +644,7 @@ if ($icon_path == '') {
$path_warning = $path.$icon_path.'.warning.png';
}
$table->data[0][3] = html_print_select(
$table_adv_agent_icon .= html_print_select(
$arraySelectIcon,
'icon_path',
$icon_path,
@ -637,63 +652,68 @@ $table->data[0][3] = html_print_select(
__('None'),
'',
true
).'&nbsp;'.html_print_image(
).html_print_image(
$path_ok,
true,
[
'id' => 'icon_ok',
'style' => 'display:'.$display_icons.';',
]
).'&nbsp;'.html_print_image(
).html_print_image(
$path_bad,
true,
[
'id' => 'icon_bad',
'style' => 'display:'.$display_icons.';',
]
).'&nbsp;'.html_print_image(
).html_print_image(
$path_warning,
true,
[
'id' => 'icon_warning',
'style' => 'display:'.$display_icons.';',
]
);
).'</div>';
if ($config['activate_gis']) {
$table->data[3][2] = __('Ignore new GIS data:');
$table->data[3][3] = __('Yes').' '.html_print_radio_button_extended(
'update_gis_data',
0,
'',
$update_gis_data,
false,
'',
'style="margin-right: 40px;"',
true
);
$table->data[3][3] .= __('No').' '.html_print_radio_button_extended(
'update_gis_data',
1,
'',
$update_gis_data,
false,
'',
'style="margin-right: 40px;"',
true
);
$table_adv_gis = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Ignore new GIS data:').'</p>';
if ($new_agent) {
$update_gis_data = true;
}
$table_adv_gis .= html_print_checkbox_switch('update_gis_data', 1, $update_gis_data, true).'No / Yes</div>';
}
ui_toggle(html_print_table($table, true), __('Advanced options'));
unset($table);
$table_adv_options = $table_adv_secondary_groups.'<div class="secondary_groups_select" style="margin-bottom:30px;">
<div class="secondary_groups_list_left">
'.$table_adv_secondary_groups_left.'
</div>
<div class="secondary_groups_select_arrows">
'.$table_adv_secondary_groups_arrows.'
</div>
<div class="secondary_groups_list_right">
'.$table_adv_secondary_groups_right.'
</div>
</div>
<div class="agent_options agent_options_adv">
<div class="agent_options_column_left" >'.$table_adv_parent.$table_adv_custom_id.$table_adv_module_mode.$table_adv_cascade.$table_adv_gis.'</div>
<div class="agent_options_column_right" >'.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'</div>
</div>';
echo '<div class="ui_toggle">';
ui_toggle($table_adv_options, __('Advanced options'), '', true, false, 'white_box white_box_opened');
echo '</div>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'custom_fields_table';
$table->head = [];
$table->style = [];
$table->style[0] = 'font-weight: bold; width: 100px;';
$table->style[0] = 'font-weight: bold;';
$table->data = [];
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -703,11 +723,15 @@ if ($fields === false) {
}
foreach ($fields as $field) {
$data[0] = '<b>'.$field['name'].'</b>';
$id_custom_field = $field['id_field'];
$data[0] = '<div class="field_title" onclick="show_custom_field_row('.$id_custom_field.')">';
$data[0] .= '<b>'.$field['name'].'</b>';
$data[0] .= ui_print_help_tip(
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
true
);
$data[0] .= '</div>';
$combo = [];
$combo = $field['combo_values'];
$combo = explode(',', $combo);
@ -730,7 +754,7 @@ foreach ($fields as $field) {
}
if ($field['is_password_type']) {
$data[1] = html_print_input_text_extended(
$data_field[1] = html_print_input_text_extended(
'customvalue_'.$field['id_field'],
$custom_value,
'customvalue_'.$field['id_field'],
@ -744,18 +768,18 @@ foreach ($fields as $field) {
true
);
} else {
$data[1] = html_print_textarea(
$data_field[1] = html_print_textarea(
'customvalue_'.$field['id_field'],
2,
65,
$custom_value,
'style="min-height: 30px; width:96%;"',
'style="min-height: 30px;"',
true
);
}
if ($field['combo_values'] !== '') {
$data[1] = html_print_select(
$data_field[1] = html_print_select(
$combo_values,
'customvalue_'.$field['id_field'],
$custom_value,
@ -776,19 +800,25 @@ foreach ($fields as $field) {
);
};
$table->rowid[] = 'name_field-'.$id_custom_field;
array_push($table->data, $data);
$table->rowid[] = 'field-'.$id_custom_field;
array_push($table->data, $data_field);
}
if (!empty($fields)) {
ui_toggle(html_print_table($table, true), __('Custom fields'));
echo '<div class="ui_toggle">';
ui_toggle(html_print_table($table, true), __('Custom fields'), '', true, false, 'white_box white_box_opened');
echo '</div>';
}
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
// The context help about the learning mode.
if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help' style=''>";
echo "<span id='modules_not_learning_mode_context_help' style='padding-right:8px;'>";
} else {
echo "<span id='modules_not_learning_mode_context_help' style='display: none;'>";
}
@ -798,7 +828,7 @@ echo '</span>';
if ($id_agente) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<div class="action-buttons">';
html_print_submit_button(
__('Update'),
'updbutton',
@ -825,6 +855,19 @@ ui_require_jquery_file('bgiframe');
?>
<script type="text/javascript">
// Show/Hide custom field row.
function show_custom_field_row(id){
if( $('#field-'+id).css('display') == 'none'){
$('#field-'+id).css('display','table-row');
$('#name_field-'+id).addClass('custom_field_row_opened');
}
else{
$('#field-'+id).css('display','none');
$('#name_field-'+id).removeClass('custom_field_row_opened');
}
}
//Use this function for change 3 icons when change the selectbox
function changeIcons() {
var icon = $("#icon_path :selected").val();
@ -863,7 +906,7 @@ ui_require_jquery_file('bgiframe');
function show_modules_not_learning_mode_context_help() {
if ($("input[name='modo'][value=0]").is(':checked')) {
$("#modules_not_learning_mode_context_help").show();
$("#modules_not_learning_mode_context_help").show().css('padding-right','8px');
}
else {
$("#modules_not_learning_mode_context_help").hide();

View File

@ -1062,7 +1062,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1078,7 +1078,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1094,7 +1094,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1110,7 +1110,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1126,7 +1126,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1151,7 +1151,7 @@ $(document).ready (function () {
|| ($("#module option").length == 1
&& $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>');
alert("<?php echo __('Modules list is empty'); ?>");
return false;
}
$('#module option').map(function() {

View File

@ -571,7 +571,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -587,7 +587,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -603,7 +603,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -619,7 +619,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -641,7 +641,7 @@ $(document).ready (function () {
$("#submit-create_modules_btn").click(function () {
if($("#module option").length == 0 || ($("#module option").length == 1 && $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>');
alert("<?php echo __('Modules list is empty'); ?>");
return false;
}
$('#module option').map(function() {

View File

@ -1038,7 +1038,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
}
function show_executing_alert () {
alert('<?php echo __('This elements cannot be modified while the downtime is being executed'); ?>');
alert("<?php echo __('This elements cannot be modified while the downtime is being executed'); ?>");
}
function show_editor_module(id_agent) {
@ -1168,7 +1168,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
var module_sel = $("#modules", $('#module_editor_' + id_agent)).val();
if (module_sel == 0) {
alert('<?php echo __('Please select a module.'); ?>');
alert("<?php echo __('Please select a module.'); ?>");
}
else {
action_in_progress = true;

View File

@ -11,7 +11,7 @@
// 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.
// Load global vars
// Load global vars.
global $config;
require_once $config['homedir'].'/include/functions_alerts.php';
@ -46,7 +46,7 @@ if (is_ajax()) {
$id = (int) get_parameter('id', 0);
$get_recovery_fields = (int) get_parameter('get_recovery_fields', 1);
// If command ID is not provided, check for action id
// If command ID is not provided, check for action id.
if ($id == 0) {
$id_action = (int) get_parameter('id_action');
$id = alerts_get_alert_action_alert_command_id($id_action);
@ -59,31 +59,31 @@ if (is_ajax()) {
$command['description'] = io_safe_input(str_replace("\r\n", '<br>', io_safe_output($command['description'])));
}
// Descriptions are stored in json
// Descriptions are stored in json.
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode(io_safe_output($command['fields_descriptions']), true);
// Fields values are stored in json
// Fields values are stored in json.
$fields_values = empty($command['fields_values']) ? '' : io_safe_output(json_decode($command['fields_values'], true));
// Fields hidden conditions are stored in json.
$fields_hidden_checked = empty($command['fields_hidden']) ? '' : io_safe_output(json_decode($command['fields_hidden'], true));
$fields_rows = [];
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
if (($i == 5) && ($command['id'] == 3)) {
continue;
}
$field_description = $fields_descriptions[($i - 1)];
$field_value = $fields_values[($i - 1)];
$field_hidden = $fields_hidden_checked[($i - 1)];
if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show
// If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), ($i - 1)).'</span>';
} else {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
}
// If the field is the number one, print the help message
// If the field is the number one, print the help message.
if ($i == 1) {
// If our context is snmpconsole, show snmp_alert helps
// If our context is snmpconsole, show snmp_alert helps.
if ((isset($_SERVER['HTTP_REFERER'])) && ( preg_match('/snmp_alert/', $_SERVER['HTTP_REFERER']) > 0 )) {
$fdesc .= ui_print_help_icon('snmp_alert_field1', true);
} else {
@ -91,7 +91,7 @@ if (is_ajax()) {
}
}
} else {
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
if (($i > 5) && ($command['id'] == 3)) {
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
$fdesc = sprintf(__('Field %s'), ($i - 1));
@ -107,9 +107,11 @@ if (is_ajax()) {
}
}
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : '';
if (!empty($field_value)) {
$field_value = io_safe_output($field_value);
// HTML type
// HTML type.
if (preg_match('/^_html_editor_$/i', $field_value)) {
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx .= __('Basic').ui_print_help_tip(__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'), true);
@ -148,7 +150,7 @@ if (is_ajax()) {
$editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true);
$editor_type_chkbx .= '</small></b></div>';
$rfield = $editor_type_chkbx;
// Select type
// Select type.
} else {
$fields_value_select = [];
$fv = explode(';', $field_value);
@ -200,7 +202,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px" class="fields"',
'style="min-height:40px; '.$style.'" class="fields"',
true
);
$rfield = html_print_textarea(
@ -208,7 +210,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px" class="fields_recovery"',
'style="min-height:40px; '.$style.'" class="fields_recovery',
true
);
}
@ -219,7 +221,7 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px" class="fields"',
'style="min-height:40px; '.$style.'" class="fields"',
true
);
$rfield = html_print_textarea(
@ -227,13 +229,13 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px" class="fields_recovery"',
'style="min-height:40px; '.$style.'" class="fields_recovery"',
true
);
}
// The empty descriptions will be ignored
// The empty descriptions will be ignored.
if ($fdesc == '') {
$fields_rows[$i] = '';
} else {
@ -248,11 +250,7 @@ if (is_ajax()) {
}
}
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert
if ($command['id'] == 3) {
$fields_rows[5] = '';
}
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert.
$command['fields_rows'] = $fields_rows;
echo json_encode($command);
@ -268,7 +266,7 @@ if ($update_command) {
return;
}
// Header
// Header.
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
@ -283,16 +281,19 @@ if ($create_command) {
$fields_descriptions = [];
$fields_values = [];
$fields_hidden = [];
$info_fields = '';
$values = [];
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
$fields_values[] = (string) get_parameter('field'.$i.'_values');
$fields_hidden[] = get_parameter('field'.$i.'_hide');
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
}
$values['fields_values'] = io_json_mb_encode($fields_values);
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
$values['description'] = $description;
$values['id_group'] = $id_group;
@ -316,7 +317,7 @@ if ($create_command) {
db_pandora_audit('Command management', 'Fail try to create alert command', false, false);
}
// Show errors
// Show errors.
if (!isset($messageAction)) {
$messageAction = __('Could not be created');
}
@ -340,7 +341,7 @@ if ($create_command) {
if ($delete_command) {
$id = (int) get_parameter('id');
// Internal commands cannot be deleted
// Internal commands cannot be deleted.
if (alerts_get_alert_command_internal($id)) {
db_pandora_audit(
'ACL Violation',
@ -368,17 +369,17 @@ if ($delete_command) {
if ($copy_command) {
$id = (int) get_parameter('id');
// Get the info from the source command
// Get the info from the source command.
$command_to_copy = db_get_row('talert_commands', 'id', $id);
if ($command_to_copy === false) {
ui_print_error_message(__("Command with id $id does not found."));
} else {
// Prepare to insert the copy with same values
// Prepare to insert the copy with same values.
unset($command_to_copy['id']);
$command_to_copy['name'] .= __(' (copy)');
$result = db_process_sql_insert('talert_commands', $command_to_copy);
// Print the result
// Print the result.
ui_print_result_message(
$result,
__('Successfully copied'),

View File

@ -186,6 +186,10 @@ switch ($template['type']) {
$condition = __('The alert would fire when the module is in critical status');
break;
case 'not_normal':
$condition = __('The alert would fire when the module is in not normal status');
break;
case 'unknown':
$condition = __('The alert would fire when the module is in unknown status');
break;

View File

@ -11,7 +11,7 @@
// 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.
// Load global vars
// Load global vars.
global $config;
require_once $config['homedir'].'/include/functions_alerts.php';
@ -35,7 +35,7 @@ $id = (int) get_parameter('id');
$pure = get_parameter('pure', 0);
$alert = [];
// Header
// Header.
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
@ -65,16 +65,19 @@ if ($update_command) {
$fields_descriptions = [];
$fields_values = [];
$fields_hidden = [];
$info_fields = '';
$values = [];
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
$fields_values[] = (string) get_parameter('field'.$i.'_values');
$fields_hidden[] = get_parameter('field'.$i.'_hide');
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
}
$values['fields_values'] = io_json_mb_encode($fields_values);
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
$values['name'] = $name;
$values['command'] = $command;
@ -129,6 +132,7 @@ if ($id) {
$id_group = $alert['id_group'];
$fields_descriptions = $alert['fields_descriptions'];
$fields_values = $alert['fields_values'];
$fields_hidden = $alert['fields_hidden'];
}
if (!empty($fields_descriptions)) {
@ -139,6 +143,10 @@ if (!empty($fields_values)) {
$fields_values = json_decode($fields_values, true);
}
if (!empty($fields_hidden)) {
$fields_hidden = json_decode($fields_hidden, true);
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
@ -153,6 +161,7 @@ $table->style = [];
if (!defined('METACONSOLE')) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
}
$table->size = [];
@ -190,7 +199,7 @@ $table->data['description'][1] = html_print_textarea('description', 10, 30, $des
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$table->data['field'.$i][0] = sprintf(__('Field %s description'), $i);
// Only show help on first row
// Only show help on first row.
if ($i == 1) {
$table->data['field'.$i][0] .= ui_print_help_icon('alert_fields_description', true);
}
@ -201,11 +210,11 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$field_description = '';
}
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 35, 255, true);
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 30, 255, true);
$table->data['field'.$i][2] = sprintf(__('Field %s values'), $i);
// Only show help on first row
// Only show help on first row.
if ($i == 1) {
$table->data['field'.$i][2] .= ui_print_help_icon('alert_fields_values', true);
}
@ -216,7 +225,17 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$field_values = '';
}
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 65, 255, true);
if (!empty($fields_hidden)) {
$selected = (bool) $fields_hidden[($i - 1)];
} else {
$selected = false;
}
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 55, 255, true, false, false, '', 'field_value');
$table->data['field'.$i][4] = __('Hide');
$table->data['field'.$i][5] = html_print_checkbox_extended('field'.$i.'_hide', 1, $selected, false, 'cursor: \'pointer\'', 'class="hide_inputs"', true);
}
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'">';
@ -236,3 +255,27 @@ echo '</div>';
echo '</form>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {
$(".hide_inputs").each(function(index) {
var $input_in_row = $(this).closest('tr').find('.field_value');
if($(this).is(':checked')) {
$input_in_row.prop('style', '-webkit-text-security: disc;');
} else {
$input_in_row.prop('style', '');
}
});
$(".hide_inputs").click(function() {
var $input_in_row = $(this).closest('tr').find('.field_value');
if($(this).is(':checked')) {
$input_in_row.prop('style', '-webkit-text-security: disc;');
} else {
$input_in_row.prop('style', '');
}
});
});
</script>

View File

@ -679,7 +679,7 @@ if ($step == 2) {
'type',
$type,
'',
__('Select'),
__('None'),
0,
true,
false,
@ -1018,6 +1018,7 @@ var onchange_msg = <?php echo '"'.__('The alert would fire when the module value
var onchange_not = <?php echo '"'.__('The alert would fire when the module value does not change').'"'; ?>;
var unknown = <?php echo "'".__('The alert would fire when the module is in unknown status')."'"; ?>;
var error_message_min_max_zero = <?php echo "'".__('The alert template cannot have the same value for min and max thresholds.')."'"; ?>;
var not_normal = <?php echo "'".__('The alert would fire when the module is in not normal status')."'"; ?>;
function check_fields_step2() {
var correct = true;
@ -1174,6 +1175,13 @@ if ($step == 2) {
/* Show example */
$("span#example").empty ().append (critical);
break;
case "not_normal":
$("#template-value, #template-max, span#matches_value, #template-min").hide ();
$("#template-example").show ();
/* Show example */
$("span#example").empty ().append (not_normal);
break;
case "onchange":
$("#template-value, #template-max, #template-min").hide ();
$("#template-example, span#matches_value").show ();

View File

@ -357,7 +357,7 @@ function addConnectionMap() {
for (var index in connectionMaps) {
if (isInt(index)) {
if (connectionMaps[index] == idConnectionMap) {
alert('<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>');
alert("<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>");
return;
}

View File

@ -391,7 +391,7 @@ $(document).ready (function () {
});
if($('#module')[0].childElementCount == 1 && ($('#module')[0].value == "" || $('#module')[0].value == "0")) {
alert('<?php echo __('Please, select a module'); ?>');
alert("<?php echo __('Please, select a module'); ?>");
return false;
}
});

View File

@ -151,100 +151,193 @@ if ($multiple_delete) {
}
$id_group = (int) get_parameter('id_group', 0);
$search = trim(get_parameter('search', ''));
$graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
$offset = (int) get_parameter('offset');
$table_aux = new stdClass();
ui_pagination(count($graphs));
$table_aux->width = '100%';
$table_aux->class = 'databox filters';
$table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
$table->data = [];
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
).'</b>';
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
foreach ($result_graphs as $graph) {
$data = [];
if ($report_m) {
$data[5] .= html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
if (is_metaconsole()) {
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
method='post'>";
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
method='post'>";
html_print_table($table_aux);
echo '</form>';
}
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>';
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
} else {
$group = false;
}
if ($report_m) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
$own_info = get_user_info($config['id_user']);
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
$return_all_group = true;
} else {
$return_all_group = false;
}
if ($search != '') {
$filter = [
'name' => $search_name,
'order' => 'name',
];
} else {
$filter = ['order' => 'name'];
}
// Fix : group filter was not working
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group;
} else {
$group = false;
}
// Filter normal and metaconsole reports.
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
$filter['metaconsole'] = 1;
} else {
$filter['metaconsole'] = 0;
}
/*
$reports = reports_get_reports(
$filter,
[
'name',
'description',
'id_graph',
'id_group',
],
$return_all_group,
$access,
$group,
false
);*/
if ($id_group != null || $search != null) {
$graphs = custom_graphs_search($id_group, $search);
}
ui_pagination(count($graphs));
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
$table->data = [];
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = [];
if ($report_m) {
$data[5] .= html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
}
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>';
}
if ($report_m) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>';
}
array_push($table->data, $data);
}
if (!empty($result_graphs)) {
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='float: right;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';
echo '</form>';
}
echo "<div style='float: right;'>";
if ($report_w || $report_m) {
echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"');
echo '</form>';
}
echo '</div>';
} else {
include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
}
array_push($table->data, $data);
}
if (!empty($result_graphs)) {
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='float: right;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';
echo '</form>';
}
echo "<div style='float: right;'>";
if ($report_w || $report_m) {
echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"');
echo '</form>';
}
echo '</div>';
} else {
include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
}
?>
?>
<script type="text/javascript">

File diff suppressed because it is too large Load Diff

View File

@ -674,12 +674,17 @@ function update_button_palette_callback() {
return false;
}
}
if (values["module"] == 0) {
var radio_value = $("input[name='radio_choice']:checked").val();
if (values["agent"] == "" && radio_value == "module_graph") {
dialog_message("#message_alert_no_agent");
return false;
}
if (values["module"] == 0 && radio_value == "module_graph") {
dialog_message("#message_alert_no_module");
return false;
}
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_custom_graph");
return false;
}
if ($("input[name=width_module_graph]").val() == "") {
@ -1425,11 +1430,12 @@ function create_button_palette_callback() {
break;
case "module_graph":
if (values["module"] == 0) {
var radio_value = $("input[name='radio_choice']:checked").val();
if (values["module"] == 0 && radio_value == "module_graph") {
dialog_message("#message_alert_no_module");
validate = false;
}
if (values["id_custom_graph"] == 0) {
if (values["id_custom_graph"] == 0 && radio_value == "module_graph") {
if (values["agent"] == "") {
dialog_message("#message_alert_no_agent");
validate = false;
@ -1439,6 +1445,10 @@ function create_button_palette_callback() {
validate = false;
}
}
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_custom_graph");
validate = false;
}
if (
values["height_module_graph"] == "" ||
values["height_module_graph"] == 0

View File

@ -1189,13 +1189,13 @@ ui_require_javascript_file('pandora_modules');
}
}
else {
alert('<?php echo __('The plugin command cannot be updated because some modules or components are using the plugin.'); ?>');
alert("<?php echo __('The plugin command cannot be updated because some modules or components are using the plugin.'); ?>");
}
}
}
var macros_click_locked_event = function (event) {
alert('<?php echo __('The plugin macros cannot be updated because some modules or components are using the plugin'); ?>');
alert("<?php echo __('The plugin macros cannot be updated because some modules or components are using the plugin'); ?>");
}
if (locked) {

View File

@ -139,47 +139,49 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
ui_print_error_message($error_message);
}
echo "<form method='post'>";
// Form enable.
echo '<form id="form_enable" method="post">';
echo '<div id="form_enable">';
html_print_input_hidden('update_config', 1);
html_print_table($table_enable);
echo '</form>';
echo '</div>';
// Form remote.
if ($config['ehorus_enabled']) {
echo '<form id="form_remote" method="post">';
echo '<div id="form_remote">';
echo '<fieldset>';
echo '<legend>'.__('eHorus API').'</legend>';
html_print_input_hidden('update_config', 1);
html_print_table($table_remote);
echo '<div class="action-buttons" style="width: '.$table_remote->width.'">';
echo '</fieldset>';
echo '</div>';
echo '<div class="action-buttons" style="width: '.$table_remote->width.'">';
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
echo '</div>';
echo '</fieldset>';
echo '</form>';
}
?>
<script type="text/javascript">
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
$('form#form_remote').hide();
$('form#form_enable').css('margin-bottom','20px');
if(!$('input:checkbox[name="ehorus_enabled"]').is(':checked')){
$('#form_remote').hide();
}
$('#form_enable').css('margin-bottom','20px');
var showFields = function () {
$('form#form_remote').show();
$('#form_remote').show();
}
var hideFields = function () {
$('form#form_remote').hide();
$('#form_remote').hide();
}
var handleEnable = function (event) {
var is_checked = $('input:checkbox[name="ehorus_enabled"]').is(':checked');
if (event.target.value == '1' && is_checked) {
showFields();
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
$('input:checkbox[name="ehorus_enabled"]').attr('checked', true);
}
else {
hideFields();
$('input:checkbox[name="ehorus_enabled"]').attr('checked', true);
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
};
}
$('input:checkbox[name="ehorus_enabled"]').change(handleEnable);

View File

@ -742,7 +742,7 @@ class HostDevices extends Wizard
echo '<div class="white_box">
<div class="edit_discovery_info" style="margin-bottom: 15px;">
<div style="width: 25%; padding: 9px;">'.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close'), 'style' => 'width: 60%;'], false).'</div>'.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'.'</div>
<div style="width: 25%; padding: 9px;">'.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'</div>'.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'.'</div>
<div style="width: 40%; padding-left: 5%; padding-right: 12%;">
<div class="edit_discovery_input">'.$taskname_input_label.'<div class="discovery_text_input">'.$taskname_input.'</div></div>'.'<div class="edit_discovery_input discovery_select_input">'.$discovery_server_select_label.$discovery_server_select.'<div class="discovery_hint"></div></div>'.'<div class="edit_discovery_input">'.$network_input_label.'<div class="discovery_text_input">'.$network_input.'</div></div>'.'</div>'.'<div style="width: 35%;">'.$group_select.'</div>'.'</div>'.'<div class="edit_discovery_info">

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -443,7 +443,7 @@ class CustomNetScan extends Wizard
'name' => 'taskname',
'value' => $this->task['name'],
'type' => 'text',
'size' => 25,
'size' => 50,
],
];
@ -465,7 +465,7 @@ class CustomNetScan extends Wizard
'name' => 'comment',
'value' => $this->task['description'],
'type' => 'text',
'size' => 25,
'size' => 50,
],
];
@ -652,7 +652,7 @@ class CustomNetScan extends Wizard
'value' => $explanation,
'return' => true,
'attributes' => 'style="width: 388px;"',
'class' => 'discovery_textarea_input'
'class' => 'discovery_textarea_input',
],
];

View File

@ -3467,19 +3467,18 @@ class NetworkMap
$output .= '<div id="arrow_minimap_'.$networkmap['id'].'"';
$output .= ' style="position: absolute; left: 0px; top: 0px;">';
$output .= '<a title="'.__('Open Minimap').'" href="javascript: toggle_minimap();">';
$output .= '<img id="image_arrow_minimap_'.$networkmap['id'].'"';
$output .= ' src="images/minimap_open_arrow.png" />';
$output .= html_print_image('/images/minimap_open_arrow.png', true, ['id' => 'arrow_minimap_'.$networkmap['id']]);
$output .= '</a><div></div></div>';
$output .= '<div id="hide_labels_'.$networkmap['id'].'"';
$output .= ' style="position: absolute; right: 10px; top: 10px;">';
$output .= '<a title="'.__('Hide Labels').'" href="javascript: hide_labels();">';
$output .= '<img id="image_hide_show_labels" src="images/icono_borrar.png" />';
$output .= html_print_image('/images/icono_borrar.png', true, ['id' => 'image_hide_show_labels']);
$output .= '</a></div>';
$output .= '<div id="holding_spinner_'.$networkmap['id'].'" ';
$output .= ' style="display: none; position: absolute; right: 50px; top: 20px;">';
$output .= '<img id="image_hide_show_labels" src="images/spinner.gif" />';
$output .= html_print_image('/images/spinner.png', true, ['id' => 'image_hide_show_labels']);
$output .= '</div>';
// Close networkconsole_id div.

View File

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

View File

@ -1762,16 +1762,22 @@ function array_key_to_offset($array, $key)
/**
* Make a snmpwalk and return it.
*
* @param string $ip_target The target address.
* @param string $snmp_version Version of the snmp: 1,2,2c or 3.
* @param string $snmp_community.
* @param string $snmp3_auth_user.
* @param string $snmp3_security_level.
* @param string $snmp3_auth_method.
* @param string $snmp3_auth_pass.
* @param string $snmp3_privacy_method.
* @param string $snmp3_privacy_pass.
* @param integer $quick_print 0 for all details, 1 for only value.
* @param string $ip_target The target address.
* @param string $snmp_version Version of the snmp: 1,2,2c or 3.
* @param string $snmp_community Snmp_community.
* @param string $snmp3_auth_user Snmp3_auth_user.
* @param string $snmp3_security_level Snmp3_security_level.
* @param string $snmp3_auth_method Snmp3_auth_method.
* @param string $snmp3_auth_pass Snmp3_auth_pass.
* @param string $snmp3_privacy_method Snmp3_privacy_method.
* @param string $snmp3_privacy_pass Snmp3_privacy_pass.
* @param integer $quick_print To get all details 0, 1: only value.
* @param string $base_oid Base_oid.
* @param string $snmp_port Snmp_port.
* @param integer $server_to_exec Server_to_exec.
* @param string $extra_arguments Extra_arguments.
* @param string $format Format to apply, for instance, to
* retrieve hex-dumps: --hexOutputLength.
*
* @return array SNMP result.
*/
@ -1789,7 +1795,8 @@ function get_snmpwalk(
$base_oid='',
$snmp_port='',
$server_to_exec=0,
$extra_arguments=''
$extra_arguments='',
$format='-Oa'
) {
global $config;
@ -1840,15 +1847,15 @@ function get_snmpwalk(
case '3':
switch ($snmp3_security_level) {
case 'authNoPriv':
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
case 'noAuthNoPriv':
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
default:
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
break;
@ -1857,7 +1864,7 @@ function get_snmpwalk(
case '2c':
case '1':
default:
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' -Oa -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
@ -2668,7 +2675,7 @@ function get_news($arguments)
case 'mysql':
case 'postgresql':
$sql = sprintf(
"SELECT subject,timestamp,text,author
"SELECT id_news,subject,timestamp,text,author
FROM tnews WHERE id_group IN (%s) AND
modal = %s AND
(expire = 0 OR (expire = 1 AND expire_timestamp > '%s'))

View File

@ -664,6 +664,7 @@ function alerts_get_alert_templates_types()
$types['unknown'] = __('Unknown status');
$types['onchange'] = __('On Change');
$types['always'] = __('Always');
$types['not_normal'] = __('Not normal status');
return $types;
}
@ -680,7 +681,7 @@ function alerts_get_alert_templates_type_name($type)
{
$types = alerts_get_alert_templates_types();
if (! isset($type[$type])) {
if (!isset($types[$type])) {
return __('Unknown');
}

View File

@ -1349,7 +1349,7 @@ function config_update_config()
break;
case 'ehorus':
if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', $config['ehorus_enabled']))) {
if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0))) {
$error_update[] = __('Enable eHorus');
}

View File

@ -161,3 +161,35 @@ function custom_graphs_get_user($id_user=0, $only_names=false, $returnAllGroup=t
return $graphs;
}
function custom_graphs_search($id_group, $search)
{
if ($id_group != '' && $search != '') {
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.' AND name LIKE "%'.$search.'%"');
} else if ($id_group != '') {
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.'');
} else {
$all_graphs = db_get_all_rows_sql('select * from tgraph where name LIKE "%'.$search.'%"');
}
if ($all_graphs === false) {
return [];
}
$graphs = [];
foreach ($all_graphs as $graph) {
$graphsCount = db_get_value_sql(
'SELECT COUNT(id_gs)
FROM tgraph_source
WHERE id_graph = '.$graph['id_graph'].''
);
$graphs[$graph['id_graph']]['graphs_count'] = $graphsCount;
$graphs[$graph['id_graph']]['name'] = $graph['name'];
$graphs[$graph['id_graph']]['description'] = $graph['description'];
$graphs[$graph['id_graph']]['id_group'] = $graph['id_group'];
}
return $graphs;
}

View File

@ -1646,7 +1646,7 @@ function events_get_agent(
$sql_where,
0,
1000,
is_metaconsole(),
(is_metaconsole() && $id_server) ? true : false,
false,
false,
$history

View File

@ -2437,7 +2437,7 @@ function ui_print_status_image($type, $title='', $return=false, $options=false,
*/
function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false)
function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false, $toggle_class='')
{
// Generate unique Id
$uniqid = uniqid('');
@ -2458,12 +2458,11 @@ function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false)
// Link to toggle
$output = '';
$output .= '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid]).'&nbsp;&nbsp;<b>'.$name.'</b></a>';
$output .= '<br />';
// $output .= '<br />';
// if (!defined("METACONSOLE"))
// $output .= '<br />';
// Code into a div
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."' class='".$toggle_class."'>\n";
$output .= $code;
$output .= '</div>';

View File

@ -1386,6 +1386,10 @@ function visual_map_editor_print_hack_translate_strings()
echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>';
echo '</div>';
echo "<div id='message_alert_no_custom_graph' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No custom graph defined.').'</p>';
echo '</div>';
}

View File

@ -1284,7 +1284,7 @@ function hide_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Show Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr(
"src",
"images/icono_pintar.png"
window.location.origin + "/pandora_console/images/icono_pintar.png"
);
d3.selectAll(".node_text").style("display", "none");
@ -1297,7 +1297,7 @@ function show_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Hide Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr(
"src",
"images/icono_borrar.png"
window.location.origin + "/pandora_console/images//icono_borrar.png"
);
d3.selectAll(".node_text").style("display", "");

View File

@ -19,8 +19,14 @@ function parse_alert_command(command, classs) {
var regex = new RegExp(field, "gi");
command = command.replace(regex, $(this).val());
if ($(this).css("-webkit-text-security") == "disc") {
var hidden_character = "*";
var hidden_string = hidden_character.repeat($(this).val().length);
command = command.replace(regex, hidden_string);
} else {
command = command.replace(regex, $(this).val());
}
nfield++;
});

View File

@ -125,4 +125,35 @@ final class EventsHistory extends Item
}
/**
* Generate a link to something related with the item.
*
* @param array $data Visual Console Item's data structure.
*
* @return mixed The link or a null value.
*
* @override Item::buildLink.
*/
protected static function buildLink(array $data)
{
// Get the linked agent and module Ids.
$linkedModule = static::extractLinkedModule($data);
$agentId = static::parseIntOr($linkedModule['agentId'], null);
$moduleId = static::parseIntOr($linkedModule['moduleId'], null);
$baseUrl = \ui_get_full_url('index.php');
return $baseUrl.'?'.http_build_query(
[
'sec' => 'eventos',
'sec2' => 'operation/events/events',
'id_agent' => $agentId,
'module_search_hidden' => $moduleId,
'event_view_hr' => (static::extractMaxTime($data) / 3600),
'status' => -1,
]
);
}
}

View File

@ -383,22 +383,22 @@ final class Group extends Item
// Critical.
$html .= '<div style="'.$valueStyle.'background-color: #FC4444;">';
$html .= \number_format($agentStats['critical']).'%';
$html .= \number_format($agentStats['critical'], 2).'%';
$html .= '</div>';
$html .= '<div style="'.$nameStyle.'">'.__('Critical').'</div>';
// Warning.
$html .= '<div style="'.$valueStyle.'background-color: #f8db3f;">';
$html .= \number_format($agentStats['warning']).'%';
$html .= \number_format($agentStats['warning'], 2).'%';
$html .= '</div>';
$html .= '<div style="'.$nameStyle.'">'.__('Warning').'</div>';
// Normal.
$html .= '<div style="'.$valueStyle.'background-color: #84b83c;">';
$html .= \number_format($agentStats['normal']).'%';
$html .= \number_format($agentStats['normal'], 2).'%';
$html .= '</div>';
$html .= '<div style="'.$nameStyle.'">'.__('Normal').'</div>';
// Unknown.
$html .= '<div style="'.$valueStyle.'background-color: #9d9ea0;">';
$html .= \number_format($agentStats['unknown']).'%';
$html .= \number_format($agentStats['unknown'], 2).'%';
$html .= '</div>';
$html .= '<div style="'.$nameStyle.'">'.__('Unknown').'</div>';

View File

@ -226,12 +226,8 @@ final class Percentile extends Item
);
}
// Cast to float.
$moduleValue = (float) $moduleValue;
// Store the module value.
$data['value'] = $moduleValue;
$data['value'] = (float) \number_format((float) $moduleValue, (int) $config['graph_precision'], '.', '');
$unit = \modules_get_unit($moduleId);
if (empty($unit) === false) {
$data['unit'] = \io_safe_output($unit);

View File

@ -230,8 +230,8 @@ final class StaticGraph extends Item
if (!$isBooleanModule
|| ($isBooleanModule && $showLastValueTooltip !== 'default')
) {
if (is_numeric($value)) {
$imgTitle .= __('Last value: ').\remove_right_zeros($value);
if (\is_numeric($value)) {
$imgTitle .= __('Last value: ').\remove_right_zeros(\number_format((float) $value, (int) $config['graph_precision']));
} else {
$imgTitle .= __('Last value: ').$value;
}

View File

@ -162,7 +162,7 @@ span.breadcrumb_link {
.edit_discovery_info {
display: flex;
align-items: center;
align-items: flex-start;
padding-top: 25px;
}
@ -181,63 +181,41 @@ span.breadcrumb_link {
label {
color: #343434 !important;
font-size: 1.5em;
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-weight: bold;
margin: 0px 0px 5px 0px;
}
.discovery_full_width_input {
width: 100%;
}
select {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1.6em !important;
color: #686868;
li > input[type="text"],
li > input[type="password"],
.discovery_text_input > input[type="password"],
.discovery_text_input > input[type="text"],
#interval_manual > input[type="text"] {
background-color: transparent !important;
border: none;
border-radius: 0 !important;
border-bottom: 1px solid #343434;
padding: 0px 0px 2px 0px;
box-sizing: border-box;
margin-bottom: 4px;
}
select > option {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1em !important;
}
li > input[type=text], li > input[type=password], .discovery_text_input > input[type=password], .discovery_text_input > input[type=text], #interval_manual > input[type=text] {
background-color: transparent !important;
border: none;
border-radius: 0 !important;
border-bottom: 1px solid #343434;
padding: 0px 0px 2px 0px;
box-sizing: border-box;
margin-bottom: 4px;
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1.6em;
}
li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_input > input[type=password]:focus, .discovery_text_input > input[type=text]:focus, #interval_manual > input[type=text]:focus {
font-weight: bold;
}
#interval_manual > input[type=text] {
#interval_manual > input[type="text"] {
width: 50px;
margin-left: 10px;
margin-right: 10px;
}
.discovery_list_input {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1.6em !important;
color: #686868;
width: 100%;
height: 240px;
border: 1px solid #CBCBCB;
border: 1px solid #cbcbcb;
overflow-y: auto;
}
.discovery_list_input option {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1.1em !important;
padding-left: 30%;
text-align: center;
}
.discovery_list_input option:checked {
@ -253,11 +231,9 @@ li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_in
max-height: 100px;
max-width: 100%;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box;
resize: none;
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-size: 1.4em !important;
}
a.tip {
@ -270,4 +246,4 @@ a.tip {
.discovery_interval_select_width {
width: 90%;
}
}

View File

@ -266,6 +266,38 @@ th {
letter-spacing: 0.3pt;
}
/* Remove background when autocomplete */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus textarea:-webkit-autofill,
textarea:-webkit-autofill:hover textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
}
/* All select type multiple */
select[multiple] option:checked,
select[multiple] option:checked {
background: #82b92e linear-gradient(0deg, #82b92e 0%, #82b92e 100%);
color: #fff !important;
}
select option:checked,
select option:checked {
background-color: #82b92e;
color: #fff !important;
}
select > option:hover {
background-color: #cbcbcb;
}
select:-internal-list-box {
border: none;
}
/* --- Font ttf --- */
@font-face {
font-family: "DejaVuSerif-BoldFont";
@ -5011,28 +5043,6 @@ input:checked + .p-slider:before {
text-align: center;
}
select#autorefresh_list_out[multiple] option:checked,
select#autorefresh_list[multiple] option:checked {
background: #82b92e linear-gradient(0deg, #82b92e 0%, #82b92e 100%);
color: #fff !important;
}
select#autorefresh_list_out option:checked,
select#autorefresh_list option:checked {
background-color: #82b92e;
color: #fff !important;
}
select#autorefresh_list_out > option:hover,
select#autorefresh_list > option:hover {
background-color: #cbcbcb;
}
select#autorefresh_list_out:-internal-list-box,
select#autorefresh_list:-internal-list-box {
border: none;
}
.autorefresh_select .autorefresh_select_list_out,
.autorefresh_select .autorefresh_select_list {
width: 45%;
@ -5511,6 +5521,297 @@ table.info_table.policy_sub_table {
align-items: flex-start;
}
/*
* ---------------------------------------------------------------------
* - Layout for the new forms
* ---------------------------------------------------------------------
*/
.first_row {
margin-bottom: 20px;
display: flex;
}
.label_simple_one_item {
display: flex;
align-items: flex-end;
}
.label_simple_items {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.label_simple_items > * {
margin-right: 5px;
}
.input_label {
color: #343434 !important;
font-weight: bold;
padding-right: 10px;
margin: 0px 0px 5px 0px;
}
.input_label_simple {
margin-bottom: 0;
margin-top: 0;
display: inline;
}
.label_select_parent {
display: flex;
justify-content: space-between;
align-items: center;
}
.label_select_child_left {
width: 80%;
min-width: 100px;
}
.label_select_child_right {
width: 20%;
min-width: 140px;
align-items: center;
display: flex;
}
.label_select_child_icons {
text-align: right;
width: 5%;
min-width: 30px;
}
/* Inputs type text shown as a black line */
.agent_options input[type="text"] {
background-color: transparent !important;
border: none;
border-radius: 0 !important;
border-bottom: 1px solid #343434;
padding: 2px 5px;
box-sizing: border-box;
background-repeat: no-repeat;
background-position: left bottom 2px;
margin-bottom: 4px;
}
/*
* ---------------------------------------------------------------------
* - Create/Update Agent - agent_manager.php
* ---------------------------------------------------------------------
*/
.agent_options {
width: 100%;
margin-right: 0px;
display: flex;
flex-flow: row wrap;
flex-direction: row;
justify-content: space-between;
box-sizing: border-box;
}
.agent_options_update {
width: 85%;
margin-right: 20px;
}
.agent_options_column_left,
.agent_options_column_right {
width: 50%;
box-sizing: border-box;
}
.agent_options_column_left {
padding-right: 50px;
}
.agent_qr {
width: 15%;
text-align: center;
box-sizing: border-box;
padding: 20px 0px;
display: flex;
justify-content: center;
flex-direction: column;
min-width: 150px;
}
a#qr_code_agent_view {
margin-top: 5px;
}
.first_row .agent_options_column_right select,
.first_row .agent_options_column_right input,
.first_row .agent_options_column_left select#grupo {
width: 95%;
box-sizing: border-box;
}
.first_row .agent_options_column_left .p-switch {
margin-right: 5px;
margin-left: 10px;
}
.agent_options_column_left input#text-direccion,
.agent_options_column_left select#address_list,
.agent_options_column_left input#text-agente,
.agent_options_column_left input#text-alias {
width: 100%;
box-sizing: border-box;
}
.agent_options_agent_name > * {
margin-left: 5px;
}
.custom_fields_table {
border-spacing: 0px;
}
.custom_fields_table tr.datos {
background-color: #f7f7f7;
display: none;
}
.custom_fields_table tr.datos2 {
cursor: pointer;
}
.custom_fields_table tr td {
border: 1px solid #e0e0e0;
}
.custom_fields_table tr.datos2 td div.field_title {
padding: 10px;
}
.custom_fields_table tr.datos2 td {
border-radius: 4px;
padding: 0px;
}
.custom_fields_table tr.datos td {
padding: 15px 10px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.custom_fields_table .custom_field_row_opened td {
border-bottom-left-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
.secondary_groups_select {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
}
.secondary_groups_select .secondary_groups_select_arrows input {
display: grid;
margin: 0 auto;
}
.secondary_groups_select .secondary_groups_list_left {
text-align: right;
width: 50%;
}
.secondary_groups_select .secondary_groups_list_right {
text-align: left;
width: 50%;
}
.secondary_groups_select .secondary_groups_select_arrows {
padding: 0 50px;
}
.secondary_groups_select_arrows a {
display: block;
}
.agent_options_adv .agent_options_column_right .label_select select,
.agent_options_adv .agent_options_column_right .label_select input[type="text"],
.agent_options_adv #text-custom_id,
.agent_options_adv #cps {
width: 100%;
box-sizing: border-box;
}
.agent_options_adv .label_select_simple.label_simple_one_item .p-switch {
margin-right: 5px;
}
/*
* ---------------------------------------------------------------------
* - CLASSES FOR THE NEW TOGGLES -
* ---------------------------------------------------------------------
*/
.ui_toggle {
margin-bottom: 20px;
}
.ui_toggle > a:first-child {
background-color: #fff;
border: 1px solid #f3f3f3;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
padding: 5px;
display: block;
}
.white_box_opened {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
/*
* ---------------------------------------------------------------------
* - SWITCH RADIO BUTTONS -
* ---------------------------------------------------------------------
*/
.switch_radio_button {
display: flex;
overflow: hidden;
}
.switch_radio_button input {
position: absolute !important;
clip: rect(0, 0, 0, 0);
height: 1px;
width: 1px;
border: 0;
overflow: hidden;
}
.switch_radio_button label {
background-color: #fff;
color: rgba(0, 0, 0, 0.6);
line-height: 1;
text-align: center;
padding: 7px 14px;
margin-right: -1px;
border: 1px solid #cbcbcb;
border-radius: 4px;
transition: all 0.1s ease-in-out;
}
.switch_radio_button label:hover {
cursor: pointer;
}
.switch_radio_button input:checked + label {
background-color: #82b92e;
box-shadow: none;
color: #fff;
}
.switch_radio_button label:last-child {
margin-right: 0px;
}
/*
* ---------------------------------------------------------------------
* - MODULE GRAPHS

View File

@ -6,7 +6,8 @@ ul.wizard {
}
ul.wizard li {
padding: 10px;
padding-bottom: 10px;
padding-top: 10px;
}
ul.wizard li > label:not(.p-switch) {

View File

@ -72,6 +72,10 @@
/* Analog clock */
.visual-console-item .analogic-clock {
text-align: center;
}
.visual-console-item .analogic-clock .hour-hand {
-webkit-animation: rotate-hour 43200s infinite linear;
animation: rotate-hour 43200s infinite linear;

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;ACfA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n background-position: center;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;ACfA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,kBAAkB;AACpB;;AAEA;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n background-position: center;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock {\n text-align: center;\n}\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

@ -226,7 +226,7 @@ unset($table);
url: "ajax.php",
success: function (data) {
if (data.correct == 0) {
alert('<?php echo __('There was error on setup the default map.'); ?>');
alert("<?php echo __('There was error on setup the default map.'); ?>");
}
}
});

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-- PLEASE NO NOT USE MULTILINE COMMENTS
-- PLEASE NO NOT USE MULTILINE COMMENTS
-- Because Pandora Installer don't understand them
-- and fails creating database !!!
@ -378,6 +378,7 @@ CREATE TABLE IF NOT EXISTS `talert_commands` (
`internal` tinyint(1) default 0,
`fields_descriptions` TEXT,
`fields_values` TEXT,
`fields_hidden` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -448,7 +449,7 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
`field13` text NOT NULL,
`field14` text NOT NULL,
`field15` text NOT NULL,
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always'),
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'),
`value` varchar(255) default '',
`matches_value` tinyint(1) default 0,
`max_value` double(18,2) default NULL,
@ -1433,6 +1434,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`unknown_checks` TINYINT(1) DEFAULT '1',
`agent_max_value` TINYINT(1) DEFAULT '1',
`agent_min_value` TINYINT(1) DEFAULT '1',
`current_month` TINYINT(1) DEFAULT '1',
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE
@ -2972,6 +2974,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`unknown_checks` TINYINT(1) DEFAULT '1',
`agent_max_value` TINYINT(1) DEFAULT '1',
`agent_min_value` TINYINT(1) DEFAULT '1',
`current_month` TINYINT(1) DEFAULT '1',
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -114,10 +114,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 27),
('MR', 28),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '734'),
('current_package_enterprise', '735'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'),
@ -345,8 +345,7 @@ INSERT INTO `tperfil` VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0
-- Dumping data for table `tnews`
--
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome to Pandora FMS!','This is the Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.\r\n\r\nThe Pandora FMS Team.',NOW());
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (2,'admin','New Pandora FMS Agent Features','Feel free to test our new features for both Windows and Linux agents: Proxy and Broker modes.',NOW());
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome&#x20;to&#x20;Pandora&#x20;FMS&#x20;Console', '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;',NOW());
INSERT INTO tmodule VALUES (1,'Agent&#x20;module');
INSERT INTO tmodule VALUES (2,'Network&#x20;module');

View File

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

View File

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

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.734";
my $pandora_build = "190513";
my $pandora_build = "190517";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -391,7 +391,11 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
}
# Get enabled alerts associated with this module
my $alert_type_filter = defined ($alert_type) ? " AND type = '$alert_type'" : '';
my $alert_type_filter = '';
if (defined($alert_type)) {
# not_normal includes unknown!
$alert_type_filter = $alert_type eq 'unknown' ? " AND (type = 'unknown' OR type = 'not_normal')" : " AND type = '$alert_type'";
}
my @alerts = get_db_rows ($dbh, '
SELECT talert_template_modules.id as id_template_module,
talert_template_modules.*, talert_templates.*
@ -566,6 +570,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) {
return $status if ($last_status != 1 && $alert->{'type'} eq 'critical');
return $status if ($last_status != 2 && $alert->{'type'} eq 'warning');
return $status if ($last_status != 3 && $alert->{'type'} eq 'unknown');
return $status if ($last_status == 0 && $alert->{'type'} eq 'not_normal');
}
# Event alert
else {

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.734";
my $pandora_build = "190513";
my $pandora_build = "190517";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.734 PS190513";
my $version = "7.0NG.734 PS190517";
# Pandora server configuration
my %conf;

View File

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

View File

@ -213,6 +213,12 @@ export default class Clock extends Item<ClockProps> {
const { width, height } = this.getElementSize(); // Destructuring assigment: http://es6-features.org/#ObjectMatchingShorthandNotation
// Calculate font size to adapt the font to the item size.
const baseTimeFontSize = 20; // Per 100px of width.
const dateFontSizeMultiplier = 0.5;
const dateFontSize =
(baseTimeFontSize * dateFontSizeMultiplier * width) / 100;
const div = document.createElement("div");
div.className = "analogic-clock";
div.style.width = `${width}px`;
@ -463,6 +469,16 @@ export default class Clock extends Item<ClockProps> {
// Add the clock to the container
div.append(svg);
// Date.
if (this.props.clockFormat === "datetime") {
const dateElem: HTMLSpanElement = document.createElement("span");
dateElem.className = "date";
dateElem.textContent = humanDate(date, "default");
dateElem.style.fontSize = `${dateFontSize}px`;
if (this.props.color) dateElem.style.color = this.props.color;
div.append(dateElem);
}
return div;
}

View File

@ -35,6 +35,10 @@
/* Analog clock */
.visual-console-item .analogic-clock {
text-align: center;
}
.visual-console-item .analogic-clock .hour-hand {
animation: rotate-hour 43200s infinite linear;
}

View File

@ -115,6 +115,15 @@ export default class Percentile extends Item<PercentileProps> {
// SVG container.
const svg = document.createElementNS(svgNS, "svg");
var formatValue;
if (this.props.value != null) {
if (Intl) {
formatValue = Intl.NumberFormat("en-EN").format(this.props.value);
} else {
formatValue = this.props.value;
}
}
switch (this.props.percentileType) {
case "progress-bar":
{
@ -142,9 +151,11 @@ export default class Percentile extends Item<PercentileProps> {
text.setAttribute("fill", colors.text);
if (this.props.valueType === "value") {
text.style.fontSize = "6pt";
text.textContent = this.props.unit
? `${this.props.value} ${this.props.unit}`
: `${this.props.value}`;
? `${formatValue} ${this.props.unit}`
: `${formatValue}`;
} else {
text.textContent = `${progress}%`;
}
@ -215,21 +226,24 @@ export default class Percentile extends Item<PercentileProps> {
text.setAttribute("font-weight", "bold");
text.setAttribute("fill", colors.text);
if (this.props.valueType === "value") {
if (this.props.valueType === "value" && this.props.value != null) {
// Show value and unit in 1 (no unit) or 2 lines.
if (this.props.unit && this.props.unit.length > 0) {
const value = document.createElementNS(svgNS, "tspan");
value.setAttribute("x", "0");
value.setAttribute("dy", "1em");
value.textContent = `${this.props.value}`;
value.textContent = `${formatValue}`;
value.style.fontSize = "8pt";
const unit = document.createElementNS(svgNS, "tspan");
unit.setAttribute("x", "0");
unit.setAttribute("dy", "1em");
unit.textContent = `${this.props.unit}`;
unit.style.fontSize = "8pt";
text.append(value, unit);
text.setAttribute("transform", "translate(50 33)");
} else {
text.textContent = `${this.props.value}`;
text.textContent = `${formatValue}`;
text.style.fontSize = "8pt";
text.setAttribute("transform", "translate(50 50)");
}
} else {