Merge branch 'develop' into 135-informe-de-eventos-sale-agrupado-int-4330-open

This commit is contained in:
daniel 2017-01-18 17:39:04 +01:00
commit 1b26423867
105 changed files with 4120 additions and 652 deletions

View File

@ -28,6 +28,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
#group Servers #group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this # Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable # agent, used when agents has no timer or it's inestable. 1 to enable
# this feature # this feature

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0dev-170111 Version: 7.0dev-170118
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -42,6 +42,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
#group Servers #group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent # address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example # You can also try to detect the first IP using "auto", for example
#address auto #address auto

View File

@ -50,6 +50,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
group Servers group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent # address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example # You can also try to detect the first IP using "auto", for example
address auto address auto

View File

@ -30,6 +30,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
#group Servers #group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this # Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable # agent, used when agents has no timer or it's inestable. 1 to enable
# this feature # this feature

View File

@ -50,6 +50,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
group Servers group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent # address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example # You can also try to detect the first IP using "auto", for example
address auto address auto

View File

@ -41,6 +41,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
#group Servers #group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this # Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable # agent, used when agents has no timer or it's inestable. 1 to enable

View File

@ -33,6 +33,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
group Servers group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this # Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable # agent, used when agents has no timer or it's inestable. 1 to enable
# this feature # this feature

View File

@ -30,6 +30,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
#group Servers #group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this # Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable # agent, used when agents has no timer or it's inestable. 1 to enable
# this feature # this feature

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0dev'; use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170111'; use constant AGENT_BUILD => '170118';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170111" PI_BUILD="170118"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{170111} {170118}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -80,6 +80,9 @@ Pandora_Module_Exec::Pandora_Module_Exec (string name, string exec, string nativ
} else { } else {
this->output_encoding = ""; this->output_encoding = "";
} }
/*allways change input encoding from UTF-8 to ANSI*/
changeInputEncoding();
} }
void void
@ -147,9 +150,6 @@ Pandora_Module_Exec::run () {
to find the GNU W32 tools */ to find the GNU W32 tools */
working_dir = getPandoraInstallDir () + "util\\"; working_dir = getPandoraInstallDir () + "util\\";
/*allways change input encoding from UTF-8 to ANSI*/
changeInputEncoding();
/* Create the child process. */ /* Create the child process. */
if (! CreateProcess (NULL, (CHAR *) this->module_exec.c_str (), NULL, if (! CreateProcess (NULL, (CHAR *) this->module_exec.c_str (), NULL,
NULL, TRUE, CREATE_SUSPENDED | CREATE_NO_WINDOW, NULL, NULL, TRUE, CREATE_SUSPENDED | CREATE_NO_WINDOW, NULL,

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0dev(Build 170111)") #define PANDORA_VERSION ("7.0dev(Build 170118)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0dev-170111 Version: 7.0dev-170118
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -256,7 +256,7 @@ function main_net_tools () {
function godmode_net_tools() { function godmode_net_tools() {
global $config; global $config;
check_config (); check_login();
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",

View File

@ -124,6 +124,7 @@ ALTER TABLE tlayout ADD `background_color` varchar(50) NOT NULL default '#FFF';
-- Table `tlayout_data` -- Table `tlayout_data`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD `type_graph` varchar(50) NOT NULL default 'area'; ALTER TABLE tlayout_data ADD `type_graph` varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagent_custom_fields` -- Table `tagent_custom_fields`
@ -134,9 +135,9 @@ INSERT INTO `tagent_custom_fields` (`name`) VALUES ('eHorusID');
-- Table `tagente_modulo` Fixed problems with blank space -- Table `tagente_modulo` Fixed problems with blank space
-- in cron interval and problems with process data from pandora server -- in cron interval and problems with process data from pandora server
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %' UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tgraph` -- Table `tgraph`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0'; ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0';

View File

@ -102,6 +102,7 @@ ALTER TABLE tlayout ADD COLUMN background_color varchar(50) NOT NULL default '#F
-- Table `tlayout_data` -- Table `tlayout_data`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area'; ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD COLUMN label_position varchar(50) NOT NULL default 'down';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagent_custom_fields` -- Table `tagent_custom_fields`

View File

@ -38,8 +38,4 @@ ALTER TABLE tlayout ADD COLUMN background_color varchar(50) NOT NULL default '#F
-- Table `tlayout_data` -- Table `tlayout_data`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area'; ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD COLUMN label_position varchar(50) NOT NULL default 'down';
-- ---------------------------------------------------------------------
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN percentil int(4) unsigned default 0;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -31,6 +31,7 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
check_login (); check_login ();
$ip_target = (string) get_parameter ('ip_target', $ipAgent); $ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1'); $snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user'); $snmp3_auth_user = get_parameter('snmp3_auth_user');
@ -305,7 +306,13 @@ if ($create_modules) {
$common_values['tcp_port'] = $tcp_port; $common_values['tcp_port'] = $tcp_port;
} }
$common_values['snmp_community'] = $snmp_community; $common_values['snmp_community'] = $snmp_community;
$common_values['ip_target'] = $ip_target; if($use_agent){
$common_values['ip_target'] = 'auto';
}
else{
$common_values['ip_target'] = $ip_target;
}
$common_values['tcp_send'] = $snmp_version; $common_values['tcp_send'] = $snmp_version;
if ($snmp_version == '3') { if ($snmp_version == '3') {
@ -696,18 +703,22 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60,
$table->data[0][2] = '<b>' . __('Port') . '</b>'; $table->data[0][2] = '<b>' . __('Port') . '</b>';
$table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true); $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true);
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$snmp_versions['1'] = 'v. 1'; $snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2'; $snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c'; $snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3'; $snmp_versions['3'] = 'v. 3';
$table->data[1][0] = '<b>' . __('SNMP community') . '</b>'; $table->data[2][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); $table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[1][2] = '<b>' . __('SNMP version') . '</b>'; $table->data[2][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); $table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[2][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
html_print_input_hidden('snmpwalk', 1); html_print_input_hidden('snmpwalk', 1);
html_print_table($table); html_print_table($table);
@ -760,9 +771,10 @@ if (!$fail) {
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>'; echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente=$id_agent'>"; echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente=$id_agent'>";
echo '<span id="form_interfaces">'; echo '<span id="form_interfaces">';
html_print_input_hidden('create_modules', 1); html_print_input_hidden('create_modules', 1);
html_print_input_hidden('ip_target', $ip_target); html_print_input_hidden('ip_target', $ip_target);
html_print_input_hidden('use_agent', $use_agent);
html_print_input_hidden('tcp_port', $tcp_port); html_print_input_hidden('tcp_port', $tcp_port);
html_print_input_hidden('snmp_community', $snmp_community); html_print_input_hidden('snmp_community', $snmp_community);
html_print_input_hidden('snmp_version', $snmp_version); html_print_input_hidden('snmp_version', $snmp_version);

View File

@ -28,6 +28,7 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
check_login (); check_login ();
$ip_target = (string) get_parameter ('ip_target', $ipAgent); $ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1'); $snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user'); $snmp3_auth_user = get_parameter('snmp3_auth_user');
@ -136,7 +137,12 @@ if ($create_modules) {
$values['tcp_port'] = $tcp_port; $values['tcp_port'] = $tcp_port;
} }
$values['snmp_community'] = $snmp_community; $values['snmp_community'] = $snmp_community;
$values['ip_target'] = $ip_target; if($use_agent){
$values['ip_target'] = 'auto';
}
else{
$values['ip_target'] = $ip_target;
}
$values['tcp_send'] = $snmp_version; $values['tcp_send'] = $snmp_version;
if ($snmp_version == '3') { if ($snmp_version == '3') {
@ -336,18 +342,21 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60,
$table->data[0][2] = '<b>' . __('Port') . '</b>'; $table->data[0][2] = '<b>' . __('Port') . '</b>';
$table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true); $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true);
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$snmp_versions['1'] = 'v. 1'; $snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2'; $snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c'; $snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3'; $snmp_versions['3'] = 'v. 3';
$table->data[1][0] = '<b>' . __('SNMP community') . '</b>'; $table->data[2][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true); $table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[1][2] = '<b>' . __('SNMP version') . '</b>'; $table->data[2][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); $table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>'; $table->data[2][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
html_print_input_hidden('snmpwalk', 1); html_print_input_hidden('snmpwalk', 1);
html_print_table($table); html_print_table($table);
@ -409,6 +418,7 @@ if (!empty($interfaces_list)) {
html_print_input_hidden('create_modules', 1); html_print_input_hidden('create_modules', 1);
html_print_input_hidden('ip_target', $ip_target); html_print_input_hidden('ip_target', $ip_target);
html_print_input_hidden('use_agent', $use_agent);
html_print_input_hidden('tcp_port', $tcp_port); html_print_input_hidden('tcp_port', $tcp_port);
html_print_input_hidden('snmp_community', $snmp_community); html_print_input_hidden('snmp_community', $snmp_community);
html_print_input_hidden('snmp_version', $snmp_version); html_print_input_hidden('snmp_version', $snmp_version);

View File

@ -974,6 +974,9 @@ if ($update_module || $create_module) {
$parent_module_id = (int) get_parameter('parent_module_id'); $parent_module_id = (int) get_parameter('parent_module_id');
$ip_target = (string) get_parameter ('ip_target'); $ip_target = (string) get_parameter ('ip_target');
if($ip_target == ''){
$ip_target = 'auto';
}
$custom_id = (string) get_parameter ('custom_id'); $custom_id = (string) get_parameter ('custom_id');
$history_data = (int) get_parameter('history_data'); $history_data = (int) get_parameter('history_data');
$dynamic_interval = (int) get_parameter('dynamic_interval'); $dynamic_interval = (int) get_parameter('dynamic_interval');

View File

@ -65,7 +65,37 @@ $extra_title = __('Network server module');
$data = array (); $data = array ();
$data[0] = __('Target IP'); $data[0] = __('Target IP');
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true); //show agent_for defect;
if($page == 'enterprise/godmode/policies/policy_modules'){
if($ip_target != 'auto' && $ip_target != ''){
$custom_ip_target = $ip_target;
$ip_target = 'custom';
}
elseif($ip_target == ''){
$ip_target = 'force_pri';
$custom_ip_target = '';
}
else{
$custom_ip_target = '';
}
$target_ip_values = array();
$target_ip_values['auto'] = __('Auto');
$target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select ($target_ip_values, 'ip_target', $ip_target, '', '', '',
true, false, false, '', false, 'width:200px;');
$data[1] .= html_print_input_text ('custom_ip_target', $custom_ip_target, '', 15, 60, true);
}
else{
if($ip_target == 'auto'){
$ip_target = agents_get_address ($id_agente);
}
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
}
// In ICMP modules, port is not configurable // In ICMP modules, port is not configurable
if ($id_module_type >= 6 && $id_module_type <= 7) { if ($id_module_type >= 6 && $id_module_type <= 7) {
@ -347,6 +377,18 @@ $(document).ready (function () {
$('#snmp3_browser_privacy_pass').keyup(function() { $('#snmp3_browser_privacy_pass').keyup(function() {
$('#snmp3_privacy_pass').val($(this).val()); $('#snmp3_privacy_pass').val($(this).val());
}); });
var custom_ip_target = "<?php echo $custom_ip_target?>";
if(custom_ip_target == ''){
$("#text-custom_ip_target").hide();
}
$('#ip_target').change(function() {
if($(this).val() == 'custom') {
$("#text-custom_ip_target").show();
}
else{
$("#text-custom_ip_target").hide();
}
});
}); });
// Show the SNMP browser window // Show the SNMP browser window

View File

@ -132,8 +132,8 @@ if (check_acl ($config['id_user'], 0, "LM")) {
$table->data[2][1] .= '</a>'; $table->data[2][1] .= '</a>';
} }
$table->data[3][0] = __('Threshold'); $table->data[3][0] = __('Threshold');
$table->data[3][1] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0, $table->data[3][1] = html_print_input_text ('module_action_threshold', '0', '', 5, 7, true);
__('None'), false, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false)); $table->data[3][1] .= ' ' . __('seconds') . ui_print_help_icon ('action_threshold', true);
echo '<form class="add_alert_form" method="post">'; echo '<form class="add_alert_form" method="post">';

View File

@ -34,6 +34,7 @@ enterprise_include_once ('meta/include/functions_agents_meta.php');
$icon = ""; $icon = "";
$name = ""; $name = "";
$id_parent = 0; $id_parent = 0;
$group_pass = "";
$alerts_disabled = 0; $alerts_disabled = 0;
$custom_id = ""; $custom_id = "";
$propagate = 0; $propagate = 0;
@ -55,6 +56,7 @@ if ($id_group) {
else { else {
$icon = $group["icon"].'.png'; $icon = $group["icon"].'.png';
} }
$group_pass = io_safe_output($group['password']);
$alerts_disabled = $group["disabled"]; $alerts_disabled = $group["disabled"];
$id_parent = $group["parent"]; $id_parent = $group["parent"];
$custom_id = $group["custom_id"]; $custom_id = $group["custom_id"];
@ -158,23 +160,36 @@ if ($acl_parent) {
$table->data[2][1] .= '</span>'; $table->data[2][1] .= '</span>';
} }
$table->data[3][0] = __('Alerts'); $i = 3;
$table->data[3][1] = html_print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true); if ($config['enterprise_installed']) {
$i = 4;
$table->data[3][0] = __('Group Password');
$table->data[3][1] = html_print_input_password ('group_pass', $group_pass, '', 16, 255, true);
}
$table->data[4][0] = __('Propagate ACL') . ui_print_help_tip (__("Propagate the same ACL security into the child subgroups."), true); $table->data[$i][0] = __('Alerts');
$table->data[4][1] = html_print_checkbox('propagate', 1, $propagate, true).ui_print_help_icon ("propagate_acl", true); $table->data[$i][1] = html_print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true);
$i++;
$table->data[5][0] = __('Custom ID'); $table->data[$i][0] = __('Propagate ACL') . ui_print_help_tip (__("Propagate the same ACL security into the child subgroups."), true);
$table->data[5][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true); $table->data[$i][1] = html_print_checkbox('propagate', 1, $propagate, true).ui_print_help_icon ("propagate_acl", true);
$i++;
$table->data[6][0] = __('Description'); $table->data[$i][0] = __('Custom ID');
$table->data[6][1] = html_print_input_text ('description', $description, '', 60, 255, true); $table->data[$i][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
$i++;
$table->data[7][0] = __('Contact') . ui_print_help_tip (__("Contact information accessible through the _groupcontact_ macro"), true); $table->data[$i][0] = __('Description');
$table->data[7][1] = html_print_textarea ('contact', 4, 40, $contact, "style='min-height: 0px;'", true); $table->data[$i][1] = html_print_input_text ('description', $description, '', 60, 255, true);
$i++;
$table->data[8][0] = __('Other') . ui_print_help_tip (__("Information accessible through the _group_other_ macro"), true); $table->data[$i][0] = __('Contact') . ui_print_help_tip (__("Contact information accessible through the _groupcontact_ macro"), true);
$table->data[8][1] = html_print_textarea ('other', 4, 40, $other, "style='min-height: 0px;'", true); $table->data[$i][1] = html_print_textarea ('contact', 4, 40, $contact, "style='min-height: 0px;'", true);
$i++;
$table->data[$i][0] = __('Other') . ui_print_help_tip (__("Information accessible through the _group_other_ macro"), true);
$table->data[$i][1] = html_print_textarea ('other', 4, 40, $other, "style='min-height: 0px;'", true);
$i++;
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); $isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) {

View File

@ -178,6 +178,7 @@ if (($create_group) && (check_acl($config['id_user'], 0, "PM"))) {
$name = (string) get_parameter ('name'); $name = (string) get_parameter ('name');
$icon = (string) get_parameter ('icon'); $icon = (string) get_parameter ('icon');
$id_parent = (int) get_parameter ('id_parent'); $id_parent = (int) get_parameter ('id_parent');
$group_pass = (string)get_parameter('group_pass');
$alerts_disabled = (bool) get_parameter ('alerts_disabled'); $alerts_disabled = (bool) get_parameter ('alerts_disabled');
$custom_id = (string) get_parameter ('custom_id'); $custom_id = (string) get_parameter ('custom_id');
$skin = (string) get_parameter ('skin'); $skin = (string) get_parameter ('skin');
@ -200,7 +201,8 @@ if (($create_group) && (check_acl($config['id_user'], 0, "PM"))) {
'description' => $description, 'description' => $description,
'contact' => $contact, 'contact' => $contact,
'propagate' => $propagate, 'propagate' => $propagate,
'other' => $other 'other' => $other,
'password' => io_safe_input($group_pass)
); );
$result = db_process_sql_insert('tgrupo', $values); $result = db_process_sql_insert('tgrupo', $values);
@ -228,6 +230,7 @@ if ($update_group) {
$icon = (string) get_parameter ('icon'); $icon = (string) get_parameter ('icon');
$id_parent = (int) get_parameter ('id_parent'); $id_parent = (int) get_parameter ('id_parent');
$description = (string) get_parameter ('description'); $description = (string) get_parameter ('description');
$group_pass = (string)get_parameter('group_pass');
$alerts_enabled = (bool) get_parameter ('alerts_enabled'); $alerts_enabled = (bool) get_parameter ('alerts_enabled');
$custom_id = (string) get_parameter ('custom_id'); $custom_id = (string) get_parameter ('custom_id');
$propagate = (bool) get_parameter('propagate'); $propagate = (bool) get_parameter('propagate');
@ -241,9 +244,9 @@ if ($update_group) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s", $sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s", contact = "%s", other = "%s" icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s", contact = "%s", other = "%s", password = "%s"
WHERE id_grupo = %d', WHERE id_grupo = %d',
$name, empty($icon) ? '' : substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $contact, $other, $id_group); $name, empty($icon) ? '' : substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $contact, $other, $group_pass, $id_group);
break; break;
case "postgresql": case "postgresql":
case "oracle": case "oracle":

View File

@ -52,7 +52,6 @@ $id_group = (int) get_parameter ('id_group');
$id_agents = get_parameter ('id_agents'); $id_agents = get_parameter ('id_agents');
$id_alert_templates = (array) get_parameter ('id_alert_templates'); $id_alert_templates = (array) get_parameter ('id_alert_templates');
$recursion = get_parameter ('recursion'); $recursion = get_parameter ('recursion');
$add = (bool) get_parameter_post ('add'); $add = (bool) get_parameter_post ('add');
if ($add) { if ($add) {
@ -64,45 +63,61 @@ if ($add) {
$fires_max = (int) get_parameter ('fires_max'); $fires_max = (int) get_parameter ('fires_max');
if (!empty($actions)) { if (!empty($actions)) {
$agent_alerts = agents_get_alerts($id_agents); $modules = get_parameter ('module');
$cont = 0; $modules_id = array();
$agent_alerts_id = array(); if (!empty($modules)) {
foreach ($agent_alerts['simple'] as $agent_alert) { foreach ($modules as $module) {
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) { foreach ($id_agents as $id_agent) {
$agent_alerts_id[$cont] = $agent_alert['id']; $module_id = modules_get_agentmodule_id($module, $id_agent);
$cont = $cont + 1; $modules_id[] = $module_id['id_agente_modulo'];
}
}
$options = array();
if ($fires_min > 0)
$options['fires_min'] = $fires_min;
if ($fires_max > 0)
$options['fires_max'] = $fires_max;
if (empty($agent_alerts_id)) {
ui_print_result_message (false, '', __('Could not be added').". ".__('No alerts selected'));
}
else {
$results = true;
foreach ($agent_alerts_id as $agent_alert_id) {
foreach ($actions as $action) {
$result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options);
if ($result === false)
$results = false;
} }
} }
db_pandora_audit("Massive management", "Add alert action " . json_encode($id_agents), false, false, 'Agents: ' . $agent_alerts = agents_get_alerts($id_agents);
json_encode($id_agents) . ' Alerts : ' . json_encode($agent_alerts) . $cont = 0;
' Fires Min: ' . $fires_min . ' Fires Max: ' . $fires_max . ' Actions: ' . implode(',',$actions)); $agent_alerts_id = array();
ui_print_result_message ($results, __('Successfully added'), __('Could not be added')); foreach ($agent_alerts['simple'] as $agent_alert) {
if ((in_array($agent_alert['id_alert_template'], $id_alert_templates)) && (in_array($agent_alert['id_agent_module'], $modules_id))) {
$agent_alerts_id[$cont] = $agent_alert['id'];
$cont += 1;
}
}
$options = array();
if ($fires_min > 0)
$options['fires_min'] = $fires_min;
if ($fires_max > 0)
$options['fires_max'] = $fires_max;
if (empty($agent_alerts_id)) {
ui_print_result_message (false, '', __('Could not be added').". ".__('No alerts selected'));
}
else {
$results = true;
foreach ($agent_alerts_id as $agent_alert_id) {
foreach ($actions as $action) {
$result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options);
if ($result === false)
$results = false;
}
}
db_pandora_audit("Massive management", "Add alert action " . json_encode($id_agents), false, false, 'Agents: ' .
json_encode($id_agents) . ' Alerts : ' . json_encode($agent_alerts) .
' Fires Min: ' . $fires_min . ' Fires Max: ' . $fires_max . ' Actions: ' . implode(',',$actions));
ui_print_result_message ($results, __('Successfully added'), __('Could not be added'));
}
}
else {
ui_print_result_message (false, '', __('Could not be added').". ".__('No modules selected'));
} }
} }
else { else {
ui_print_result_message (false, '', __('Could not be added').". ".__('No action selected')); ui_print_result_message (false, '', __('Could not be added').". ".__('No actions selected'));
} }
} }
@ -150,6 +165,15 @@ $table->data[2][0] .= '<span id="template_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true); $table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>'; $table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select (array(), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0); $table->data[2][1] = html_print_select (array(), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
$table->data[2][2] = __('When select agents');
$table->data[2][2] .= '<br>';
$table->data[2][2] .= html_print_select (
array('common' => __('Show common modules'),
'all' => __('Show all modules'),'unknown' => __('Show unknown and not init modules')),
'modules_selection_mode',
'common', false, '', '', true);
$table->data[2][3] = html_print_select (array(), 'module[]',
$modules_select, false, '', '', true, true, false);
$actions = alerts_get_alert_actions (); $actions = alerts_get_alert_actions ();
$table->data[3][0] = __('Action'); $table->data[3][0] = __('Action');
@ -233,6 +257,12 @@ $(document).ready (function () {
update_alerts(); update_alerts();
}); });
$("#id_alert_templates").change(alert_templates_changed_by_multiple_agents_with_alerts);
$("#modules_selection_mode").click(function () {
$("#id_alert_templates").trigger("change");
});
function update_alerts() { function update_alerts() {
var idAgents = Array(); var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) { jQuery.each ($("#id_agents option:selected"), function (i, val) {

View File

@ -58,52 +58,65 @@ if ($delete) {
$actions = get_parameter ('action'); $actions = get_parameter ('action');
if (!empty($actions)) { if (!empty($actions)) {
$agent_alerts = agents_get_alerts($id_agents); $modules = (array) get_parameter ('module');
$modules_id = array();
$alerts_agent_modules = array(); if (!empty($modules)) {
foreach ($agent_alerts['simple'] as $agent_alert) { foreach ($modules as $module) {
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) { foreach ($id_agents as $id_agent) {
$alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id')); $module_id = modules_get_agentmodule_id($module, $id_agent);
$modules_id[] = $module_id['id_agente_modulo'];
}
} }
}
$agent_alerts = agents_get_alerts($id_agents);
if (empty($alerts_agent_modules)) { $alerts_agent_modules = array();
ui_print_result_message (false, '', foreach ($agent_alerts['simple'] as $agent_alert) {
__('Could not be deleted. No alerts selected')); if ((in_array($agent_alert['id_alert_template'], $id_alert_templates)) && (in_array($agent_alert['id_agent_module'], $modules_id))) {
} $alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id'));
else {
$results = true;
$agent_module_actions = array();
foreach ($alerts_agent_modules as $alert_agent_module) {
$agent_module_actions = alerts_get_alert_agent_module_actions ($alert_agent_module['id'], array('id','id_alert_action'));
foreach ($agent_module_actions as $agent_module_action) {
foreach ($actions as $action) {
if ($agent_module_action['id_alert_action'] == $action) {
$result = alerts_delete_alert_agent_module_action ($agent_module_action['id']);
if ($result === false)
$results = false;
}
}
} }
} }
if ($results) { if (empty($alerts_agent_modules)) {
db_pandora_audit("Massive management", "Delete alert action", false, false, ui_print_result_message (false, '',
'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) . __('Could not be deleted. No alerts selected'));
' Actions: ' . implode(',',$actions));
} }
else { else {
db_pandora_audit("Massive management", "Fail try to delete alert action", false, false, $results = true;
'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) . $agent_module_actions = array();
' Actions: ' . implode(',',$actions));
foreach ($alerts_agent_modules as $alert_agent_module) {
$agent_module_actions = alerts_get_alert_agent_module_actions ($alert_agent_module['id'], array('id','id_alert_action'));
foreach ($agent_module_actions as $agent_module_action) {
foreach ($actions as $action) {
if ($agent_module_action['id_alert_action'] == $action) {
$result = alerts_delete_alert_agent_module_action ($agent_module_action['id']);
if ($result === false)
$results = false;
}
}
}
}
if ($results) {
db_pandora_audit("Massive management", "Delete alert action", false, false,
'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) .
' Actions: ' . implode(',',$actions));
}
else {
db_pandora_audit("Massive management", "Fail try to delete alert action", false, false,
'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) .
' Actions: ' . implode(',',$actions));
}
ui_print_result_message ($results,
__('Successfully deleted'),
__('Could not be deleted'));
} }
}
ui_print_result_message ($results, else {
__('Successfully deleted'), ui_print_result_message (false, '', __('Could not be added').". ".__('No modules selected'));
__('Could not be deleted'));
} }
} }
else { else {
@ -143,9 +156,6 @@ $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion,
true, false); true, false);
$table->data[1][0] = __('Agents with templates'); $table->data[1][0] = __('Agents with templates');
$table->data[1][0] .= '<span id="agent_loading" class="invisible">';
$table->data[1][0] .= html_print_image('images/spinner.png', true);
$table->data[1][0] .= '</span>';
$table->data[1][1] = html_print_select (array(),'id_agents[]', 0, false, '', '', true, true); $table->data[1][1] = html_print_select (array(),'id_agents[]', 0, false, '', '', true, true);
if (empty($id_agents)) { if (empty($id_agents)) {
@ -155,10 +165,17 @@ else {
$alert_templates = agents_get_alerts_simple ($id_agents); $alert_templates = agents_get_alerts_simple ($id_agents);
} }
$table->data[2][0] = __('Alert templates'); $table->data[2][0] = __('Alert templates');
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select (index_array ($alert_templates, 'id_alert_template', 'template_name'), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0); $table->data[2][1] = html_print_select (index_array ($alert_templates, 'id_alert_template', 'template_name'), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
$table->data[2][2] = __('When select agents');
$table->data[2][2] .= '<br>';
$table->data[2][2] .= html_print_select (
array('common' => __('Show common modules'),
'all' => __('Show all modules'),'unknown' => __('Show unknown and not init modules')),
'modules_selection_mode',
'common', false, '', '', true);
$table->data[2][3] = html_print_select (array(), 'module[]',
$modules_select, false, '', '', true, true, false);
$actions = alerts_get_alert_actions (); $actions = alerts_get_alert_actions ();
$table->data[3][0] = __('Action'); $table->data[3][0] = __('Action');
@ -221,6 +238,12 @@ $(document).ready (function () {
update_alerts(); update_alerts();
}); });
$("#id_alert_templates").change(alert_templates_changed_by_multiple_agents_with_alerts);
$("#modules_selection_mode").click(function () {
$("#id_alert_templates").trigger("change");
});
function update_alerts() { function update_alerts() {
var idAgents = Array(); var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) { jQuery.each ($("#id_agents option:selected"), function (i, val) {

View File

@ -480,9 +480,17 @@ $table->data['edit3'][2] = __('SMNP community');
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '', $table->data['edit3'][3] = html_print_input_text ('snmp_community', '',
'', 10, 15, true); '', 10, 15, true);
$target_ip_values = array();
$target_ip_values['auto'] = __('Auto');
$target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom');
$table->data['edit35'][0] = __('Target IP'); $table->data['edit35'][0] = __('Target IP');
$table->data['edit35'][1] = html_print_input_text ('ip_target', '', '', $table->data['edit35'][1] = html_print_select ($target_ip_values,
15, 60, true); 'ip_target', '', '', __('No change'), '', true, false, false, '', false, 'width:200px;');
$table->data['edit35'][1] .= html_print_input_text ('custom_ip_target', '', '', 15, 60, true);
$table->data['edit35'][2] = __('SNMP version'); $table->data['edit35'][2] = __('SNMP version');
$table->data['edit35'][3] = html_print_select ($snmp_versions, $table->data['edit35'][3] = html_print_select ($snmp_versions,
'tcp_send', '', '', __('No change'), '', true, false, false, ''); 'tcp_send', '', '', __('No change'), '', true, false, false, '');
@ -647,6 +655,7 @@ $(document).ready (function () {
} }
}); });
$("#text-custom_ip_target").hide();
$("#id_agents").change(agent_changed_by_multiple_agents); $("#id_agents").change(agent_changed_by_multiple_agents);
$("#module_name").change(module_changed_by_multiple_modules); $("#module_name").change(module_changed_by_multiple_modules);
@ -929,6 +938,15 @@ $(document).ready (function () {
} }
}); });
$('#ip_target').change(function() {
if($(this).val() == 'custom') {
$("#text-custom_ip_target").show();
}
else{
$("#text-custom_ip_target").hide();
}
});
var recursion; var recursion;
$("#checkbox-recursion").click(function () { $("#checkbox-recursion").click(function () {
@ -1062,7 +1080,7 @@ function process_manage_edit ($module_name, $agents_select = null) {
'id_export', 'history_data', 'critical_inverse', 'id_export', 'history_data', 'critical_inverse',
'warning_inverse', 'critical_instructions', 'warning_inverse', 'critical_instructions',
'warning_instructions', 'unknown_instructions', 'policy_linked', 'warning_instructions', 'unknown_instructions', 'policy_linked',
'id_category', 'disabled_types_event', 'ip_target', 'id_category', 'disabled_types_event', 'ip_target', "custom_ip_target",
'descripcion', 'min_ff_event_normal', 'min_ff_event_warning', 'descripcion', 'min_ff_event_normal', 'min_ff_event_warning',
'min_ff_event_critical', 'each_ff', 'module_ff_interval', 'min_ff_event_critical', 'each_ff', 'module_ff_interval',
'ff_timeout', 'max_timeout'); 'ff_timeout', 'max_timeout');

View File

@ -134,24 +134,23 @@ else{
$table->data[5][0] = __('Size - (Width x Height)'); $table->data[5][0] = __('Size - (Width x Height)');
$table->data[5][1] = html_print_input_text('width', 1024, '', 10, 10, true , true) .
if($action == 'new'){
$table->data[5][1] = '<button id="modsize" style="margin-right:20px;" value="modsize">Set custom size</button>';
}
else{
$table->data[5][1] = '<button id="modsize" style="margin-right:20px;" value="modsize">Set custom size</button>';
}
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.html_print_input_text('width', 1024, '', 10, 10, true , false) .
' x ' . ' x ' .
html_print_input_text('height', 768, '', 10, 10, true, true); html_print_input_text('height', 768, '', 10, 10, true, false).'</span>';
if($action == 'new'){ if($action == 'new'){
$table->data[5][1] .= '<button disabled id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'; $table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.'<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'.'</span>';
} }
else{ else{
$table->data[5][1] .= '<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'; $table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.'<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'.'</span>';
}
$table->data[5][1] .= ui_print_help_tip(__("You must define size"), true);
if($action == 'new'){
$table->data[5][1] .= '<button disabled id="modsize" style="margin-left:20px;" value="modsize">Set other size</button><span style="margin-left:20px;" id="modsizetext">Disabled</span>';
}
else{
$table->data[5][1] .= '<button id="modsize" style="margin-left:20px;" value="modsize">Set other size</button><span style="margin-left:20px;" id="modsizetext">Disabled</span>';
} }
$table->data[5][2] = '<img id="imagen" style="display:none" src="images/console/background/'.$background.'">'; $table->data[5][2] = '<img id="imagen" style="display:none" src="images/console/background/'.$background.'">';
@ -191,46 +190,39 @@ $(document).ready (function () {
$("#modsize").click(function(event){ $("#modsize").click(function(event){
event.preventDefault(); event.preventDefault();
if($('input[name=width]').attr('readonly')){
$('input[name=width]').attr('readonly',false);
$('input[name=height]').attr('readonly',false);
$('#modsizetext').html('Enabled');
$('input[name=update_layout]').attr('disabled',false);
}
else{
$('input[name=width]').attr('readonly',true);
$('input[name=height]').attr('readonly',true);
$('#modsizetext').html('Disabled');
$('input[name=update_layout]').attr('enabled',false);
}
if($('.opt').css('visibility') == 'hidden'){
$('.opt').css('visibility','visible');
}
$('input[name=width]').val($('#imagen').width()); $('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height()); $('input[name=height]').val($('#imagen').height());
}); });
$("#getsize").click(function(event){ $("#getsize").click(function(event){
event.preventDefault(); event.preventDefault();
$('input[name=update_layout]').attr('disabled',false);
$('input[name=width]').val($('#imagen').width()); $('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height()); $('input[name=height]').val($('#imagen').height());
}); });
$("#background").click(function(event){ $("#background").click(function(event){
$('#imagen').attr('src','images/console/background/'+$('#background').val()); $('#imagen').attr('src','images/console/background/'+$('#background').val());
$('input[name=update_layout]').attr('disabled',true);
$("#getsize").attr('disabled',false);
$("#modsize").attr('disabled',false);
}); });
$( "input[type=submit]" ).click(function( event ) {
if($( "#getsize" ).css('visibility')=='hidden'){
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
}
});
$("#file-background_image").change(function(event){ $("#file-background_image").change(function(event){
$('#back').submit(); $('#back').submit();
}); });

View File

@ -77,8 +77,8 @@ if (!defined('METACONSOLE')) {
else { else {
echo '<div id="frame_view" style="overflow: auto; margin: 0px auto; padding: 5px; ">'; echo '<div id="frame_view" style="overflow: auto; margin: 0px auto; padding: 5px; ">';
} }
echo '<div id="background" class="" style=" echo '<div id="background" class="" style="top:50px;
margin: 0px auto;border: 2px black solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">'; margin: 0px auto;border: 1px lightgray solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
echo "<div id='background_grid' echo "<div id='background_grid'
style='position: absolute; display: none; overflow: hidden; style='position: absolute; display: none; overflow: hidden;
background: url(" . ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false) . "); background: url(" . ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false) . ");
@ -195,6 +195,8 @@ ui_require_javascript_file ('encode_decode_base64');
"4pt=.visual_font_size_4pt, " + "4pt=.visual_font_size_4pt, " +
"6pt=.visual_font_size_6pt, " + "6pt=.visual_font_size_6pt, " +
"8pt=.visual_font_size_8pt, " + "8pt=.visual_font_size_8pt, " +
"10pt=.visual_font_size_10pt, " +
"12pt=.visual_font_size_12pt, " +
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +
@ -218,4 +220,29 @@ ui_require_javascript_file ('encode_decode_base64');
element_format : "html", element_format : "html",
editor_deselector : "noselected" editor_deselector : "noselected"
}); });
$('.item img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('#process_value').change(function(){
if($(this).val() == 0){
$('#period_row').css('display','none');
}
else{
$('#period_row').css('display','');
}
})
</script> </script>

View File

@ -590,6 +590,8 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
"4pt=.visual_font_size_4pt, " + "4pt=.visual_font_size_4pt, " +
"6pt=.visual_font_size_6pt, " + "6pt=.visual_font_size_6pt, " +
"8pt=.visual_font_size_8pt, " + "8pt=.visual_font_size_8pt, " +
"10pt=.visual_font_size_10pt, " +
"12pt=.visual_font_size_12pt, " +
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +

View File

@ -137,37 +137,48 @@ $table->data["staticgraph_modulegraph"][1] .= '&nbsp;&nbsp;&nbsp;' .
__('Height') . ': ' . __('Height') . ': ' .
html_print_input_text('height', 0, '', 5, 5, true); html_print_input_text('height', 0, '', 5, 5, true);
$fontf = array('andale mono,times' => 'Andale Mono', $fontf = array('Roboto' => 'Roboto',
'arial,helvetica,sans-serif' => 'Arial', 'lato' => 'Lato',
'arial black,avant garde' => 'Arial Black', 'opensans' => 'Open Sans',
'comic sans ms,sans-serif' => 'Comic Sans MS', 'nunito' => 'Nunito',
'courier new,courier' => 'Courier New', 'leaguegothic' => 'League Gothic'
'georgia,palatino' => 'Georgia',
'helvetica,impact' => 'Helvetica',
'impact,chicago' => 'Impact',
'symbol' => 'Symbol',
'tahoma,arial,helvetica,sans-serif' => 'Tahoma',
'terminal,monaco' => 'Terminal',
'times new roman,times' => 'Times New Roman',
'trebuchet ms,geneva' => 'Trebuchet MS',
'verdana,geneva' => 'Verdana',
'Webdings' => 'Webdings',
'Wingdings' => 'Wingdings'
); );
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','10pt' => '10pt','12pt' => '12pt','14pt' => '14pt','24pt' => '24pt','36pt' => '36pt','72pt' => '72pt','96pt' => '96pt','128pt' => '128pt','154pt' => '154pt','196pt' => '196pt');
/*
$fontf = array('andale mono,times' => 'Andale Mono',
'arial,helvetica,sans-serif' => 'Arial',
'arial black,avant garde' => 'Arial Black',
'comic sans ms,sans-serif' => 'Comic Sans MS',
'courier new,courier' => 'Courier New',
'georgia,palatino' => 'Georgia',
'helvetica,impact' => 'Helvetica',
'impact,chicago' => 'Impact',
'symbol' => 'Symbol',
'tahoma,arial,helvetica,sans-serif' => 'Tahoma',
'terminal,monaco' => 'Terminal',
'times new roman,times' => 'Times New Roman',
'trebuchet ms,geneva' => 'Trebuchet MS',
'verdana,geneva' => 'Verdana',
'Webdings' => 'Webdings',
'Wingdings' => 'Wingdings'
);
*/
$table->rowstyle['all_9'] = 'display: none;'; $table->rowstyle['all_9'] = 'display: none;';
$table->data['all_9'][0] = __('Font'); $table->data['all_9'][0] = __('Font');
$table->colspan['all_9'][1] = "3"; $table->colspan['all_9'][1] = "3";
$table->data["all_9"][1] = html_print_select($fontf, $table->data["all_9"][1] = html_print_select($fontf,
'fontf', '', '', '', '', true); 'fontf', $fontf['Roboto'], '', '', '', true);
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','14pt' => '14pt','24pt' => '24pt','36pt' => '36pt','72pt' => '72pt','96pt' => '96pt','128pt' => '128pt','154pt' => '154pt','196pt' => '196pt');
$table->rowstyle['all_10'] = 'display: none;'; $table->rowstyle['all_10'] = 'display: none;';
$table->data['all_10'][0] = __('Font size'); $table->data['all_10'][0] = __('Font size');
$table->colspan['all_10'][1] = "3"; $table->colspan['all_10'][1] = "3";
$table->data["all_10"][1] = html_print_select($fonts, $table->data["all_10"][1] = html_print_select($fonts,
'fonts', '', '', '', '', true); 'fonts', $fonts['12pt'], '', '', '', true);
$table->rowstyle["modulegraph_simplevalue"] = 'display: none;'; $table->rowstyle["modulegraph_simplevalue"] = 'display: none;';

View File

@ -58,6 +58,10 @@ if (is_ajax ()) {
$row['control'] = __('Yes').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 1, '', $config['autocreate_remote_users'], false, '', '', true).'&nbsp;&nbsp;'; $row['control'] = __('Yes').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 1, '', $config['autocreate_remote_users'], false, '', '', true).'&nbsp;&nbsp;';
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true); $row['control'] .= __('No').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true);
$table->data['autocreate_remote_users'] = $row; $table->data['autocreate_remote_users'] = $row;
if (enterprise_installed()) {
add_enterprise_auth_autocreate_profiles($table, $type_auth);
}
} }
switch ($type_auth) { switch ($type_auth) {

View File

@ -334,6 +334,14 @@ $table_font->data[$row][1] = html_print_input_text('item_title_size_text',
$config["item_title_size_text"], '', 3, 3, true); $config["item_title_size_text"], '', 3, 3, true);
$row++; $row++;
$table_font->data[$row][0] = __('Show units in values report') .
ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true);
$table_font->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('simple_module_value', 1, '', $config["simple_module_value"], true).'&nbsp;&nbsp;';
$table_font->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('simple_module_value', 0, '', $config["simple_module_value"], true);
$row++;
echo "<fieldset>"; echo "<fieldset>";
echo "<legend>" . __('Font and Text configuration') . "</legend>"; echo "<legend>" . __('Font and Text configuration') . "</legend>";
html_print_table ($table_font); html_print_table ($table_font);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -73,9 +73,6 @@ if (is_ajax ()) {
if (is_metaconsole()) { if (is_metaconsole()) {
$server_id = (int) get_parameter('serverID'); $server_id = (int) get_parameter('serverID');
$server = metaconsole_get_servers($server_id); $server = metaconsole_get_servers($server_id);
if (metaconsole_connect($server) != NOERR)
return;
} }
ob_clean(); ob_clean();
@ -98,11 +95,7 @@ if (is_ajax ()) {
} }
} }
echo '<br></div>'; echo '<br></div>';
if (!empty($server) && is_metaconsole()) {
metaconsole_restore_db();
}
return; return;
} }

View File

@ -130,6 +130,7 @@ $get_element_status = get_parameter('get_element_status', 0);
$enable_link = get_parameter('enable_link', 1); $enable_link = get_parameter('enable_link', 1);
$type_graph = get_parameter('type_graph', 'area'); $type_graph = get_parameter('type_graph', 'area');
$label_position = get_parameter('label_position', 'down');
switch ($action) { switch ($action) {
case 'get_font': case 'get_font':
@ -394,6 +395,8 @@ switch ($action) {
case 'move': case 'move':
$values = array(); $values = array();
$values['label_position'] = $label_position;
// In Graphs, background color is stored in column image (sorry) // In Graphs, background color is stored in column image (sorry)
if ($type == 'module_graph') { if ($type == 'module_graph') {
$values['image'] = $background_color; $values['image'] = $background_color;
@ -505,6 +508,15 @@ switch ($action) {
break; break;
case 'group_item': case 'group_item':
$values['id_group'] = $id_group; $values['id_group'] = $id_group;
if ($image !== null) {
$values['image'] = $image;
}
if ($width !== null) {
$values['width'] = $width;
}
if ($height !== null) {
$values['height'] = $height;
}
break; break;
case 'module_graph': case 'module_graph':
if ($height_module_graph !== null) { if ($height_module_graph !== null) {
@ -570,6 +582,7 @@ switch ($action) {
if ($action == 'move') { if ($action == 'move') {
// Don't change the label because only change the positions // Don't change the label because only change the positions
unset($values['label']); unset($values['label']);
unset($values['label_position']);
// Don't change background color in graphs when move // Don't change background color in graphs when move
switch ($type) { switch ($type) {
@ -757,6 +770,7 @@ switch ($action) {
$values['label'] = $label; $values['label'] = $label;
$values['pos_x'] = $left; $values['pos_x'] = $left;
$values['pos_y'] = $top; $values['pos_y'] = $top;
$values['label_position'] = $label_position;
if (defined('METACONSOLE') && $metaconsole) { if (defined('METACONSOLE') && $metaconsole) {
if ($server_id > 0) { if ($server_id > 0) {
@ -933,6 +947,16 @@ switch ($action) {
$return['values']['width_box'] = $values['width']; $return['values']['width_box'] = $values['width'];
$return['values']['height_box'] = $values['height']; $return['values']['height_box'] = $values['height'];
break; break;
case PERCENTILE_BUBBLE:
$return['values']['type_percentile'] = 'bubble';
break;
case PERCENTILE_BAR:
$return['values']['type_percentile'] = 'percentile';
break;
} }
} }

View File

@ -268,7 +268,7 @@ function process_user_login_remote ($login, $pass, $api = false) {
return false; return false;
} }
if (isset($config['ad_advanced_config']) && $config['ad_advanced_config']) { if ($config["auth"] === 'ad' && (isset($config['ad_advanced_config']) && $config['ad_advanced_config'])) {
if ( defined('METACONSOLE') ) { if ( defined('METACONSOLE') ) {
@ -313,10 +313,40 @@ function process_user_login_remote ($login, $pass, $api = false) {
return false; return false;
} }
//TODO: Check the creation in the nodes
profile_create_user_profile ($login, $config['default_remote_profile'], profile_create_user_profile ($login, $config['default_remote_profile'],
$config['default_remote_group'], false, $config['default_assign_tags']); $config['default_remote_group'], false, $config['default_assign_tags']);
//TODO: Check the creation in the nodes
if ( is_metaconsole() ) {
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once ('meta/include/functions_groups_meta.php');
$return = groups_meta_synchronizing();
if ($return["group_create_err"] > 0 || $return["group_update_err"] > 0) {
$config["auth_error"] = __('Fail the group synchronizing');
return false;
}
$return = meta_tags_synchronizing();
if ($return['tag_create_err'] > 0 || $return['tag_update_err'] > 0) {
$config["auth_error"] = __('Fail the tag synchronizing');
return false;
}
$servers = metaconsole_get_servers();
foreach ($servers as $server) {
if (metaconsole_connect($server) == NOERR ) {
if (create_user ($login, $pass,
array ('fullname' => $login,
'comments' => 'Imported from ' . $config['auth'])
) === false)
continue;
profile_create_user_profile ($login, $config['default_remote_profile'],
$config['default_remote_group'], false, $config['default_assign_tags']);
}
metaconsole_restore_db();
}
}
} }
return $login; return $login;

View File

@ -234,7 +234,7 @@ class Tree {
// Agent name filter // Agent name filter
$agent_search_filter = ""; $agent_search_filter = "";
if (!empty($this->filter['searchAgent'])) { if (!empty($this->filter['searchAgent'])) {
$agent_search_filter = " AND ta.nombre LIKE '%".$this->filter['searchAgent']."%' "; $agent_search_filter = " AND LOWER(ta.nombre) LIKE LOWER('%".$this->filter['searchAgent']."%')";
} }
// Agent status filter // Agent status filter

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC170111'; $build_version = 'PC170118';
$pandora_version = 'v7.0dev'; $pandora_version = 'v7.0dev';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -494,6 +494,8 @@ function config_update_config () {
$error_update[] = __('Item title size text'); $error_update[] = __('Item title size text');
if (!config_update_value ('gis_label', get_parameter ('gis_label'))) if (!config_update_value ('gis_label', get_parameter ('gis_label')))
$error_update[] = __('GIS Labels'); $error_update[] = __('GIS Labels');
if (!config_update_value ('simple_module_value', get_parameter ('simple_module_value')))
$error_update[] = __('Show units in values report');
if (!config_update_value ('gis_default_icon', get_parameter ('gis_default_icon'))) if (!config_update_value ('gis_default_icon', get_parameter ('gis_default_icon')))
$error_update[] = __('Default icon in GIS'); $error_update[] = __('Default icon in GIS');
if (!config_update_value ('autohidden_menu', get_parameter('autohidden_menu'))) if (!config_update_value ('autohidden_menu', get_parameter('autohidden_menu')))
@ -1476,6 +1478,10 @@ function config_process_config () {
if (!isset($config['item_title_size_text'])) { if (!isset($config['item_title_size_text'])) {
config_update_value ('item_title_size_text', 45); config_update_value ('item_title_size_text', 45);
} }
if (!isset($config['simple_module_value'])) {
config_update_value ('simple_module_value', 1);
}
if (!isset($config['gis_label'])) { if (!isset($config['gis_label'])) {
config_update_value ('gis_label', 0); config_update_value ('gis_label', 0);

View File

@ -1832,42 +1832,113 @@ function graphic_combined_module ($module_list, $weight_list, $period,
'color' => COL_GRAPH13, 'color' => COL_GRAPH13,
'alpha' => CHART_DEFAULT_ALPHA); 'alpha' => CHART_DEFAULT_ALPHA);
$yellow_threshold = 0; $threshold_data = array();
$red_threshold = 0;
if ($from_interface) { if ($from_interface) {
$compare_warning = 0; $yellow_threshold = 0;
$compare_critical = 0; $red_threshold = 0;
$do_it_warning = true;
$do_it_critical = true; $yellow_up = 0;
foreach ($module_list as $id_module) { $red_up = 0;
// Get module warning_max and critical_max
$warning_max = db_get_value('max_warning','tagente_modulo','id_agente_modulo',$id_module); $yellow_inverse = 0;
$critical_max = db_get_value('max_critical','tagente_modulo','id_agente_modulo',$id_module); $red_inverse = 0;
if ($compare_warning == 0) { $compare_warning = false;
$compare_warning = $warning_max; $compare_critical = false;
$do_it_warning_min = true;
$do_it_critical_min = true;
$do_it_warning_max = true;
$do_it_critical_max = true;
$do_it_warning_inverse = true;
$do_it_critical_inverse = true;
foreach ($module_list as $index => $id_module) {
// Get module warning_min and critical_min
$warning_min = db_get_value('min_warning','tagente_modulo','id_agente_modulo',$id_module);
$critical_min = db_get_value('min_critical','tagente_modulo','id_agente_modulo',$id_module);
if ($index == 0) {
$compare_warning = $warning_min;
} }
else { else {
if ($compare_warning != $warning_max) { if ($compare_warning != $warning_min) {
$do_it_warning = false; $do_it_warning_min = false;
} }
} }
if ($compare_critical == 0) {
$compare_critical = $critical_max; if ($index == 0) {
$compare_critical = $critical_min;
} }
else { else {
if ($compare_warning != $critical_max) { if ($compare_critical != $critical_min) {
$do_it_critical = false; $do_it_critical_min = false;
} }
} }
} }
if ($do_it_warning) { if ($do_it_warning_min || $do_it_critical_min) {
foreach ($module_list as $index => $id_module) {
$warning_max = db_get_value('max_warning','tagente_modulo','id_agente_modulo',$id_module);
$critical_max = db_get_value('max_critical','tagente_modulo','id_agente_modulo',$id_module);
if ($index == 0) {
$yellow_up = $warning_max;
}
else {
if ($yellow_up != $warning_max) {
$do_it_warning_max = false;
}
}
if ($index == 0) {
$red_up = $critical_max;
}
else {
if ($red_up != $critical_max) {
$do_it_critical_max = false;
}
}
}
}
if ($do_it_warning_min || $do_it_critical_min) {
foreach ($module_list as $index => $id_module) {
$warning_inverse = db_get_value('warning_inverse','tagente_modulo','id_agente_modulo',$id_module);
$critical_inverse = db_get_value('critical_inverse','tagente_modulo','id_agente_modulo',$id_module);
if ($index == 0) {
$yellow_inverse = $warning_inverse;
}
else {
if ($yellow_inverse != $warning_inverse) {
$do_it_warning_inverse = false;
}
}
if ($index == 0) {
$red_inverse = $critical_inverse;
}
else {
if ($red_inverse != $critical_inverse) {
$do_it_critical_inverse = false;
}
}
}
}
if ($do_it_warning_min && $do_it_warning_max && $do_it_warning_inverse) {
$yellow_threshold = $compare_warning; $yellow_threshold = $compare_warning;
$threshold_data['yellow_up'] = $yellow_up;
$threshold_data['yellow_inverse'] = (bool)$yellow_inverse;
} }
if ($do_it_critical) { if ($do_it_critical_min && $do_it_critical_max && $do_it_critical_inverse) {
$red_threshold = $compare_critical; $red_threshold = $compare_critical;
$threshold_data['red_up'] = $red_up;
$threshold_data['red_inverse'] = (bool)$red_inverse;
} }
} }
@ -1878,7 +1949,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
ui_get_full_url("images/image_problem.opaque.png", false, false, false), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
$title, "", $homeurl, $water_mark, $config['fontpath'], $title, "", $homeurl, $water_mark, $config['fontpath'],
$fixed_font_size, $unit, $ttl, array(), array(), $yellow_threshold, $red_threshold, '', $fixed_font_size, $unit, $ttl, array(), array(), $yellow_threshold, $red_threshold, '',
false, '', true, $background_color,$dashboard, $vconsole, 0, $percentil_result); false, '', true, $background_color,$dashboard, $vconsole, 0, $percentil_result, $threshold_data);
break; break;
default: default:
case CUSTOM_GRAPH_STACKED_AREA: case CUSTOM_GRAPH_STACKED_AREA:
@ -1894,7 +1965,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
ui_get_full_url("images/image_problem.opaque.png", false, false, false), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
$title, "", $water_mark, $config['fontpath'], $fixed_font_size, $title, "", $water_mark, $config['fontpath'], $fixed_font_size,
$unit, $ttl, $homeurl, $background_color, $dashboard, $unit, $ttl, $homeurl, $background_color, $dashboard,
$vconsole, $series_type, $percentil_result, $yellow_threshold, $red_threshold); $vconsole, $series_type, $percentil_result, $yellow_threshold, $red_threshold, $threshold_data);
break; break;
case CUSTOM_GRAPH_STACKED_LINE: case CUSTOM_GRAPH_STACKED_LINE:
return stacked_line_graph($flash_charts, $graph_values, return stacked_line_graph($flash_charts, $graph_values,

View File

@ -411,9 +411,19 @@ function modules_update_agent_module ($id, $values,
return ERR_EXIST; return ERR_EXIST;
} }
} }
if(isset ($values['ip_target'])){
if($values['ip_target'] == 'force_pri'){
$sql_agent = "SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo=" . $id;
$id_agente = mysql_db_process_sql($sql_agent);
$values['ip_target'] = agents_get_address ($id_agente);
}
elseif($values['ip_target'] == 'custom'){
$values['ip_target'] = $values['custom_ip_target'];
}
}
unset($values['custom_ip_target']);
$where = array(); $where = array();
$where['id_agente_modulo'] = $id; $where['id_agente_modulo'] = $id;
if ($onlyNoDeletePending) { if ($onlyNoDeletePending) {

View File

@ -3697,18 +3697,33 @@ function reporting_value($report, $content, $type) {
break; break;
case 'min': case 'min':
$value = reporting_get_agentmodule_data_min( $value = reporting_get_agentmodule_data_min(
$content['id_agent_module'], $content['period'], $report["datetime"]); $content['id_agent_module'], $content['period'], $report["datetime"]);
$formated_value = format_for_graph($value, 2) . " " . $unit; if (!$config['simple_module_value']) {
$formated_value = $value;
}
else {
$formated_value = format_for_graph($value, 2) . " " . $unit;
}
break; break;
case 'avg': case 'avg':
$value = reporting_get_agentmodule_data_average( $value = reporting_get_agentmodule_data_average(
$content['id_agent_module'], $content['period'], $report["datetime"]); $content['id_agent_module'], $content['period'], $report["datetime"]);
$formated_value = format_for_graph($value, 2) . " " . $unit; if (!$config['simple_module_value']) {
$formated_value = $value;
}
else {
$formated_value = format_for_graph($value, 2) . " " . $unit;
}
break; break;
case 'sum': case 'sum':
$value = reporting_get_agentmodule_data_sum( $value = reporting_get_agentmodule_data_sum(
$content['id_agent_module'], $content['period'], $report["datetime"]); $content['id_agent_module'], $content['period'], $report["datetime"]);
$formated_value = format_for_graph($value, 2) . " " . $unit; if (!$config['simple_module_value']) {
$formated_value = $value;
}
else {
$formated_value = format_for_graph($value, 2) . " " . $unit;
}
break; break;
case 'MTTR': case 'MTTR':
$value = reporting_get_agentmodule_mttr( $value = reporting_get_agentmodule_mttr(
@ -4817,7 +4832,7 @@ function reporting_availability($report, $content, $date=false, $time=false) {
$aux_id_agents = $agents; $aux_id_agents = $agents;
$i=0; $i=0;
foreach ($items as $item) { foreach ($items as $item) {
$utimestamp = db_get_value('utimestamp', 'tagente_datos', 'id_agente_modulo', $item['id_agent_module']); $utimestamp = db_get_value('utimestamp', 'tagente_datos', 'id_agente_modulo', $item['id_agent_module'], true);
if (($utimestamp === false) || (intval($utimestamp) > intval($datetime_to))){ if (($utimestamp === false) || (intval($utimestamp) > intval($datetime_to))){
unset($items[$i]); unset($items[$i]);
} }

View File

@ -38,7 +38,14 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
enterprise_include_once ('meta/include/functions_modules_meta.php'); enterprise_include_once ('meta/include/functions_modules_meta.php');
enterprise_include_once ('meta/include/functions_ui_meta.php'); enterprise_include_once ('meta/include/functions_ui_meta.php');
enterprise_include_once ('meta/include/functions_metaconsole.php'); enterprise_include_once ('meta/include/functions_metaconsole.php');
$user_access_node = can_user_access_node ();
if (is_metaconsole()) {
if (metaconsole_connect($server_data) != NOERR)
return;
}
$filter["id_agente_modulo"] = $id_module; $filter["id_agente_modulo"] = $id_module;
$module = db_get_row_filter ("tagente_modulo", $filter); $module = db_get_row_filter ("tagente_modulo", $filter);
@ -47,14 +54,7 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
ui_print_error_message(__('There was a problem loading module')); ui_print_error_message(__('There was a problem loading module'));
return; return;
} }
/*if (! check_acl ($config["id_user"], $module["id_grupo"], "AR")) {
db_pandora_audit("ACL Violation",
"Trying to access Module Information");
require_once ("general/noaccess.php");
return;
}*/
$table = new StdClass(); $table = new StdClass();
$table->width = "100%"; $table->width = "100%";
$table->class = "databox data"; $table->class = "databox data";
@ -68,24 +68,24 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$table->head_colspan[] = 2; $table->head_colspan[] = 2;
$table->data = array(); $table->data = array();
//Module name //Module name
if ($module["disabled"]) if ($module["disabled"])
$cellName = "<em>" . ui_print_truncate_text ($module["nombre"], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]',"text-transform: uppercase;") . ui_print_help_tip(__('Disabled'), true) . "<em>"; $cellName = "<em>" . ui_print_truncate_text ($module["nombre"], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]',"text-transform: uppercase;") . ui_print_help_tip(__('Disabled'), true) . "<em>";
else else
$cellName = ui_print_truncate_text ($module["nombre"], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]',"text-transform: uppercase;"); $cellName = ui_print_truncate_text ($module["nombre"], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]',"text-transform: uppercase;");
$row = array(); $row = array();
$row['title'] = __('Name'); $row['title'] = __('Name');
$row['data'] = "<b>".$cellName."</b>"; $row['data'] = "<b>".$cellName."</b>";
$table->data['name'] = $row; $table->data['name'] = $row;
// Interval // Interval
$row = array(); $row = array();
$row['title'] = __('Interval'); $row['title'] = __('Interval');
$row['data'] = human_time_description_raw (modules_get_interval($module['id_agente_modulo']), true); $row['data'] = human_time_description_raw (modules_get_interval($module['id_agente_modulo']), true);
$table->data['interval'] = $row; $table->data['interval'] = $row;
// Warning Min/Max // Warning Min/Max
if (modules_is_string_type($module['id_tipo_modulo'])) { if (modules_is_string_type($module['id_tipo_modulo'])) {
$warning_status_str = __('Str.') . ': ' . $module['str_warning']; $warning_status_str = __('Str.') . ': ' . $module['str_warning'];
@ -93,12 +93,12 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
else { else {
$warning_status_str = __('Min.') . ': ' . (float)$module['min_warning'] . '<br>' . __('Max.') . ': ' . (float)$module['max_warning']; $warning_status_str = __('Min.') . ': ' . (float)$module['min_warning'] . '<br>' . __('Max.') . ': ' . (float)$module['max_warning'];
} }
$row = array(); $row = array();
$row['title'] = __('Warning status'); $row['title'] = __('Warning status');
$row['data'] = $warning_status_str; $row['data'] = $warning_status_str;
$table->data['watning_status'] = $row; $table->data['watning_status'] = $row;
// Critical Min/Max // Critical Min/Max
if (modules_is_string_type($module['id_tipo_modulo'])) { if (modules_is_string_type($module['id_tipo_modulo'])) {
$critical_status_str = __('Str.') . ': ' . $module['str_warning']; $critical_status_str = __('Str.') . ': ' . $module['str_warning'];
@ -110,7 +110,7 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$row['title'] = __('Critical status'); $row['title'] = __('Critical status');
$row['data'] = $critical_status_str; $row['data'] = $critical_status_str;
$table->data['critical_status'] = $row; $table->data['critical_status'] = $row;
// Module group // Module group
$module_group = modules_get_modulegroup_name($module['id_module_group']); $module_group = modules_get_modulegroup_name($module['id_module_group']);
@ -118,31 +118,32 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$module_group = __('Not assigned'); $module_group = __('Not assigned');
else else
$module_group = __("$module_group"); $module_group = __("$module_group");
$row = array(); $row = array();
$row['title'] = __('Module group'); $row['title'] = __('Module group');
$row['data'] = $module_group; $row['data'] = $module_group;
$table->data['module_group'] = $row; $table->data['module_group'] = $row;
// Description // Description
$row = array(); $row = array();
$row['title'] = __('Description'); $row['title'] = __('Description');
$row['data'] = ui_print_truncate_text ($module['descripcion'], 'description', true, true, true, '[&hellip;]'); $row['data'] = ui_print_truncate_text ($module['descripcion'], 'description', true, true, true, '[&hellip;]');
$table->data['description'] = $row; $table->data['description'] = $row;
// Tags // Tags
$tags = tags_get_module_tags($module['id_agente_modulo']); $tags = tags_get_module_tags($module['id_agente_modulo']);
if (empty($tags)) { if (empty($tags)) {
$tags = array(); $tags = array();
} }
$user_tags = tags_get_user_tags($config["id_user"]); $user_tags = tags_get_user_tags($config["id_user"]);
foreach ($tags as $k => $v) { foreach ($tags as $k => $v) {
if (!array_key_exists($v, $user_tags)) { //only show user's tags. if (!array_key_exists($v, $user_tags)) { //only show user's tags.
unset($tags[$k]); unset($tags[$k]);
} else { }
else {
$tag_name = tags_get_name($v); $tag_name = tags_get_name($v);
if (empty($tag_name)) { if (empty($tag_name)) {
unset($tags[$k]); unset($tags[$k]);
@ -152,19 +153,19 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
} }
} }
} }
if (empty($tags)) { if (empty($tags)) {
$tags = '<i>' . __('N/A') . '</i>'; $tags = '<i>' . __('N/A') . '</i>';
} }
else { else {
$tags = implode(', ' , $tags); $tags = implode(', ' , $tags);
} }
$row = array(); $row = array();
$row['title'] = __('Tags'); $row['title'] = __('Tags');
$row['data'] = $tags; $row['data'] = $tags;
$table->data['tags'] = $row; $table->data['tags'] = $row;
// Data // Data
$last_data = db_get_row_filter ('tagente_estado', array('id_agente_modulo' => $module['id_agente_modulo'], 'order' => array('field' => 'id_agente_estado', 'order' => 'DESC'))); $last_data = db_get_row_filter ('tagente_estado', array('id_agente_modulo' => $module['id_agente_modulo'], 'order' => array('field' => 'id_agente_estado', 'order' => 'DESC')));
if ($config["render_proc"]) { if ($config["render_proc"]) {
@ -198,16 +199,18 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" .
remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>"; remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . $data = ui_print_truncate_text(io_safe_output($last_data['datos']),
substr(io_safe_output($last_data['datos']),0,12) . "</span>"; GENERIC_SIZE_TEXT, true, true,
true, '...', 'white-space: nowrap;');
break; break;
default: default:
if (is_numeric($last_data["datos"])) if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" .
remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>"; remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . $data = ui_print_truncate_text(io_safe_output($last_data['datos']),
substr(io_safe_output($last_data['datos']),0,12) . "</span>"; GENERIC_SIZE_TEXT, true, true,
true, '...', 'white-space: nowrap;');
break; break;
} }
break; break;
@ -225,17 +228,20 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" .
remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>"; remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . $data = ui_print_truncate_text(io_safe_output($last_data['datos']),
substr(io_safe_output($last_data['datos']),0,12) . "</span>"; GENERIC_SIZE_TEXT, true, true, true,
'...', 'white-space: nowrap;');
break; break;
default: default:
if (is_numeric($last_data["datos"])) if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" .
remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>"; remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . $data = ui_print_truncate_text(io_safe_output($last_data['datos']),
substr(io_safe_output($last_data['datos']),0,12) . "</span>"; GENERIC_SIZE_TEXT, true, true, true,
'...', 'white-space: nowrap;');
break; break;
}
} }
if (!empty($last_data['utimestamp'])) { if (!empty($last_data['utimestamp'])) {
$last_data_str = $data; $last_data_str = $data;
@ -287,20 +293,20 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
else { else {
$last_data_str = '<i>' . __('No data') . '</i>'; $last_data_str = '<i>' . __('No data') . '</i>';
} }
$row = array(); $row = array();
$row['title'] = __('Last data'); $row['title'] = __('Last data');
$row['data'] = $last_data_str; $row['data'] = $last_data_str;
$table->data['last_data'] = $row; $table->data['last_data'] = $row;
//End of table //End of table
html_print_table($table); html_print_table($table);
$id_group = agents_get_agent_group($module['id_agente']); $id_group = agents_get_agent_group($module['id_agente']);
$group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']); $agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']);
if (can_user_access_node () && check_acl ($config["id_user"], $id_group, 'AW')) { if ($user_access_node && check_acl ($config["id_user"], $id_group, 'AW')) {
// Actions table // Actions table
echo '<div style="width:100%; text-align: right; min-width: 300px;">'; echo '<div style="width:100%; text-align: right; min-width: 300px;">';
echo '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $module['id_agente'] . '&tab=module&edit_module=1&id_agent_module=' . $module['id_agente_modulo'] . $url_hash . '">'; echo '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $module['id_agente'] . '&tab=module&edit_module=1&id_agent_module=' . $module['id_agente_modulo'] . $url_hash . '">';
@ -309,14 +315,18 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
echo '</div>'; echo '</div>';
} }
//id_module and id_agent hidden //id_module and id_agent hidden
echo '<div id="ids" style="display:none;">'; echo '<div id="ids" style="display:none;">';
html_print_input_text('id_module', $id_module); html_print_input_text('id_module', $id_module);
html_print_input_text('id_agent', $module['id_agente']); html_print_input_text('id_agent', $module['id_agente']);
html_print_input_text('server_name', $server_name); html_print_input_text('server_name', $server_name);
echo '</div>'; echo '</div>';
if (!empty($server_data) && is_metaconsole()) {
metaconsole_restore_db();
}
return; return;
} }
@ -335,7 +345,14 @@ function treeview_printAlertsTable($id_module, $server_data = array(), $no_head
$console_url = $server_data['server_url'] . '/'; $console_url = $server_data['server_url'] . '/';
$url_hash = metaconsole_get_servers_url_hash($server_data); $url_hash = metaconsole_get_servers_url_hash($server_data);
} }
$user_access_node = can_user_access_node ();
if (is_metaconsole()) {
if (metaconsole_connect($server_data) != NOERR)
return;
}
$module_alerts = alerts_get_alerts_agent_module($id_module); $module_alerts = alerts_get_alerts_agent_module($id_module);
$module_name = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_module); $module_name = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_module);
$agent_id = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $id_module); $agent_id = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $id_module);
@ -422,7 +439,7 @@ function treeview_printAlertsTable($id_module, $server_data = array(), $no_head
} }
html_print_table($table2); html_print_table($table2);
if (can_user_access_node () && check_acl ($config["id_user"], $id_group, 'LW')) { if ($user_access_node && check_acl ($config["id_user"], $id_group, 'LW')) {
// Actions table // Actions table
echo '<div style="width:100%; text-align: right; min-width: 300px;">'; echo '<div style="width:100%; text-align: right; min-width: 300px;">';
echo '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name=' . $module_name . '&id_agente=' . $agent_id . $url_hash . '" target="_blank">'; echo '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name=' . $module_name . '&id_agente=' . $agent_id . $url_hash . '" target="_blank">';
@ -430,6 +447,12 @@ function treeview_printAlertsTable($id_module, $server_data = array(), $no_head
echo '</a>'; echo '</a>';
echo '</div>'; echo '</div>';
} }
if (!empty($server_data) && is_metaconsole()) {
metaconsole_restore_db();
}
return;
} }
function treeview_printTable($id_agente, $server_data = array(), $no_head = false) { function treeview_printTable($id_agente, $server_data = array(), $no_head = false) {
@ -462,16 +485,23 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
if ($is_extra === ENTERPRISE_NOT_HOOK) { if ($is_extra === ENTERPRISE_NOT_HOOK) {
$is_extra = false; $is_extra = false;
} }
$user_access_node = can_user_access_node ();
if (is_metaconsole()) {
if (metaconsole_connect($server_data) != NOERR)
return;
}
$agent = db_get_row ("tagente", "id_agente", $id_agente);
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent General Information"); "Trying to access Agent General Information");
require_once ("general/noaccess.php"); require_once ("general/noaccess.php");
return; return;
} }
$agent = db_get_row ("tagente", "id_agente", $id_agente);
if ($agent === false) { if ($agent === false) {
ui_print_error_message(__('There was a problem loading agent')); ui_print_error_message(__('There was a problem loading agent'));
return; return;
@ -493,7 +523,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
$cellName = ''; $cellName = '';
} }
$cellName .= ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true, $console_url, $url_hash, false, can_user_access_node ()); $cellName .= ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true, $console_url, $url_hash, false, $user_access_node);
if ($agent['disabled']) { if ($agent['disabled']) {
$cellName .= ui_print_help_tip(__('Disabled'), true) . "</em>"; $cellName .= ui_print_help_tip(__('Disabled'), true) . "</em>";
@ -562,7 +592,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
//End of table //End of table
$agent_table = html_print_table($table, true); $agent_table = html_print_table($table, true);
if (can_user_access_node () && check_acl ($config["id_user"], $agent["id_grupo"], "AW")) { if ( $user_access_node && check_acl ($config["id_user"], $agent["id_grupo"], "AW")) {
$go_to_agent = '<div style="text-align: right;">'; $go_to_agent = '<div style="text-align: right;">';
$go_to_agent .= '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">'; $go_to_agent .= '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">';
$go_to_agent .= html_print_submit_button (__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true); $go_to_agent .= html_print_submit_button (__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
@ -743,8 +773,11 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
ui_toggle($table_interfaces, __('Interface information') . ' (SNMP)'); ui_toggle($table_interfaces, __('Interface information') . ' (SNMP)');
} }
if (!empty($server_data) && is_metaconsole()) {
metaconsole_restore_db();
}
return; return;
} }
?>
?>

View File

@ -41,7 +41,7 @@ function visual_map_print_item_toolbox($idDiv, $text, $float) {
} }
echo '<div class="button_toolbox" id="' . $idDiv . '" echo '<div class="button_toolbox" id="' . $idDiv . '"
style="font-weight: bolder; text-align: center; float: ' . $float . ';' style="font-weight: bolder; text-align:; float: ' . $float . ';'
. $margin . ': 5px;">'; . $margin . ': 5px;">';
echo $text; echo $text;
echo '</span>'; echo '</span>';
@ -67,7 +67,7 @@ function visual_map_print_user_line_handles($layoutData) {
'style="z-index: ' .$z_index . ';' . 'style="z-index: ' .$z_index . ';' .
'position: absolute; top: ' . ($start_y - $radious_handle) . 'px; ' . 'position: absolute; top: ' . ($start_y - $radious_handle) . 'px; ' .
'left: ' . ($start_x - $radious_handle) . 'px;' . 'left: ' . ($start_x - $radious_handle) . 'px;' .
'text-align: center;' . 'text-align: ;' .
'display: inline-block; ' . $sizeStyle . '">'; 'display: inline-block; ' . $sizeStyle . '">';
html_print_image("images/dot_red.png"); html_print_image("images/dot_red.png");
@ -79,7 +79,7 @@ function visual_map_print_user_line_handles($layoutData) {
'style="z-index: ' .$z_index . ';' . 'style="z-index: ' .$z_index . ';' .
'position: absolute; top: ' . ($end_y - $radious_handle) . 'px; ' . 'position: absolute; top: ' . ($end_y - $radious_handle) . 'px; ' .
'left: ' . ($end_x - $radious_handle) . 'px;' . 'left: ' . ($end_x - $radious_handle) . 'px;' .
'text-align: center;' . 'text-align: ;' .
'display: inline-block; ' . $sizeStyle . '">'; 'display: inline-block; ' . $sizeStyle . '">';
html_print_image("images/dot_green.png"); html_print_image("images/dot_green.png");
@ -109,7 +109,8 @@ function visual_map_print_item($mode = "read", $layoutData,
$border_width = $layoutData['border_width']; $border_width = $layoutData['border_width'];
$border_color = $layoutData['border_color']; $border_color = $layoutData['border_color'];
$fill_color = $layoutData['fill_color']; $fill_color = $layoutData['fill_color'];
$label_position = $layoutData['label_position'];
$sizeStyle = ''; $sizeStyle = '';
$borderStyle = ''; $borderStyle = '';
$imageSize = ''; $imageSize = '';
@ -121,8 +122,113 @@ function visual_map_print_item($mode = "read", $layoutData,
$left = $left * $proportion['proportion_width']; $left = $left * $proportion['proportion_width'];
} }
$agentname = agents_get_name(agents_get_module_id ($id_module));
$label = str_replace($agentname,ui_print_truncate_text($agentname, 'agent_small', false, true, false, '…', false),$label);
$text = '<span id="text_' . $id . '" class="text">' . $label .'</span>';
if($height == 0){
switch($type){
case 0:
case 11:
$tableheight0 = '70';
break;
case 3:
$tableheight0 = '30';
break;
case 9:
$tableheight0 = '130';
break;
case 1:
$tableheight0 = '180';
break;
case SERVICE:
$tableheight0 = '50';
break;
}
}
else{
$tableheight0 = $height;
}
if ($layoutData['width'] == 0 || $layoutData['height'] == 0){
switch($type){
case 0:
case 11:
$himg = '70';
$wimg ='70';
break;
case 3:
if(get_parameter('action') == 'edit'){
$himg = '30';
$wimg = '150';
}
else{
$himg = '15';
$wimg = '150';
}
break;
case 9:
$himg = '130';
$wimg = '130';
break;
case 1:
$himg = '180';
$wimg = '300';
break;
case SERVICE:
$himg = '50';
$wimg = '150';
break;
}
}
else{
$wimg = $layoutData['width'];
$himg = $layoutData['height'];
if($type == 3){
if(get_parameter('action') == 'edit'){
$himg = '30';
}
else{
$himg = '15';
}
}
if($type == 9){
$himg = $wimg;
}
}
if($label_position == 'left'){
$text = '<table style="float:left;height:'.$himg.'px;"><tr><td></td></tr><tr><td><span id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
}
else if($label_position == 'right'){
$text = '<table style="float:right;height:'.$himg.'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
}
else{
$text = '<table style="width:'.$wimg.'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
}
$text = '<span id="text_' . $id . '" class="text">' . $label . '</span>';
if (!isset($layoutData['status_calculated'])) { if (!isset($layoutData['status_calculated'])) {
$layoutData['status_calculated'] = $layoutData['status_calculated'] =
@ -678,12 +784,7 @@ function visual_map_print_item($mode = "read", $layoutData,
$img = substr_replace($img, '', 0,1); $img = substr_replace($img, '', 0,1);
} }
} }
if (($width != 0) && ($height != 0)) {
$sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;';
$imageSize = 'width="' . $width . '" height="' . $height . '"';
}
if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD) if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD)
$z_index = 3 + 1; $z_index = 3 + 1;
elseif ($status == VISUAL_MAP_STATUS_WARNING) elseif ($status == VISUAL_MAP_STATUS_WARNING)
@ -735,6 +836,10 @@ function visual_map_print_item($mode = "read", $layoutData,
$unit_text = trim(io_safe_output($unit_text)); $unit_text = trim(io_safe_output($unit_text));
$value_text = format_for_graph($module_value, 2); $value_text = format_for_graph($module_value, 2);
if($value_text<=0){
$value_text = remove_right_zeros(number_format($module_value, $config['graph_precision']));
}
if (!empty($unit_text)) if (!empty($unit_text))
$value_text .= " " . $unit_text; $value_text .= " " . $unit_text;
} }
@ -750,6 +855,16 @@ function visual_map_print_item($mode = "read", $layoutData,
$percentile = 100; $percentile = 100;
break; break;
case MODULE_GRAPH: case MODULE_GRAPH:
$imgpos = '';
if($layoutData['label_position']=='left'){
$imgpos = 'float:right';
}
else if($layoutData['label_position']=='right'){
$imgpos = 'float:left';
}
if (!empty($proportion)) { if (!empty($proportion)) {
$width = $width =
((integer)($proportion['proportion_width'] * $width)); ((integer)($proportion['proportion_width'] * $width));
@ -770,36 +885,137 @@ function visual_map_print_item($mode = "read", $layoutData,
if ($layoutData['id_custom_graph'] != 0) { if ($layoutData['id_custom_graph'] != 0) {
// Show only avg on the visual console // Show only avg on the visual console
if(get_parameter('action') == 'edit'){ if(get_parameter('action') == 'edit'){
$img = '<img src="images/console/signes/custom_graph.png" style="width:'.$width.'px;height:'.$height.'px;">'; if($width == 0 || $height == 0){
} $img = '<img src="images/console/signes/custom_graph.png" style="width:300px;height:180px;'.$imgpos.'">';
}
else{
$img = '<img src="images/console/signes/custom_graph.png" style="width:'.$width.'px;height:'.$height.'px;'.$imgpos.'">';
}
}
else{ else{
$img = custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width, if($width == 0 || $height == 0){
if($layoutData['label_position']=='left'){
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300,
$period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
else if($layoutData['label_position']=='right'){
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300,
$period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
else{
$img = custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300,
$period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true);
}
}
else{
if($layoutData['label_position']=='left'){
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'],$height,$width,
$period, null, true, 0, false, $layoutData['image'], $period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true, array(), '', array(), array(), true,
false, false, true, 1, false, true, $layoutData['percentil'] false, false, true, 1, false, true).'</div>';
); }
else if($layoutData['label_position']=='right'){
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'],$height,$width,
$period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
else{
$img = custom_graphs_print(
$layoutData['id_custom_graph'],$height,$width,
$period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true);
}
} }
}
} }
else { else {
if ($isExternalLink) if ($isExternalLink)
$homeurl = $config['homeurl']; $homeurl = $config['homeurl'];
else else
$homeurl = ''; $homeurl = '';
if(get_parameter('action') == 'edit'){ if(get_parameter('action') == 'edit'){
$img = '<img src="images/console/signes/module_graph.png" style="width:'.$width.'px;height:'.$height.'px;">'; if($width == 0 || $height == 0){
} $img = '<img src="images/console/signes/module_graph.png" style="width:300px;height:180px;'.$imgpos.'">';
else { }
$img = grafico_modulo_sparse($id_module, $period, 0, $width, $height, '', null, else{
false, 1, false, 0, '', 0, 0, true, false, '', 1, false, $img = '<img src="images/console/signes/module_graph.png" style="width:'.$width.'px;height:'.$height.'px;'.$imgpos.'">';
'', false, false, false, $layoutData['image'], null, true, }
false,$type_graph); }
} else{
}
if($width == 0 || $height == 0){
if($layoutData['label_position']=='left'){
$img = '<div style="float:right;height:'.$himg.'px;">'.grafico_modulo_sparse($id_module, $period, 0,300,180,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph).'</div>';
}
else if($layoutData['label_position']=='right'){
$img = '<div style="float:left;height:'.$himg.'px;">'.grafico_modulo_sparse($id_module, $period, 0,300,180,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph).'</div>';
}
else{
$img = grafico_modulo_sparse($id_module, $period, 0,300,180,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph);
}
}
else{
if($layoutData['label_position']=='left'){
$img = '<div style="float:right;height:'.$himg.'px;">'.grafico_modulo_sparse($id_module, $period, 0,$width,$height,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph).'</div>';
}
else if($layoutData['label_position']=='right'){
$img = '<div style="float:left;height:'.$himg.'px;">'.grafico_modulo_sparse($id_module, $period, 0,$width,$height,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph).'</div>';
}
else{
$img = grafico_modulo_sparse($id_module, $period, 0,$width,$height,
'',null,
false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
'', false, false, false, $layoutData['image'], null, true, false,$type_graph);
}
}
}
}
//Restore db connection //Restore db connection
if ($layoutData['id_metaconsole'] != 0) { if ($layoutData['id_metaconsole'] != 0) {
@ -859,7 +1075,6 @@ function visual_map_print_item($mode = "read", $layoutData,
'position: absolute; ' . 'position: absolute; ' .
'top: ' . $top . 'px; ' . 'top: ' . $top . 'px; ' .
'left: ' . $left . 'px;' . 'left: ' . $left . 'px;' .
'text-align: left;' .
'display: inline-block; ' . $sizeStyle . '">'; 'display: inline-block; ' . $sizeStyle . '">';
if ($link) { if ($link) {
@ -868,31 +1083,44 @@ function visual_map_print_item($mode = "read", $layoutData,
switch ($type) { switch ($type) {
case BOX_ITEM: case BOX_ITEM:
if (!empty($proportion)){
if($width == 0 || $width == 0){
$style = ""; $style = "";
$style .= "width: " . ($width * $proportion['proportion_width']) . "px; "; $style .= "width: 300px; ";
$style .= "height: " . ($height * $proportion['proportion_height']) . "px; "; $style .= "height: 180px; ";
$style .= "border-style: solid; ";
$style .= "border-width: " . $border_width . "px; ";
$style .= "border-color: " . $border_color . "; ";
$style .= "background-color: " . $fill_color . "; ";
echo "<div style='" . $style . "'></div>";
}
else{
$style = "";
$style .= "width: " . $width . "px; ";
$style .= "height: " . $height . "px; ";
$style .= "border-style: solid; "; $style .= "border-style: solid; ";
$style .= "border-width: " . $border_width . "px; "; $style .= "border-width: " . $border_width . "px; ";
$style .= "border-color: " . $border_color . "; "; $style .= "border-color: " . $border_color . "; ";
$style .= "background-color: " . $fill_color . "; "; $style .= "background-color: " . $fill_color . "; ";
echo "<div style='" . $style . "'></div>"; echo "<div style='" . $style . "'></div>";
} }
else{
if (!empty($proportion)){
$style = "";
$style .= "width: " . ($width * $proportion['proportion_width']) . "px; ";
$style .= "height: " . ($height * $proportion['proportion_height']) . "px; ";
$style .= "border-style: solid; ";
$style .= "border-width: " . $border_width . "px; ";
$style .= "border-color: " . $border_color . "; ";
$style .= "background-color: " . $fill_color . "; ";
echo "<div style='" . $style . "'></div>";
}
else{
$style = "";
$style .= "width: " . $width . "px; ";
$style .= "height: " . $height . "px; ";
$style .= "border-style: solid; ";
$style .= "border-width: " . $border_width . "px; ";
$style .= "border-color: " . $border_color . "; ";
$style .= "background-color: " . $fill_color . "; ";
echo "<div style='" . $style . "'></div>";
}
}
break; break;
case STATIC_GRAPH: case STATIC_GRAPH:
case GROUP_ITEM: case GROUP_ITEM:
echo "<div>";
if ($layoutData['image'] != null) { if ($layoutData['image'] != null) {
@ -925,46 +1153,70 @@ function visual_map_print_item($mode = "read", $layoutData,
if (is_file($config['homedir'] . '/' . $img)) if (is_file($config['homedir'] . '/' . $img))
$infoImage = getimagesize($config['homedir'] . '/' . $img); $infoImage = getimagesize($config['homedir'] . '/' . $img);
if ($width != 0) { if ($height == 0 || $height == 0) {
$height = '70px';
$width = '70px';
}
else {
$height = (integer)($proportion['proportion_height'] * $height);
$width = (integer)($proportion['proportion_width'] * $width); $width = (integer)($proportion['proportion_width'] * $width);
} }
else { }
$width = (integer)($proportion['proportion_width'] * $infoImage[0]);
}
if ($height != 0) { $imgpos = '';
$height = (integer)($proportion['proportion_height'] * $height);
} if($layoutData['label_position']=='up'){
else { echo io_safe_output($text);
$height = (integer)($proportion['proportion_height'] * $infoImage[1]);
}
} }
if (($width != 0) && ($height != 0)) if($layoutData['label_position']=='left'){
echo html_print_image($img, true, $imgpos = 'float:right';
array("class" => "image", }
"id" => "image_" . $id, else if($layoutData['label_position']=='right'){
"width" => "$width", $imgpos = 'float:left';
"height" => "$height", }
"title" => $img_style_title,
"style" => $borderStyle), false, if ($width == 0 || $height == 0)
false, false, $isExternalLink); echo html_print_image($img, true,
array("class" => "image",
"id" => "image_" . $id,
"width" => "70px",
"height" => "70px",
"title" => $img_style_title,
"style" => $borderStyle.$imgpos), false,
false, false, $isExternalLink);
else else
echo html_print_image($img, true, echo html_print_image($img, true,
array("class" => "image", array("class" => "image",
"id" => "image_" . $id, "id" => "image_" . $id,
"width" => "70px", "width" => $width,
"height" => "70px", "height" => $height,
"title" => $img_style_title, "title" => $img_style_title,
"style" => $borderStyle), false, "style" => $borderStyle.$imgpos), false,
false, false, $isExternalLink); false, false, $isExternalLink);
echo '<br />';
} }
echo io_safe_output($text);
echo "</div>"; if($layoutData['label_position']=='down'){
echo io_safe_output($text);
}
else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
echo io_safe_output($text);
}
break; break;
case PERCENTILE_BAR: case PERCENTILE_BAR:
$imgpos = '';
if($layoutData['label_position']=='left'){
$imgpos = 'float:right;';
}
else if($layoutData['label_position']=='right'){
$imgpos = 'float:left;';
}
$progress_bar_heigh = 15; $progress_bar_heigh = 15;
if (!empty($proportion)) { if (!empty($proportion)) {
if ($width != 0) { if ($width != 0) {
@ -982,34 +1234,59 @@ function visual_map_print_item($mode = "read", $layoutData,
$height = (integer)($proportion['proportion_height'] * $infoImage[1]); $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
} }
} }
echo io_safe_output($text) . '<br />';
if($layoutData['label_position']=='up'){
echo io_safe_output($text);
}
ob_start(); ob_start();
if ($type == PERCENTILE_BUBBLE) { if ($type == PERCENTILE_BUBBLE) {
echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus); echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus,$imgpos);
} }
else { else {
echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus); echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus,$imgpos);
} }
$img = ob_get_clean(); $img = ob_get_clean();
if(get_parameter('action') == 'edit'){ if(get_parameter('action') == 'edit'){
$img = '<img src="images/console/signes/percentil.png" style="width:'.$width.'px;height:30px;">'; if($width == 0){
$img = '<img src="images/console/signes/percentil.png" style="width:130px;height:30px;'.$imgpos.'">';
}
else{
$img = '<img src="images/console/signes/percentil.png" style="width:'.$width.'px;height:30px;'.$imgpos.'">';
}
} }
else{ else{
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img); $img = str_replace('>', 'class="image" style="height:'.$himg.'px;width:'.$wimg.'px;'.$imgpos.'" id="image_' . $id . '" />', $img);
} }
echo $img; echo $img;
if($layoutData['label_position']=='down'){
echo io_safe_output($text);
}
else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
echo io_safe_output($text);
}
break; break;
case PERCENTILE_BUBBLE: case PERCENTILE_BUBBLE:
$imgpos = '';
if($layoutData['label_position']=='left'){
$imgpos = 'float:right;';
}
else if($layoutData['label_position']=='right'){
$imgpos = 'float:left;';
}
$progress_bar_heigh = 15; $progress_bar_heigh = 15;
if (!empty($proportion)) { if (!empty($proportion)) {
if ($width != 0) { if ($width != 0) {
@ -1027,11 +1304,20 @@ function visual_map_print_item($mode = "read", $layoutData,
$height = (integer)($proportion['proportion_height'] * $infoImage[1]); $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
} }
} }
echo io_safe_output($text) . '<br />';
if($layoutData['label_position']=='up'){
echo io_safe_output($text);
}
ob_start(); ob_start();
if ($type == PERCENTILE_BUBBLE) { if ($type == PERCENTILE_BUBBLE) {
echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus); if($width == 0){
echo progress_bubble($percentile, 100,100, '', 1, $value_text, $colorStatus,$s);
}
else{
echo progress_bubble($percentile, $width,$width, '', 1, $value_text, $colorStatus);
}
} }
else { else {
echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus); echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus);
@ -1041,22 +1327,42 @@ function visual_map_print_item($mode = "read", $layoutData,
if(get_parameter('action') == 'edit'){ if(get_parameter('action') == 'edit'){
$img = '<img src="images/console/signes/percentil_bubble.png" style="width:'.$width.'px;height:'.$width.'px;">'; if($width == 0){
$img = '<img src="images/console/signes/percentil_bubble.png" style="width:130px;height:130px;'.$imgpos.'">';
}
else{
$img = '<img src="images/console/signes/percentil_bubble.png" style="width:'.$width.'px;height:'.$width.'px;'.$imgpos.'">';
}
} }
else{ else{
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img); $img = str_replace('>', 'class="image" style="width:'.$wimg.'px;height:'.$himg.'px;'.$imgpos.'" id="image_' . $id . '" />', $img);
} }
echo $img; echo $img;
if($layoutData['label_position']=='down'){
echo io_safe_output($text);
}
else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
echo io_safe_output($text);
}
break; break;
case MODULE_GRAPH: case MODULE_GRAPH:
echo io_safe_output($text) . '<br />'; if($layoutData['label_position']=='up'){
echo io_safe_output($text);
}
echo $img; echo $img;
if($layoutData['label_position']=='down'){
echo io_safe_output($text);
}
else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
echo io_safe_output($text);
}
break; break;
case SIMPLE_VALUE: case SIMPLE_VALUE:
case SIMPLE_VALUE_MAX: case SIMPLE_VALUE_MAX:
@ -1105,18 +1411,20 @@ function visual_map_print_item($mode = "read", $layoutData,
} }
} }
$io_safe_output_text = str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); //$io_safe_output_text = str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
if(get_parameter('action') == 'edit'){ if(get_parameter('action') == 'edit'){
echo 'Data value'; //echo 'Data value';
echo $io_safe_output_text;
} }
else{ else{
echo $io_safe_output_text; echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
} }
@ -1167,7 +1475,6 @@ function visual_map_print_item($mode = "read", $layoutData,
array("class" => "image", "id" => "image_" . $id,"width" => "70px", array("class" => "image", "id" => "image_" . $id,"width" => "70px",
"70px" => "$height"), "70px" => "$height"),
false, false, false, $isExternalLink); false, false, false, $isExternalLink);
echo '<br />';
} }
break; break;
default: default:
@ -1246,16 +1553,18 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
$value = __('Unknown'); $value = __('Unknown');
} }
else { else {
if ( is_numeric($value) ) if ( is_numeric($value) ) {
$value = format_for_graph($value, $config['graph_precision']); if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
}
}
if (!empty($unit_text)) { if (!empty($unit_text)) {
$value .= " " . $unit_text; $value .= " " . $unit_text;
} }
} }
$value = preg_replace ('/\n/i','<br>',$value); $value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\t/i','&#09;',$value); $value = preg_replace ('/\s/i','&nbsp;',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
return $value; return $value;
break; break;
@ -1265,8 +1574,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
$value = __('Unknown'); $value = __('Unknown');
} }
else { else {
if ( is_numeric($value) ) if ( is_numeric($value) ) {
$value = format_for_graph($value, 2); if ($config['simple_module_value']) {
$value = format_for_graph($value, 2);
}
}
if (!empty($unit_text)) if (!empty($unit_text))
$value .= " " . $unit_text; $value .= " " . $unit_text;
} }
@ -1278,8 +1590,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
$value = __('Unknown'); $value = __('Unknown');
} }
else { else {
if ( is_numeric($value) ) if ( is_numeric($value) ) {
$value = format_for_graph($value, 2); if ($config['simple_module_value']) {
$value = format_for_graph($value, 2);
}
}
if (!empty($unit_text)) if (!empty($unit_text))
$value .= " " . $unit_text; $value .= " " . $unit_text;
} }
@ -1291,8 +1606,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
$value = __('Unknown'); $value = __('Unknown');
} }
else { else {
if ( is_numeric($value) ) if ( is_numeric($value) ) {
$value = format_for_graph($value, 2); if ($config['simple_module_value']) {
$value = format_for_graph($value, 2);
}
}
if (!empty($unit_text)) if (!empty($unit_text))
$value .= " " . $unit_text; $value .= " " . $unit_text;
} }
@ -1434,16 +1752,16 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
switch ($label_type) { switch ($label_type) {
case 'agent_module': case 'agent_module':
default: default:
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $agent_label = agents_get_name ($id_agent);
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); $module_label = modules_get_agentmodule_name($id_module);
$label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label . " - " . $module_label.'</span></p>'; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label . " - " . $module_label.'</span></p>';
break; break;
case 'module': case 'module':
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); $module_label = modules_get_agentmodule_name($id_module);
$label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$module_label.'</span></p>'; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$module_label.'</span></p>';
break; break;
case 'agent': case 'agent':
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $agent_label = agents_get_name ($id_agent);
$label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label.'</span></p>'; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label.'</span></p>';
break; break;
case 'none': case 'none':
@ -1635,9 +1953,8 @@ function visual_map_process_wizard_add_agents ($id_agents, $image,
switch ($label_type) { switch ($label_type) {
case 'agent': case 'agent':
$agent_label = ui_print_truncate_text( $agent_label =
agents_get_name($id_agent), agents_get_name($id_agent);
'agent_small', false, true, false, '…', false);
$label = $agent_label; $label = $agent_label;
break; break;
case 'none': case 'none':
@ -2079,7 +2396,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
$(window).load(function () { $(window).load(function () {
draw_lines(lines, 'background_'+id_layout); draw_lines(lines, 'background_'+id_layout);
draw_user_lines_read('background_'+id_layout); draw_user_lines_read('background_'+id_layout);
center_labels(); //center_labels();
}); });
/* ]]> */ /* ]]> */
</script> </script>
@ -2140,9 +2457,23 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>"; echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
} }
echo '<div style="background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'" echo '<div style="';
style="margin:0px auto;
text-align:center; if(get_parameter('pure')==1){
echo 'width:100%;height:100%;position:absolute;';
}
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;';
if(get_parameter('pure')==1){
echo 'top: 50%;
transform: translate(-0%, -50%);
-webkit-transform: translate(-0%, -50%);';
}
echo 'text-align:;
z-index: 0; z-index: 0;
position:relative; position:relative;
width:' . $mapWidth . 'px; width:' . $mapWidth . 'px;
@ -2186,12 +2517,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
'proportion_height' => $proportion_height, 'proportion_height' => $proportion_height,
'proportion_width' => $proportion_width); 'proportion_width' => $proportion_width);
} }
if($layout_data['id_custom_graph']){
$layout_data['percentil'] = db_get_value ("percentil", "tgraph",
"id_graph", $layout_data["id_custom_graph"]);
}
switch ($layout_data['type']) { switch ($layout_data['type']) {
case LINE_ITEM: case LINE_ITEM:
visual_map_print_user_lines($layout_data, $proportion); visual_map_print_user_lines($layout_data, $proportion);

View File

@ -43,7 +43,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
echo '<div id="properties_panel" style="display: none; position: absolute; border: 2px solid #114105; padding: 5px; background: white; z-index: 90;">'; echo '<div id="properties_panel" style="display: none; position: absolute; border: 1px solid lightgray; padding: 5px; background: white; z-index: 90;">';
//----------------------------Hiden Form---------------------------- //----------------------------Hiden Form----------------------------
?> ?>
<table class="databox filters" border="0" cellpadding="4" cellspacing="4" width="350"> <table class="databox filters" border="0" cellpadding="4" cellspacing="4" width="350">
@ -164,7 +164,25 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'datos', 'datos',
'group_item'); 'group_item');
$form_items['label_row']['html'] = $form_items['label_row']['html'] =
'<td align="left" valign="top" style="">' . __('Label') . '</td> '<td align="left" valign="top" style="">' . __('Label') . '
<div id="label_box_arrow" style="text-align:center;width:120px;height:110px;margin-top:50px;">
<span>Label position</span>
<div class="labelpos" id="labelposup" position="up" style="width:20px;height:20px;margin-top:10px;margin-left:45px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_up.png" style="height:100%;width:100%;"></div>
<div class="labelpos" id="labelposleft" position="left" style="position:relative;top:-5px;width:20px;height:20px;margin-top:15px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_left.png" style="height:100%;width:100%;"></div>
<div style="font-weight:bold;width:40px;height:20px;position:relative;margin-left:35px;margin-top:-24px;cursor: default;"><span style="float:left;margin-top:3px;margin-left:5px;">Object</span></div>
<div class="labelpos" id="labelposright" position="right" style="top:2px;width:20px;height:20px;position:relative;margin-left:90px;margin-top:-24px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_right.png" style="height:100%;width:100%;"></div>
<div class="labelpos" sel="yes" id="labelposdown" position="down" style="width:20px;height:20px;position:relative;margin-left:45px;margin-top:10px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_down_2.png" style="height:100%;width:100%;"></div>
</div>
</td>
<td align="left" style="">' . <td align="left" style="">' .
html_print_input_text('label', '', '', 20, 200, true) . '</td>'; html_print_input_text('label', '', '', 20, 200, true) . '</td>';
@ -437,7 +455,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['button_update_row'] = array(); $form_items['button_update_row'] = array();
$form_items['button_update_row']['items'] = array('datos'); $form_items['button_update_row']['items'] = array('datos');
$form_items['button_update_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">' . $form_items['button_update_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">' .
html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true) . html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true) . '<span ="margin-right:10px;">&nbsp</span>' .
html_print_button(__('Update'), 'update_button', false, 'update_button_palette_callback();', 'class="sub upd"', true) . html_print_button(__('Update'), 'update_button', false, 'update_button_palette_callback();', 'class="sub upd"', true) .
'</td>'; '</td>';
@ -445,7 +463,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['button_create_row'] = array(); $form_items['button_create_row'] = array();
$form_items['button_create_row']['items'] = array('datos'); $form_items['button_create_row']['items'] = array('datos');
$form_items['button_create_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">' . $form_items['button_create_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">' .
html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true) . html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true) . '<span ="margin-right:10px;">&nbsp</span>' .
html_print_button(__('Create'), 'create_button', false, 'create_button_palette_callback();', 'class="sub wand"', true) . html_print_button(__('Create'), 'create_button', false, 'create_button_palette_callback();', 'class="sub wand"', true) .
'</td>'; '</td>';
@ -589,6 +607,8 @@ function visual_map_editor_print_toolbox() {
visual_map_print_button_editor('group_item', __('Group'), 'left', false, 'group_item_min', true); visual_map_print_button_editor('group_item', __('Group'), 'left', false, 'group_item_min', true);
visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item_min', true); visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item_min', true);
visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item_min', true); visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item_min', true);
echo '<a href="javascript:" class="tip"><img src="'.$config['homeurl'].'/images/tip.png" data-title="The data displayed in editor mode is not real" data-use_title_for_force_title="1"
class="forced_title" alt="The data displayed in editor mode is not real"></a>';
enterprise_hook("enterprise_visual_map_editor_print_toolbox"); enterprise_hook("enterprise_visual_map_editor_print_toolbox");

View File

@ -219,7 +219,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
$chart_extra_data = array(), $yellow_threshold = 0, $chart_extra_data = array(), $yellow_threshold = 0,
$red_threshold = 0, $adapt_key = '', $force_integer = false, $red_threshold = 0, $adapt_key = '', $force_integer = false,
$series_suffix_str = '', $menu = true, $backgroundColor = 'white', $series_suffix_str = '', $menu = true, $backgroundColor = 'white',
$dashboard = false, $vconsole = false, $agent_module_id = 0, $percentil_values = array()) { $dashboard = false, $vconsole = false, $agent_module_id = 0, $percentil_values = array(),
$threshold_data = array()) {
include_once('functions_flot.php'); include_once('functions_flot.php');
@ -267,7 +268,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
$font, $font,
$font_size, $font_size,
$xaxisname, $xaxisname,
$percentil_values $percentil_values,
$threshold_data
); );
} }
else { else {
@ -513,7 +515,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
$yaxisname = "", $water_mark = "", $font = '', $font_size = '', $yaxisname = "", $water_mark = "", $font = '', $font_size = '',
$unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white',
$dashboard = false, $vconsole = false, $series_type = array(), $dashboard = false, $vconsole = false, $series_type = array(),
$percentil_values = array(), $yellow_threshold = 0, $red_threshold = 0) { $percentil_values = array(), $yellow_threshold = 0, $red_threshold = 0,
$threshold_data = array()) {
include_once("functions_flot.php"); include_once("functions_flot.php");
@ -550,7 +553,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
$dashboard, $dashboard,
$vconsole, $vconsole,
false, false,
$percentil_values); $percentil_values,
$threshold_data);
} }
else { else {
$graph = array(); $graph = array();

File diff suppressed because one or more lines are too long

View File

@ -850,7 +850,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
alert_ids, legend_alerts, yellow_threshold, red_threshold, alert_ids, legend_alerts, yellow_threshold, red_threshold,
force_integer, separator, separator2, force_integer, separator, separator2,
yellow_up, red_up, yellow_inverse, red_inverse, yellow_up, red_up, yellow_inverse, red_inverse,
series_suffix_str, dashboard, vconsole, xaxisname) { series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) {
var threshold = true; var threshold = true;
var thresholded = false; var thresholded = false;
@ -945,7 +945,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
serie_color = colors[i]; serie_color = colors[i];
} }
else { else {
serie_color = null; serie_color = '#8c2';
} }
var normalw = '#efe'; var normalw = '#efe';
@ -1509,12 +1509,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// The first execution, the graph data is the base data // The first execution, the graph data is the base data
datas = data_base; datas = data_base;
// minTickSize // minTickSize
var count_data = datas[0].data.length; var count_data = datas[0].data.length;
var min_tick_pixels = 80; var min_tick_pixels = 80;
var steps = parseInt( count_data / (width/min_tick_pixels)); var steps = parseInt( count_data / (width/min_tick_pixels));
var options = { var options = {
series: { series: {
stack: stacked, stack: stacked,
@ -1532,8 +1531,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
clickable: true, clickable: true,
borderWidth:1, borderWidth:1,
borderColor: '#666', borderColor: '#666',
tickColor: '#eee', tickColor: background_color,
markings: markings markings: markings,
color: legend_color
}, },
xaxes: [ { xaxes: [ {
axisLabelFontSizePixels: font_size, axisLabelFontSizePixels: font_size,

View File

@ -119,16 +119,17 @@ function flot_area_simple_graph($chart_data, $width, $height, $color,
$force_integer = false, $series_suffix_str = '', $menu = true, $force_integer = false, $series_suffix_str = '', $menu = true,
$background_color = 'white', $dashboard = false, $vconsole = false, $background_color = 'white', $dashboard = false, $vconsole = false,
$agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '', $agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '',
$percentil_values = array()) { $percentil_values = array(), $threshold_data = array()) {
global $config; global $config;
return flot_area_graph($chart_data, $width, $height, $color, return flot_area_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, 'area_simple', $legend, $long_index, $homeurl, $unit, 'area_simple',
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole, $menu, $background_color, $dashboard, $vconsole,
$agent_module_id, $font, $font_size, $xaxisname, $percentil_values); $agent_module_id, $font, $font_size, $xaxisname, $percentil_values,
$threshold_data);
} }
function flot_line_stacked_graph($chart_data, $width, $height, $color, function flot_line_stacked_graph($chart_data, $width, $height, $color,
@ -156,7 +157,7 @@ function flot_line_simple_graph($chart_data, $width, $height, $color,
$red_threshold = 0, $adapt_key= '', $force_integer = false, $red_threshold = 0, $adapt_key= '', $force_integer = false,
$series_suffix_str = '', $menu = true, $background_color = 'white', $series_suffix_str = '', $menu = true, $background_color = 'white',
$dashboard = false, $vconsole = false, $agent_module_id = 0, $dashboard = false, $vconsole = false, $agent_module_id = 0,
$percentil_values = array()) { $percentil_values = array(), $threshold_data = array()) {
global $config; global $config;
@ -165,7 +166,8 @@ function flot_line_simple_graph($chart_data, $width, $height, $color,
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole, $menu, $background_color, $dashboard, $vconsole,
$agent_module_id, $font, $font_size, '', $percentil_values); $agent_module_id, $font, $font_size, '', $percentil_values,
$threshold_data);
} }
function flot_area_graph($chart_data, $width, $height, $color, $legend, function flot_area_graph($chart_data, $width, $height, $color, $legend,
@ -174,7 +176,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$force_integer, $series_suffix_str = '', $menu = true, $force_integer, $series_suffix_str = '', $menu = true,
$background_color = 'white', $dashboard = false, $vconsole = false, $background_color = 'white', $dashboard = false, $vconsole = false,
$agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '', $agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '',
$percentil_values = array()) { $percentil_values = array(), $threshold_data = array()) {
global $config; global $config;
@ -205,19 +207,31 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
// Set some containers to legend, graph, timestamp tooltip, etc. // Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>"; $return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>";
if (!empty($threshold_data)) {
// Get other required module datas to draw warning and critical html_debug($threshold_data, true);
if ($agent_module_id == 0) { html_debug($yellow_threshold, true);
$yellow_up = 0; $yellow_up = $threshold_data['yellow_up'];
$red_up = 0; $red_up = $threshold_data['red_up'];
$yellow_inverse = false; $yellow_inverse = $threshold_data['yellow_inverse'];
$red_inverse = false; $red_inverse = $threshold_data['red_inverse'];
} else { }
$module_data = db_get_row_sql ('SELECT * FROM tagente_modulo WHERE id_agente_modulo = ' . $agent_module_id); else {
$yellow_up = $module_data['max_warning']; // Get other required module datas to draw warning and critical
$red_up = $module_data['max_critical']; if ($agent_module_id == 0) {
$yellow_inverse = !($module_data['warning_inverse'] == 0); $yellow_up = 0;
$red_inverse = !($module_data['critical_inverse'] == 0); $red_up = 0;
$yellow_inverse = false;
$red_inverse = false;
} else {
$module_data = db_get_row_sql ('SELECT * FROM tagente_modulo WHERE id_agente_modulo = ' . $agent_module_id);
$yellow_up = $module_data['max_warning'];
$red_up = $module_data['max_critical'];
$yellow_inverse = !($module_data['warning_inverse'] == 0);
$red_inverse = !($module_data['critical_inverse'] == 0);
html_debug($yellow_up, true);
html_debug($yellow_threshold, true);
html_debug($yellow_inverse, true);
}
} }
if ($menu) { if ($menu) {
@ -431,6 +445,22 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$force_integer = 'false'; $force_integer = 'false';
} }
//modify internal grid lines and legend text color
if(substr($background_style, -6, 4) == '#fff'){
$background_color = "#eee";
$legend_color = "#151515";
}
else if(substr($background_style, -6, 4) == '#000'){
$background_color = "#151515";
$legend_color = "#BDBDBD";
}
else{
$background_color = "#A4A4A4";
$legend_color = "#A4A4A4";
}
// Trick to get translated string from javascript // Trick to get translated string from javascript
$return .= html_print_input_hidden('unknown_text', __('Unknown'), $return .= html_print_input_hidden('unknown_text', __('Unknown'),
true); true);
@ -473,7 +503,13 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"'$series_suffix_str', "'$series_suffix_str',
" . json_encode($dashboard) . ",\n " . json_encode($dashboard) . ",\n
" . json_encode($vconsole) . ",\n" . " . json_encode($vconsole) . ",\n" .
"'$xaxisname');"; "'$xaxisname', \n" .
"'$background_color', \n" .
"'$legend_color'
);";
$return .= "\n//]]>"; $return .= "\n//]]>";
$return .= "</script>"; $return .= "</script>";

View File

@ -373,6 +373,78 @@ function agent_changed_by_multiple_agents_with_alerts (event, id_agent, selected
); );
} }
/**
* Fill up select box with id "module" with modules with alerts of one or more templates
* before agent has been selected, but this not empty the select box.s
*
* @param event that has been triggered
* @param id_agent Agent ID that has been selected
* @param selected Which module(s) have to be selected
*/
function alert_templates_changed_by_multiple_agents_with_alerts (event, id_agent, selected) {
var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) {
//val() because the var is same <option val="NNN"></option>
idAgents.push($(val).val());
});
var selection_mode = $('#modules_selection_mode').val();
if(selection_mode == undefined) {
selection_mode = 'common';
}
templates = Array();
jQuery.each ($("#id_alert_templates option:selected"), function (i, val) {
//val() because the var is same <option val="NNN"></option>
templates.push($(val).val());
});
console.log(templates);
$('#module').attr ('disabled', 1);
$('#module').empty ();
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php',
{"page": "operation/agentes/ver_agente",
"get_agent_modules_alerts_json_for_multiple_agents": 1,
"templates[]": templates,
"id_agent[]": idAgents,
"selection_mode": selection_mode
},
function (data) {
$('#module').empty ();
if (typeof($(document).data('text_for_module')) != 'undefined') {
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true));
}
else {
if (typeof(data['any_text']) != 'undefined') {
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0).prop('selected', true));
}
else {
var anyText = $("#any_text").html(); //Trick for catch the translate text.
if (anyText == null) {
anyText = 'Any';
}
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true));
}
}
jQuery.each (data, function (i, val) {
s = js_html_entity_decode(val);
$('#module').append ($('<option></option>').html (s).attr ("value", val));
$('#module').fadeIn ('normal');
});
if (selected != undefined)
$('#module').attr ('value', selected);
$('#module').removeAttr('disabled');
},
"json"
);
}
/** /**
* Fill up select box with id "agent" with agents after module has been selected, but this not empty the select box.s * Fill up select box with id "agent" with agents after module has been selected, but this not empty the select box.s
* *

File diff suppressed because one or more lines are too long

View File

@ -175,7 +175,8 @@
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom", theme_advanced_statusbar_location : "bottom",
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", //theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
theme_advanced_fonts : "Roboto=roboto;Lato=lato;Open sans=opensans;League gothic=leaguegothic",
theme_advanced_more_colors : 1, theme_advanced_more_colors : 1,
theme_advanced_row_height : 23, theme_advanced_row_height : 23,
theme_advanced_resize_horizontal : 1, theme_advanced_resize_horizontal : 1,
@ -1153,7 +1154,10 @@
fz = n.style.fontSize; fz = n.style.fontSize;
if (!fn && n.style.fontFamily) if (!fn && n.style.fontFamily)
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); $( "#text-label_ifr" ).contents().find( "span" ).css("font-family",n.style.fontFamily);
$( "#text-label_ifr" ).contents().find( "em" ).css("font-family",n.style.fontFamily);
$( "#text-label_ifr").contents().find( "strong" ).css("font-family",n.style.fontFamily);
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
if (!fc && n.style.color) if (!fc && n.style.color)
fc = n.style.color; fc = n.style.color;

View File

@ -3609,6 +3609,23 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
border: 1px solid red; border: 1px solid red;
} }
#toolbox > input{
border-width:0px 1px 0px 0px;
border-color: lightgray;
}
#toolbox > input.service_min{
border-width:0px 0px 0px 0px;
}
#toolbox > input.grid_min{
border-width:0px 0px 0px 0px;
}
#tinymce{
padding-top:20px;
}
#filter_event_status, #filter_event_status,
#filter_event_severity, #filter_event_severity,
#filter_event_type { #filter_event_type {

View File

@ -367,6 +367,30 @@ div#foot {
src: local('Nunito-Regular'), url(../../fonts/nunito.woff) format('woff'); src: local('Nunito-Regular'), url(../../fonts/nunito.woff) format('woff');
} }
@font-face
{
font-family: 'roboto';
src: url('../../fonts/roboto.woff2') format('woff2');
}
@font-face
{
font-family: 'opensans';
src: url('../../fonts/opensans.woff2') format('woff2');
}
@font-face
{
font-family: 'lato';
src: url('../../fonts/lato.woff2') format('woff2');
}
@font-face
{
font-family: 'leaguegothic';
src: url('../../fonts/leaguegothic.woff') format('woff');
}
#login_body { #login_body {
/* Set rules to fill background */ /* Set rules to fill background */
min-height: 100%; min-height: 100%;
@ -2330,41 +2354,84 @@ span#plugin_description {
#tinymce { #tinymce {
text-align: left; text-align: left;
} }
.visual_font_size_4pt, .visual_font_size_4pt > em, .visual_font_size_4pt > strong { .visual_font_size_4pt, .visual_font_size_4pt > em, .visual_font_size_4pt > strong, .visual_font_size_4pt > strong > span, .visual_font_size_4pt > span, .visual_font_size_4pt > strong > em, .visual_font_size_4pt > em > strong, .visual_font_size_4pt em span, .visual_font_size_4pt span em {
font-size: 4pt; font-size: 4pt !important;
line-height: 4pt;
} }
.visual_font_size_6pt, .visual_font_size_6pt > em, .visual_font_size_6pt > strong { .visual_font_size_6pt, .visual_font_size_6pt > em, .visual_font_size_6pt > strong, .visual_font_size_6pt > strong > span, .visual_font_size_6pt > span, .visual_font_size_6pt > strong > em, .visual_font_size_6pt > em > strong, .visual_font_size_6pt em span, .visual_font_size_6pt span em {
font-size: 6pt; font-size: 6pt !important;
line-height: 6pt;
} }
.visual_font_size_8pt, .visual_font_size_8pt > em, .visual_font_size_8pt > strong { .visual_font_size_8pt, .visual_font_size_8pt > em, .visual_font_size_8pt > strong, .visual_font_size_8pt > strong > span , .visual_font_size_8pt > span, .visual_font_size_8pt > strong > em, .visual_font_size_8pt > em > strong, .visual_font_size_8pt em span, .visual_font_size_8pt span em {
font-size: 8pt; font-size: 8pt !important;
line-height: 8pt;
} }
.visual_font_size_14pt, .visual_font_size_14pt > em , .visual_font_size_14pt > strong { .visual_font_size_10pt, .visual_font_size_10pt > em , .visual_font_size_10pt > strong, .visual_font_size_10pt > strong > em, .visual_font_size_10pt > em > strong, .visual_font_size_10pt em span, .visual_font_size_10pt span em {
font-size: 14pt; font-size: 10pt !important;
line-height: 10pt;
} }
.visual_font_size_24pt, .visual_font_size_24pt > em, .visual_font_size_24pt > strong { .visual_font_size_12pt, .visual_font_size_12pt > em , .visual_font_size_12pt > strong, .visual_font_size_12pt > strong > em, .visual_font_size_12pt > em > strong, .visual_font_size_12pt em span, .visual_font_size_12pt span em {
font-size: 24pt; font-size: 12pt !important;
line-height: 12pt;
} }
.visual_font_size_36pt, .visual_font_size_36pt > em, .visual_font_size_36pt > strong { .visual_font_size_14pt, .visual_font_size_14pt > em , .visual_font_size_14pt > strong, .visual_font_size_14pt > strong > span, .visual_font_size_14pt > span, .visual_font_size_14pt > strong > em, .visual_font_size_14pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 36pt; font-size: 14pt !important;
line-height: 14pt;
} }
.visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong { .visual_font_size_24pt, .visual_font_size_24pt > em, .visual_font_size_24pt > strong, .visual_font_size_24pt > strong > span , .visual_font_size_24pt > span, .visual_font_size_24pt > strong > em, .visual_font_size_24pt > em > strong, .visual_font_size_24pt em span, .visual_font_size_24pt span em {
font-size: 72pt; font-size: 24pt !important;
line-height: 24pt;
} }
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong { .visual_font_size_36pt, .visual_font_size_36pt > em, .visual_font_size_36pt > strong, .visual_font_size_36pt > strong > span, .visual_font_size_36pt > span, .visual_font_size_36pt > strong > em, .visual_font_size_36pt > em > strong, .visual_font_size_36pt em span, .visual_font_size_36pt span em {
font-size: 4pt; font-size: 36pt !important;
line-height: 36pt;
} }
.resize_visual_font_size_14pt, .resize_visual_font_size_14pt > em , .resize_visual_font_size_14pt > strong { .visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong, .visual_font_size_72pt > strong > span, .visual_font_size_72pt > span, .visual_font_size_72pt > strong > em, .visual_font_size_72pt > em > strong, .visual_font_size_72pt em span, .visual_font_size_72pt span em {
font-size: 7pt; font-size: 72pt !important;
line-height: 72pt;
} }
.resize_visual_font_size_24pt, .resize_visual_font_size_24pt > em, .resize_visual_font_size_24pt > strong {
font-size: 12pt; .visual_font_size_96pt, .visual_font_size_96pt > em, .visual_font_size_96pt > strong, .visual_font_size_96pt > strong > span, .visual_font_size_96pt > span, .visual_font_size_96pt > strong > em, .visual_font_size_96pt > em > strong, .visual_font_size_96pt em span, .visual_font_size_96pt span em {
font-size: 96pt !important;
line-height: 96pt;
} }
.resize_visual_font_size_36pt, .resize_visual_font_size_36pt > em, .resize_visual_font_size_36pt > strong {
font-size: 18pt; .visual_font_size_128pt, .visual_font_size_128pt > em, .visual_font_size_128pt > strong, .visual_font_size_128pt > strong > span, .visual_font_size_128pt > span, .visual_font_size_128pt > strong > em, .visual_font_size_128pt > em > strong, .visual_font_size_128pt em span, .visual_font_size_128pt span em {
font-size: 128pt !important;
line-height: 128pt;
} }
.resize_visual_font_size_72pt, .resize_visual_font_size_72pt > em, .resize_visual_font_size_72pt > strong {
font-size: 36pt; .visual_font_size_154pt, .visual_font_size_154pt > em, .visual_font_size_154pt > strong, .visual_font_size_154pt > strong > span, .visual_font_size_154pt > span, .visual_font_size_154pt > strong > em, .visual_font_size_154pt > em > strong, .visual_font_size_154pt em span, .visual_font_size_154pt span em {
font-size: 154pt !important;
line-height: 154pt;
}
.visual_font_size_196pt, .visual_font_size_196pt > em, .visual_font_size_196pt > strong, .visual_font_size_196pt > strong > span, .visual_font_size_196pt > span, .visual_font_size_196pt > strong > em, .visual_font_size_196pt > em > strong, .visual_font_size_196pt em span, .visual_font_size_196pt span em {
font-size: 196pt !important;
line-height: 196pt;
}
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong, .resize_visual_font_size_8pt > strong > span, .resize_visual_font_size_8pt > span, .resize_visual_font_size_8pt > strong > em, .resize_visual_font_size_8pt > em > strong, .visual_font_size_8pt em span, .visual_font_size_8pt span em {
font-size: 4pt !important;
line-height: 4pt;
}
.resize_visual_font_size_14pt, .resize_visual_font_size_14pt > em , .resize_visual_font_size_14pt > strong, .resize_visual_font_size_14pt > strong > span, .resize_visual_font_size_14pt > span, .resize_visual_font_size_14pt > strong > em, .resize_visual_font_size_14pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 7pt !important;
line-height: 7pt;
}
.resize_visual_font_size_24pt, .resize_visual_font_size_24pt > em, .resize_visual_font_size_24pt > strong, .resize_visual_font_size_24pt > strong > span, .resize_visual_font_size_24pt > span, .resize_visual_font_size_24pt > strong > em, .resize_visual_font_size_24pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 12pt !important;
line-height: 12pt;
}
.resize_visual_font_size_36pt, .resize_visual_font_size_36pt > em, .resize_visual_font_size_36pt > strong, .resize_visual_font_size_36pt > strong > span, .resize_visual_font_size_36pt > span, .resize_visual_font_size_36pt > strong > em, .resize_visual_font_size_36pt > em > strong, .visual_font_size_36pt em span, .visual_font_size_36pt span em {
font-size: 18pt !important;
line-height: 18pt;
}
.resize_visual_font_size_72pt, .resize_visual_font_size_72pt > em, .resize_visual_font_size_72pt > strong, .resize_visual_font_size_72pt > strong > span, .resize_visual_font_size_72pt > span, .resize_visual_font_size_72pt > strong > em, .resize_visual_font_size_72pt > em > strong, .visual_font_size_72pt em span, .visual_font_size_72pt span em {
font-size: 36pt !important;
line-height: 36pt;
} }
/*SIDEBAR*/ /*SIDEBAR*/
@ -3240,3 +3307,19 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
.cargatextodialogo p, .cargatextodialogo b, .cargatextodialogo a{ .cargatextodialogo p, .cargatextodialogo b, .cargatextodialogo a{
font-size:18pt; font-size:18pt;
} }
#toolbox > input{
border-width:0px 1px 0px 0px;
border-color: lightgray;
}
#toolbox > input.service_min{
border-width:0px 0px 0px 0px;
}
#toolbox > input.grid_min{
border-width:0px 0px 0px 0px;
}
#tinymce{
padding-top:20px;
}

View File

@ -367,6 +367,30 @@ div#foot {
src: local('Nunito-Regular'), url(../../fonts/nunito.woff) format('woff'); src: local('Nunito-Regular'), url(../../fonts/nunito.woff) format('woff');
} }
@font-face
{
font-family: 'roboto';
src: url('../../fonts/roboto.woff2') format('woff2');
}
@font-face
{
font-family: 'opensans';
src: url('../../fonts/opensans.woff2') format('woff2');
}
@font-face
{
font-family: 'lato';
src: url('../../fonts/lato.woff2') format('woff2');
}
@font-face
{
font-family: 'leaguegothic';
src: url('../../fonts/leaguegothic.woff') format('woff');
}
#login_body { #login_body {
/* Set rules to fill background */ /* Set rules to fill background */
min-height: 100%; min-height: 100%;
@ -2411,43 +2435,85 @@ span#plugin_description {
#tinymce { #tinymce {
text-align: left; text-align: left;
} }
.visual_font_size_4pt, .visual_font_size_4pt > em, .visual_font_size_4pt > strong { .visual_font_size_4pt, .visual_font_size_4pt > em, .visual_font_size_4pt > strong, .visual_font_size_4pt > strong > span, .visual_font_size_4pt > span, .visual_font_size_4pt > strong > em, .visual_font_size_4pt > em > strong, .visual_font_size_4pt em span, .visual_font_size_4pt span em {
font-size: 4pt; font-size: 4pt !important;
line-height: 4pt;
} }
.visual_font_size_6pt, .visual_font_size_6pt > em, .visual_font_size_6pt > strong { .visual_font_size_6pt, .visual_font_size_6pt > em, .visual_font_size_6pt > strong, .visual_font_size_6pt > strong > span, .visual_font_size_6pt > span, .visual_font_size_6pt > strong > em, .visual_font_size_6pt > em > strong, .visual_font_size_6pt em span, .visual_font_size_6pt span em {
font-size: 6pt; font-size: 6pt !important;
line-height: 6pt;
} }
.visual_font_size_8pt, .visual_font_size_8pt > em, .visual_font_size_8pt > strong { .visual_font_size_8pt, .visual_font_size_8pt > em, .visual_font_size_8pt > strong, .visual_font_size_8pt > strong > span , .visual_font_size_8pt > span, .visual_font_size_8pt > strong > em, .visual_font_size_8pt > em > strong, .visual_font_size_8pt em span, .visual_font_size_8pt span em {
font-size: 8pt; font-size: 8pt !important;
line-height: 8pt;
} }
.visual_font_size_14pt, .visual_font_size_14pt > em , .visual_font_size_14pt > strong { .visual_font_size_10pt, .visual_font_size_10pt > em , .visual_font_size_10pt > strong, .visual_font_size_10pt > strong > em, .visual_font_size_10pt > em > strong, .visual_font_size_10pt em span, .visual_font_size_10pt span em {
font-size: 14pt; font-size: 10pt !important;
line-height: 10pt;
} }
.visual_font_size_24pt, .visual_font_size_24pt > em, .visual_font_size_24pt > strong { .visual_font_size_12pt, .visual_font_size_12pt > em , .visual_font_size_12pt > strong, .visual_font_size_12pt > strong > em, .visual_font_size_12pt > em > strong, .visual_font_size_12pt em span, .visual_font_size_12pt span em {
font-size: 24pt; font-size: 12pt !important;
line-height: 12pt;
} }
.visual_font_size_36pt, .visual_font_size_36pt > em, .visual_font_size_36pt > strong { .visual_font_size_14pt, .visual_font_size_14pt > em , .visual_font_size_14pt > strong, .visual_font_size_14pt > strong > span, .visual_font_size_14pt > span, .visual_font_size_14pt > strong > em, .visual_font_size_14pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 36pt; font-size: 14pt !important;
line-height: 14pt;
} }
.visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong { .visual_font_size_24pt, .visual_font_size_24pt > em, .visual_font_size_24pt > strong, .visual_font_size_24pt > strong > span , .visual_font_size_24pt > span, .visual_font_size_24pt > strong > em, .visual_font_size_24pt > em > strong, .visual_font_size_24pt em span, .visual_font_size_24pt span em {
font-size: 72pt; font-size: 24pt !important;
line-height: 24pt;
} }
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong { .visual_font_size_36pt, .visual_font_size_36pt > em, .visual_font_size_36pt > strong, .visual_font_size_36pt > strong > span, .visual_font_size_36pt > span, .visual_font_size_36pt > strong > em, .visual_font_size_36pt > em > strong, .visual_font_size_36pt em span, .visual_font_size_36pt span em {
font-size: 4pt; font-size: 36pt !important;
line-height: 36pt;
} }
.resize_visual_font_size_14pt, .resize_visual_font_size_14pt > em , .resize_visual_font_size_14pt > strong { .visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong, .visual_font_size_72pt > strong > span, .visual_font_size_72pt > span, .visual_font_size_72pt > strong > em, .visual_font_size_72pt > em > strong, .visual_font_size_72pt em span, .visual_font_size_72pt span em {
font-size: 7pt; font-size: 72pt !important;
} line-height: 72pt;
.resize_visual_font_size_24pt, .resize_visual_font_size_24pt > em, .resize_visual_font_size_24pt > strong {
font-size: 12pt;
}
.resize_visual_font_size_36pt, .resize_visual_font_size_36pt > em, .resize_visual_font_size_36pt > strong {
font-size: 18pt;
}
.resize_visual_font_size_72pt, .resize_visual_font_size_72pt > em, .resize_visual_font_size_72pt > strong {
font-size: 36pt;
} }
.visual_font_size_96pt, .visual_font_size_96pt > em, .visual_font_size_96pt > strong, .visual_font_size_96pt > strong > span, .visual_font_size_96pt > span, .visual_font_size_96pt > strong > em, .visual_font_size_96pt > em > strong, .visual_font_size_96pt em span, .visual_font_size_96pt span em {
font-size: 96pt !important;
line-height: 96pt;
}
.visual_font_size_128pt, .visual_font_size_128pt > em, .visual_font_size_128pt > strong, .visual_font_size_128pt > strong > span, .visual_font_size_128pt > span, .visual_font_size_128pt > strong > em, .visual_font_size_128pt > em > strong, .visual_font_size_128pt em span, .visual_font_size_128pt span em {
font-size: 128pt !important;
line-height: 128pt;
}
.visual_font_size_154pt, .visual_font_size_154pt > em, .visual_font_size_154pt > strong, .visual_font_size_154pt > strong > span, .visual_font_size_154pt > span, .visual_font_size_154pt > strong > em, .visual_font_size_154pt > em > strong, .visual_font_size_154pt em span, .visual_font_size_154pt span em {
font-size: 154pt !important;
line-height: 154pt;
}
.visual_font_size_196pt, .visual_font_size_196pt > em, .visual_font_size_196pt > strong, .visual_font_size_196pt > strong > span, .visual_font_size_196pt > span, .visual_font_size_196pt > strong > em, .visual_font_size_196pt > em > strong, .visual_font_size_196pt em span, .visual_font_size_196pt span em {
font-size: 196pt !important;
line-height: 196pt;
}
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong, .resize_visual_font_size_8pt > strong > span, .resize_visual_font_size_8pt > span, .resize_visual_font_size_8pt > strong > em, .resize_visual_font_size_8pt > em > strong, .visual_font_size_8pt em span, .visual_font_size_8pt span em {
font-size: 4pt !important;
line-height: 4pt;
}
.resize_visual_font_size_14pt, .resize_visual_font_size_14pt > em , .resize_visual_font_size_14pt > strong, .resize_visual_font_size_14pt > strong > span, .resize_visual_font_size_14pt > span, .resize_visual_font_size_14pt > strong > em, .resize_visual_font_size_14pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 7pt !important;
line-height: 7pt;
}
.resize_visual_font_size_24pt, .resize_visual_font_size_24pt > em, .resize_visual_font_size_24pt > strong, .resize_visual_font_size_24pt > strong > span, .resize_visual_font_size_24pt > span, .resize_visual_font_size_24pt > strong > em, .resize_visual_font_size_24pt > em > strong, .visual_font_size_14pt em span, .visual_font_size_14pt span em {
font-size: 12pt !important;
line-height: 12pt;
}
.resize_visual_font_size_36pt, .resize_visual_font_size_36pt > em, .resize_visual_font_size_36pt > strong, .resize_visual_font_size_36pt > strong > span, .resize_visual_font_size_36pt > span, .resize_visual_font_size_36pt > strong > em, .resize_visual_font_size_36pt > em > strong, .visual_font_size_36pt em span, .visual_font_size_36pt span em {
font-size: 18pt !important;
line-height: 18pt;
}
.resize_visual_font_size_72pt, .resize_visual_font_size_72pt > em, .resize_visual_font_size_72pt > strong, .resize_visual_font_size_72pt > strong > span, .resize_visual_font_size_72pt > span, .resize_visual_font_size_72pt > strong > em, .resize_visual_font_size_72pt > em > strong, .visual_font_size_72pt em span, .visual_font_size_72pt span em {
font-size: 36pt !important;
line-height: 36pt;
}
/*SIDEBAR*/ /*SIDEBAR*/
.menu_sidebar { .menu_sidebar {
color:#111; color:#111;
@ -3296,3 +3362,20 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
.cargatextodialogo p, .cargatextodialogo b, .cargatextodialogo a{ .cargatextodialogo p, .cargatextodialogo b, .cargatextodialogo a{
font-size:18pt; font-size:18pt;
} }
#toolbox > input{
border-width:0px 1px 0px 0px;
border-color: lightgray;
}
#toolbox > input.service_min{
border-width:0px 0px 0px 0px;
}
#toolbox > input.grid_min{
border-width:0px 0px 0px 0px;
}
#tinymce{
padding-top:20px;
}

View File

@ -509,7 +509,41 @@ if (! isset ($config['id_user'])) {
exit ("</html>"); exit ("</html>");
} }
} }
else {
$user_in_db = db_get_row_filter('tusuario',
array('id_user' => $config['id_user']), '*');
if ($user_in_db == false) {
//logout
$_REQUEST = array ();
$_GET = array ();
$_POST = array ();
$config["auth_error"] = __("User doesn\'t exist.");
$iduser = $_SESSION["id_usuario"];
logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]);
unset($_SESSION["id_usuario"]);
unset($iduser);
require_once ('general/login_page.php');
while (@ob_end_flush ());
exit ("</html>");
}
else {
if (((bool) $user_in_db['is_admin'] === false) &&
((bool) $user_in_db['not_login'] === true)) {
//logout
$_REQUEST = array ();
$_GET = array ();
$_POST = array ();
$config["auth_error"] = __("User only can use the API.");
$iduser = $_SESSION["id_usuario"];
logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]);
unset($_SESSION["id_usuario"]);
unset($iduser);
require_once ('general/login_page.php');
while (@ob_end_flush ());
exit ("</html>");
}
}
}
// Log off // Log off
if (isset ($_GET["bye"])) { if (isset ($_GET["bye"])) {
include ("general/logoff.php"); include ("general/logoff.php");

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0dev'; $version = '7.0dev';
$build = '170111'; $build = '170118';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -386,7 +386,7 @@ if ($print_agent) {
if(is_metaconsole()) { if(is_metaconsole()) {
ui_toggle( ui_toggle(
printFormFilterAlert($id_group, $filter, $free_search, printFormFilterAlert($id_group, $filter, $free_search,
$url, $filter_standby, $tag_filter, true, $strict_user), $url, $filter_standby, $tag_filter, false, true, $strict_user),
__('Show Options'));; __('Show Options'));;
} }
else { else {

View File

@ -38,6 +38,7 @@ if (is_ajax ()) {
$get_modules_group_json = (bool) get_parameter ("get_modules_group_json"); $get_modules_group_json = (bool) get_parameter ("get_modules_group_json");
$get_agent_modules_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_json_for_multiple_agents"); $get_agent_modules_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_json_for_multiple_agents");
$get_agent_modules_alerts_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_alerts_json_for_multiple_agents"); $get_agent_modules_alerts_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_alerts_json_for_multiple_agents");
$get_agent_modules_multiple_alerts_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_multiple_alerts_json_for_multiple_agents");
$get_agents_json_for_multiple_modules = (bool) get_parameter("get_agents_json_for_multiple_modules"); $get_agents_json_for_multiple_modules = (bool) get_parameter("get_agents_json_for_multiple_modules");
$get_agent_modules_json_for_multiple_agents_id = (bool) get_parameter("get_agent_modules_json_for_multiple_agents_id"); $get_agent_modules_json_for_multiple_agents_id = (bool) get_parameter("get_agent_modules_json_for_multiple_agents_id");
$get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip"); $get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip");
@ -273,6 +274,46 @@ if (is_ajax ()) {
} }
if ($get_agent_modules_alerts_json_for_multiple_agents) { if ($get_agent_modules_alerts_json_for_multiple_agents) {
$idAgents = (array) get_parameter('id_agent');
$templates = (array) get_parameter('templates');
$selection_mode = get_parameter('selection_mode','common');
$sql = 'SELECT DISTINCT(nombre)
FROM tagente_modulo t1, talert_template_modules t2
WHERE t2.id_agent_module = t1.id_agente_modulo
AND delete_pending = 0
AND id_alert_template IN (' . implode(',', $templates) . ')
AND id_agente IN (' . implode(',', $idAgents) . ')';
if ($selection_mode == 'common') {
$sql .= ' AND (
SELECT count(nombre)
FROM tagente_modulo t3, talert_template_modules t4
WHERE t4.id_agent_module = t3.id_agente_modulo
AND delete_pending = 0 AND t1.nombre = t3.nombre
AND id_agente IN (' . implode(',', $idAgents) . ')
AND id_alert_template IN (' . implode(',', $templates) . ')) = (' . count($idAgents) . ')';
}
$sql .= ' ORDER BY t1.nombre';
$nameModules = db_get_all_rows_sql($sql);
if ($nameModules == false) {
$nameModules = array();
}
$result = array();
foreach($nameModules as $nameModule) {
$result[] = io_safe_output($nameModule['nombre']);
}
echo json_encode($result);
return;
}
if ($get_agent_modules_multiple_alerts_json_for_multiple_agents) {
$idAgents = get_parameter('id_agent'); $idAgents = get_parameter('id_agent');
$id_template = get_parameter('template'); $id_template = get_parameter('template');

View File

@ -0,0 +1,235 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
// Login check
require ($config['homedir'] . '/include/functions_visual_map.php');
check_login ();
if (!defined('METACONSOLE'))
$id_layout = (int) get_parameter ('id');
else
$id_layout = (int) get_parameter ('id_visualmap');
if ($id_layout) {
$default_action = 'edit';
}
else {
$default_action = 'new';
}
if (!defined('METACONSOLE')) {
$action = get_parameterBetweenListValues('action',
array('new', 'save', 'edit', 'update', 'delete'), $default_action);
}
else {
$action = get_parameterBetweenListValues('action2',
array('new', 'save', 'edit', 'update', 'delete'), $default_action);
}
$refr = (int) get_parameter ('refr', $config['vc_refr']);
$graph_javascript = (bool) get_parameter ('graph_javascript', false);
$vc_refr = false;
if (isset($config['vc_refr']) and $config['vc_refr'] != 0)
$view_refresh = $config['vc_refr'];
else
$view_refresh = '300';
// Get input parameter for layout id
if (! $id_layout) {
db_pandora_audit("ACL Violation",
"Trying to access visual console without id layout");
include ("general/noaccess.php");
exit;
}
$layout = db_get_row ('tlayout', 'id', $id_layout);
if (! $layout) {
db_pandora_audit("ACL Violation",
"Trying to access visual console without id layout");
include ("general/noaccess.php");
exit;
}
$id_group = $layout["id_group"];
$layout_name = $layout["name"];
$background = $layout["background"];
$bwidth = $layout["width"];
$bheight = $layout["height"];
$pure_url = "&pure=" . $config["pure"];
// ACL
$vconsole_read = check_acl ($config["id_user"], $id_group, "VR");
$vconsole_write = check_acl ($config["id_user"], $id_group, "VW");
$vconsole_manage = check_acl ($config["id_user"], $id_group, "VM");
if (! $vconsole_read && !$vconsole_write && !$vconsole_manage) {
db_pandora_audit("ACL Violation",
"Trying to access visual console without group access");
require ("general/noaccess.php");
exit;
}
// Render map
$options = array();
$options['consoles_list']['text'] =
'<a href="index.php?sec=network&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' .
html_print_image ("images/visual_console.png", true,
array ("title" => __('Visual consoles list'))) . '</a>';
if ($vconsole_write || $vconsole_manage) {
$url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action=';
$hash = md5($config["dbpass"] . $id_layout . $config["id_user"]);
$options['public_link']['text'] = '<a href="' . ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"]) . '" target="_blank">'.
html_print_image ("images/camera_mc.png", true,
array ("title" => __('Show link to public Visual Console'))).'</a>';
$options['public_link']['active'] = false;
$options['data']['text'] = '<a href="' . $url_base . $action . '&tab=data&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/op_reporting.png", true,
array ("title" => __('Main data'))) .'</a>';
$options['list_elements']['text'] = '<a href="' . $url_base . $action . '&tab=list_elements&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/list.png", true,
array ("title" => __('List elements'))) .'</a>';
if (enterprise_installed()) {
$options['wizard_services']['text'] = '<a href="' . $url_base . $action . '&tab=wizard_services&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/wand_services.png", true,
array ("title" => __('Services wizard'))) .'</a>';
}
$options['wizard']['text'] = '<a href="' . $url_base . $action . '&tab=wizard&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/wand.png", true,
array ("title" => __('Wizard'))) .'</a>';
$options['editor']['text'] = '<a href="' . $url_base . $action . '&tab=editor&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/builder.png", true,
array ("title" => __('Builder'))) .'</a>';
}
$options['view']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id=' . $id_layout . '&refr=' . $view_refresh . '">'
. html_print_image("images/operation.png", true, array ("title" => __('View'))) .'</a>';
$options['view']['active'] = true;
if (!is_metaconsole()) {
if (!$config['pure']) {
$options['pure']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$id_layout.'&refr='.$refr.'&pure=1">'
. html_print_image('images/full_screen.png', true, array('title' => __('Full screen mode')))
. "</a>";
ui_print_page_header($layout_name, 'images/visual_console.png', false, '', false, $options);
}
//Set the hidden value for the javascript
html_print_input_hidden('metaconsole', 0);
}
else {
//Set the hidden value for the javascript
html_print_input_hidden('metaconsole', 1);
}
visual_map_print_visual_map ($id_layout, true, true,
null, null, '', false, $graph_javascript);
?>
<style type="text/css">
/* Avoid the main_pure container 1000px height */
body.pure {
min-height: 100px;
}
div#main_pure {
height: 100%;
margin: 0px;
}
</style>
<?php
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
$ignored_params['refr'] = '';
?>
<script language="javascript" type="text/javascript">
$(document).ready (function () {
var refr = <?php echo (int)$refr; ?>;
var pure = <?php echo (int) $config['pure']; ?>;
var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>";
$(".module_graph .menu_graph").css('display','none');
$(".parent_graph").each(function(){
if($(this).css('background-color') != 'rgb(255, 255, 255)'){
$(this).css('color', '#999');
}
});
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
$('.item:not(.icon) img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('.item > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('.item > a > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2-5)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
});
</script>

View File

@ -217,7 +217,6 @@ $ignored_params['refr'] = '';
var refr = <?php echo (int)$refr; ?>; var refr = <?php echo (int)$refr; ?>;
var pure = <?php echo (int) $config['pure']; ?>; var pure = <?php echo (int) $config['pure']; ?>;
var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>"; var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>";
if (pure) { if (pure) {
var startCountDown = function (duration, cb) { var startCountDown = function (duration, cb) {
$('div.vc-countdown').countdown('destroy'); $('div.vc-countdown').countdown('destroy');
@ -233,7 +232,13 @@ $ignored_params['refr'] = '';
$('div.vc-countdown').countdown('destroy'); $('div.vc-countdown').countdown('destroy');
//cb(); //cb();
url = js_html_entity_decode( href ) + duration; url = js_html_entity_decode( href ) + duration;
$(document).attr ("location", url); //$(document).attr ("location", url);
$.get(window.location.href.replace("render_view","pure_ajax"), function(respuestaSolicitud){
$('#background_<?php echo $id_layout; ?>').html(respuestaSolicitud);
startCountDown(refr, false);
});
} }
}); });
} }
@ -277,20 +282,96 @@ $ignored_params['refr'] = '';
}); });
} }
/*
$(".module_graph").each(function(){ $(".module_graph").each(function(){
left = parseInt($(this).css("left")) + 150; left = parseInt($(this).css("left")) + 150 + ((parseInt($(this).css("width"))-300)/2);
$(this).css('left', left); $(this).css('left', left);
}); });
$(".parent_graph").each(function(){ $('.item:not([class~="module_graph"])').each(function(){
if($(this).css('background-color') != 'rgb(255, 255, 255)'){ left = parseInt($(this).css('left')) + ((parseInt($('#' + $(this).attr('id')).css('width')) - parseInt($('#' + $(this).attr('id') + " img").css('width')))*0.5);
$(this).css('color', 'red');
$(this).css('left', left);
}
}); });
*/
$(".module_graph .menu_graph").css('display','none');
$(".parent_graph").each(function(){
if($(this).css('background-color') != 'rgb(255, 255, 255)'){
$(this).css('color', '#999');
}
});
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
$('.item:not(.icon) img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('.item > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('.item > a > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2-5)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
/*
$('.percentile_item a > img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
*/
}); });
</script> </script>

View File

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

View File

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

View File

@ -66,7 +66,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1'); INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev'); INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170111'); INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170118');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -1381,6 +1381,7 @@ CREATE TABLE tlayout_data (
id_custom_graph NUMBER(10, 0) DEFAULT 0, id_custom_graph NUMBER(10, 0) DEFAULT 0,
border_width NUMBER(10, 0) DEFAULT 0, border_width NUMBER(10, 0) DEFAULT 0,
type_graph VARCHAR2(50) DEFAULT 'area', type_graph VARCHAR2(50) DEFAULT 'area',
label_position VARCHAR2(50) DEFAULT 'down',
border_color VARCHAR2(200) DEFAULT '', border_color VARCHAR2(200) DEFAULT '',
fill_color VARCHAR2(200) DEFAULT '' fill_color VARCHAR2(200) DEFAULT ''
); );

View File

@ -1142,6 +1142,7 @@ CREATE TABLE "tlayout_data" (
"id_custom_graph" INTEGER NOT NULL default 0, "id_custom_graph" INTEGER NOT NULL default 0,
"border_width" INTEGER NOT NULL default 0, "border_width" INTEGER NOT NULL default 0,
"type_graph" varchar(50) NOT NULL DEFAULT 'area', "type_graph" varchar(50) NOT NULL DEFAULT 'area',
"label_position" varchar(50) NOT NULL DEFAULT 'down',
"border_color" varchar(200) DEFAULT '', "border_color" varchar(200) DEFAULT '',
"fill_color" varchar(200) DEFAULT '' "fill_color" varchar(200) DEFAULT ''
); );

View File

@ -1269,6 +1269,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
`id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0,
`border_width` INTEGER UNSIGNED NOT NULL default 0, `border_width` INTEGER UNSIGNED NOT NULL default 0,
`type_graph` varchar(50) NOT NULL default 'area', `type_graph` varchar(50) NOT NULL default 'area',
`label_position` varchar(50) NOT NULL default 'down',
`border_color` varchar(200) DEFAULT "", `border_color` varchar(200) DEFAULT "",
`fill_color` varchar(200) DEFAULT "", `fill_color` varchar(200) DEFAULT "",
PRIMARY KEY(`id`) PRIMARY KEY(`id`)

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0dev-170111 Version: 7.0dev-170118
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0dev %define version 7.0dev
%define release 170111 %define release 170118
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0dev %define version 7.0dev
%define release 170111 %define release 170118
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170111" PI_BUILD="170118"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

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

Some files were not shown because too many files have changed in this diff Show More