Merge branch '2396-fallo-acl-en-vista-de-cluster' of https://brutus.artica.lan:8081/artica/pandorafms into 2396-fallo-acl-en-vista-de-cluster

This commit is contained in:
manuel.montes 2018-06-29 08:52:46 +02:00
commit 5436c64800
73 changed files with 695 additions and 376 deletions

View File

@ -54,22 +54,25 @@ AGENT_WIN_FILE="$CODEHOME/pandora_agents/win32/pandora.cc"
AGENT_WIN_MPI_FILE="$CODEHOME/pandora_agents/win32/installer/pandora.mpi"
AGENT_WIN_RC_FILE="$CODEHOME/pandora_agents/win32/versioninfo.rc"
SATELLITE_FILE="$PANDHOME_ENT/satellite_server/satellite_server.pl"
PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \
PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl \
$PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \
$PANDHOME_ENT/pandora_plugins/Sybase/sybase_plugin.pl \
$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \
$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \
$PANDHOME_ENT/pandora_plugins/SNMP/snmp_bandwith.pl \
$PANDHOME_ENT/pandora_plugins/laboratory/cacti/cacti2pandora.pl \
$PANDHOME_ENT/pandora_plugins/MarkLogic/pandora_marklogic.pl \
$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \
$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \
$PANDHOME_ENT/pandora_plugins/Apache/pandora_apache.pl \
$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \
$PANDHOME_ENT/pandora_plugins/Oracle/Database/pandora_oracle.pl \
$PANDHOME_ENT/pandora_plugins/OpenNebula/pandora_opennebula.pl \
$PANDHOME_ENT/pandora_plugins/Nutanix/pandora_nutanix.pl \
$PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \
$PANDHOME_ENT/pandora_plugins/Informix/informix.pl \
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \
$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \
$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \
$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \
$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \
$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl "
$PANDHOME_ENT/pandora_plugins/Docker/docker_services.pl \
$PANDHOME_ENT/pandora_plugins/Docker/docker_stats.pl \
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl "
PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm"
# Update version in spec files

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.724-180625
Version: 7.0NG.724-180628
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.724"
PI_BUILD="180625"
PI_BUILD="180628"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{180625}
{180628}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.724-180625
Version: 7.0NG.724-180628
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -110,8 +110,8 @@ function pandora_realtime_graphs () {
$refresh_fields[30000] = human_time_description_raw(30, true, 'large');
if ($graph == 'snmp_module') {
$agent_alias = get_parameter('agent_alias', '');
$module_name = get_parameter('module_name', '');
$agent_alias = io_safe_output(get_parameter('agent_alias', '')) ;
$module_name = io_safe_output(get_parameter('module_name', '')) ;
$module_incremental = get_parameter ('incremental', 0);
$data['module_info'] = "$agent_alias: <b>$module_name</b>";

View File

@ -0,0 +1,13 @@
START TRANSACTION;
ALTER TABLE `tservice` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL DEFAULT '0';
ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL DEFAULT '0';
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `cps` int NOT NULL DEFAULT '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL DEFAULT '0';
COMMIT;

View File

@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `tservice` (
`id_template_alert_warning` int(10) unsigned NOT NULL default 0,
`id_template_alert_critical` int(10) unsigned NOT NULL default 0,
`id_template_alert_unknown` int(10) unsigned NOT NULL default 0,
`id_template_alert_critical_sla` int(10) unsigned NOT NULL default 0,
`id_template_alert_critical_sla` int(10) unsigned NOT NULL default 0
PRIMARY KEY (`id`)
) ENGINE=InnoDB
COMMENT = 'Table to define services to monitor'
@ -1175,7 +1175,7 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 17);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 18);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
@ -1229,6 +1229,7 @@ ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL defa
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL;
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
@ -1258,8 +1259,17 @@ ALTER TABLE tagente ADD COLUMN `cascade_protection_module` int(10) unsigned NOT
ALTER TABLE tagente ADD COLUMN (alias varchar(600) not null default '');
ALTER TABLE tagente ADD `alias_as_name` int(2) unsigned default '0';
ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL default 0;
UPDATE tagente SET tagente.alias = tagente.nombre;
-- ---------------------------------------------------------------------
-- Table `tservice`
-- ---------------------------------------------------------------------
ALTER TABLE `tservice` ADD COLUMN `quiet` tinyint(1) NOT NULL default 0;
ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL default 0;
ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tlayout`
-- ---------------------------------------------------------------------
@ -1353,6 +1363,7 @@ ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT N
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT '';
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias_as_name` int(2) unsigned default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0';
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `cps` int NOT NULL default 0;
UPDATE `tmetaconsole_agent` SET tmetaconsole_agent.alias = tmetaconsole_agent.nombre;
-- ---------------------------------------------------------------------

View File

@ -515,9 +515,24 @@ $table->data[4][3] = html_print_input_text ('url_description',
$url_description, '', 45, 255, true);
$table->data[5][2] = __('Quiet');
$table->data[5][3] = ui_print_help_tip(
__('The agent still runs but the alerts and events will be stop'), true);
$table->data[5][3] .= html_print_checkbox('quiet', 1, $quiet, true);
$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true);
$cps_array[-1] = __('Disabled');
if($cps > 0){
$cps_array[$cps] = __('Enabled');
}
else{
$cps_inc = 0;
if($id_agente){
$cps_inc = service_agents_cps($id_agente);
}
$cps_array[$cps_inc] = __('Enabled');
}
$table->data[6][0] = __('Cascade protection services');
$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true);
ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table);
@ -659,6 +674,13 @@ ui_require_jquery_file('bgiframe');
return
}
// On agent creation PHP will update the secondary groups table (not via AJAX)
if (id_agent == 0) {
agent_manager_add_secondary_groups_ui();
agent_manager_update_hidden_input_secondary();
return;
}
var selected_items = new Array();
$("#secondary_groups option:selected").each(function(){
selected_items.push($(this).val())
@ -679,11 +701,7 @@ ui_require_jquery_file('bgiframe');
data: data,
success: function (data) {
if (data == 1) {
// Move from one input to the other
$("#secondary_groups_selected option[value=0]").remove()
$("#secondary_groups option:selected").each(function() {
$(this).remove().appendTo("#secondary_groups_selected")
})
agent_manager_add_secondary_groups_ui();
} else {
console.error("Error in AJAX call to add secondary groups")
}
@ -697,6 +715,13 @@ ui_require_jquery_file('bgiframe');
function agent_manager_remove_secondary_groups (event, id_agent) {
event.preventDefault();
// On agent creation PHP will update the secondary groups table (not via AJAX)
if (id_agent == 0) {
agent_manager_remove_secondary_groups_ui();
agent_manager_update_hidden_input_secondary();
return;
}
var selected_items = new Array();
$("#secondary_groups_selected option:selected").each(function(){
selected_items.push($(this).val())
@ -717,18 +742,7 @@ ui_require_jquery_file('bgiframe');
data: data,
success: function (data) {
if (data == 1) {
// Remove the groups selected if success
$("#secondary_groups_selected option:selected").each(function(){
$(this).remove().appendTo("#secondary_groups")
})
// Add none if empty select
if ($("#secondary_groups_selected option").length == 0) {
$("#secondary_groups_selected").append($('<option>',{
value: 0,
text: "<?php echo __("None");?>"
}))
}
agent_manager_remove_secondary_groups_ui();
} else {
console.error("Error in AJAX call to add secondary groups")
}
@ -739,6 +753,46 @@ ui_require_jquery_file('bgiframe');
});
}
// Move from left input to right input
function agent_manager_add_secondary_groups_ui () {
$("#secondary_groups_selected option[value=0]").remove()
$("#secondary_groups option:selected").each(function() {
$(this).remove().appendTo("#secondary_groups_selected")
})
}
// Move from right input to left input
function agent_manager_remove_secondary_groups_ui () {
// Remove the groups selected if success
$("#secondary_groups_selected option:selected").each(function(){
$(this).remove().appendTo("#secondary_groups")
})
// Add none if empty select
if ($("#secondary_groups_selected option").length == 0) {
$("#secondary_groups_selected").append($('<option>',{
value: 0,
text: "<?php echo __("None");?>"
}))
}
}
function agent_manager_update_hidden_input_secondary () {
var groups = [];
if(!$('form[name="conf_agent"] #secondary_hidden').length) {
$('form[name="conf_agent"]').append(
'<input name="secondary_hidden" type="hidden" id="secondary_hidden">'
);
}
var groups = new Array();
$("#secondary_groups_selected option").each(function() {
groups.push($(this).val())
})
$("#secondary_hidden").val(groups.join(','));
}
$(document).ready (function() {
$("select#id_os").pandoraSelectOS ();

View File

@ -84,6 +84,7 @@ $direccion_agente = io_safe_input($direccion_agente);
$intervalo = SECONDS_5MINUTES;
$ff_interval = 0;
$quiet_module = 0;
$cps_module = 0;
$id_server = "";
$max_alerts = 0;
$modo = 1;
@ -148,6 +149,7 @@ $tab_description = '';
$url_description = '';
$quiet = 0;
$macros = '';
$cps = 0;
$create_agent = (bool)get_parameter('create_agent');
$module_macros = array ();
@ -161,7 +163,7 @@ if ($create_agent) {
//safe_output only validate ip
$direccion_agente = trim(io_safe_output($direccion_agente));
if(!validate_address($direccion_agente)){
$mssg_warning = 1;
}
@ -187,11 +189,13 @@ if ($create_agent) {
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
$quiet = (int) get_parameter("quiet", 0);
$cps = (int) get_parameter("cps", 0);
$secondary_groups = (string) get_parameter("secondary_hidden", "");
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) $fields = array();
$field_values = array();
foreach ($fields as $field) {
@ -216,8 +220,10 @@ if ($create_agent) {
}
if(!$exists_alias){
$id_agente = db_process_sql_insert ('tagente',
array ('nombre' => $nombre_agente,
$id_agente = db_process_sql_insert (
'tagente',
array (
'nombre' => $nombre_agente,
'alias' => $alias,
'alias_as_name' => $alias_as_name,
'direccion' => $direccion_agente,
@ -235,7 +241,10 @@ if ($create_agent) {
'icon_path' => $icon_path,
'update_gis_data' => $update_gis_data,
'url_address' => $url_description,
'quiet' => $quiet));
'quiet' => $quiet,
'cps' => $cps
)
);
enterprise_hook ('update_agent', array ($id_agente));
}
else{
@ -253,19 +262,19 @@ if ($create_agent) {
if ( $direccion_agente != '') {
agents_add_address ($id_agente, $direccion_agente);
}
$agent_created_ok = true;
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$grupo);
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $old_group) {
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente));
}
}
$info = '{"Name":"' . $nombre_agente .'",
"IP":"' . $direccion_agente .'",
"Group":"' . $grupo .'",
@ -282,8 +291,14 @@ if ($create_agent) {
"Icon path":"' . $icon_path .'",
"Update GIS data":"' . $update_gis_data .'",
"Url description":"' . $url_description .'",
"Quiet":"' . (int)$quiet.'"}';
"Quiet":"' . (int)$quiet.'",
"Cps":"' . (int)$cps.'"}';
// Create the secondary groups
enterprise_hook('agents_update_secondary_groups',
array($id_agente, explode(',', $secondary_groups), array())
);
$unsafe_alias = io_safe_output($alias);
db_pandora_audit("Agent management",
"Created agent $unsafe_alias", false, true, $info);
@ -743,6 +758,7 @@ if ($update_agent) { // if modified some agent paramenter
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
$quiet = (int) get_parameter("quiet", 0);
$cps = (int) get_parameter("cps", 0);
$old_interval = db_get_value('intervalo', 'tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -794,47 +810,49 @@ if ($update_agent) { // if modified some agent paramenter
$direccion_agente != agents_get_address ($id_agente)) {
agents_add_address ($id_agente, $direccion_agente);
}
$action_delete_ip = (bool)get_parameter('delete_ip', false);
//If IP is set for deletion, delete first
if ($action_delete_ip) {
$delete_ip = get_parameter_post ("address_list");
$direccion_agente = agents_delete_address($id_agente, $delete_ip);
}
$values = array ('disabled' => $disabled,
'id_parent' => $id_parent,
'id_os' => $id_os,
'modo' => $modo,
'alias' => $alias,
'alias_as_name' => $alias_as_name,
'direccion' => $direccion_agente,
'id_grupo' => $grupo,
'intervalo' => $intervalo,
'comentarios' => $comentarios,
'cascade_protection' => $cascade_protection,
'cascade_protection_module' => $cascade_protection_module,
'server_name' => $server_name,
'custom_id' => $custom_id,
'icon_path' => $icon_path,
'update_gis_data' => $update_gis_data,
'url_address' => $url_description,
'url_address' => $url_description,
'quiet' => $quiet,
'safe_mode_module' => $safe_mode_module);
$values = array (
'disabled' => $disabled,
'id_parent' => $id_parent,
'id_os' => $id_os,
'modo' => $modo,
'alias' => $alias,
'alias_as_name' => $alias_as_name,
'direccion' => $direccion_agente,
'id_grupo' => $grupo,
'intervalo' => $intervalo,
'comentarios' => $comentarios,
'cascade_protection' => $cascade_protection,
'cascade_protection_module' => $cascade_protection_module,
'server_name' => $server_name,
'custom_id' => $custom_id,
'icon_path' => $icon_path,
'update_gis_data' => $update_gis_data,
'url_address' => $url_description,
'url_address' => $url_description,
'quiet' => $quiet,
'cps' => $cps,
'safe_mode_module' => $safe_mode_module
);
if ($config['metaconsole_agent_cache'] == 1) {
$values['update_module_count'] = 1; // Force an update of the agent cache.
}
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente);
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$group_old);
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
if ($result == false && $update_custom_result == false) {
ui_print_error_message(
__('There was a problem updating the agent'));
@ -868,7 +886,7 @@ if ($update_agent) { // if modified some agent paramenter
foreach ($tpolicy_group as $key => $value) {
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente);
if(!$tpolicy_agents){
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente));
@ -879,7 +897,7 @@ if ($update_agent) { // if modified some agent paramenter
}
}
}
$info = '{
"id_agente":"' . $id_agente . '",
"alias":"' . $alias . '",
@ -897,8 +915,9 @@ if ($update_agent) { // if modified some agent paramenter
"Icon Path":"' . $icon_path . '",
"Update GIS data":"' .$update_gis_data .'",
"Url description":"' . $url_description .'",
"Quiet":"' . (int)$quiet.'"}';
"Quiet":"' . (int)$quiet.'",
"Cps":"' . (int)$cps.'"}';
enterprise_hook ('update_agent', array ($id_agente));
ui_print_success_message (__('Successfully updated'));
db_pandora_audit("Agent management",
@ -918,14 +937,14 @@ if ($id_agente) {
require ("general/noaccess.php");
exit;
}
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
if (empty ($agent)) {
//Close out the page
ui_print_error_message (__('There was a problem loading the agent'));
return;
}
$intervalo = $agent["intervalo"]; // Define interval in seconds
$nombre_agente = $agent["nombre"];
if(empty($alias)){
@ -951,6 +970,7 @@ if ($id_agente) {
$update_gis_data = $agent["update_gis_data"];
$url_description = $agent["url_address"];
$quiet = $agent["quiet"];
$cps = $agent["cps"];
$safe_mode_module = $agent["safe_mode_module"];
$safe_mode = ($safe_mode_module) ? 1 : 0;
}
@ -967,7 +987,7 @@ $edit_module = (bool) get_parameter ('edit_module');
// GET DATA for MODULE UPDATE OR MODULE INSERT
if ($update_module || $create_module) {
$id_grupo = agents_get_agent_group ($id_agente);
$id_agent_module = (int) get_parameter ('id_agent_module');
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
@ -1001,6 +1021,7 @@ if ($update_module || $create_module) {
$interval = (int) get_parameter ('module_interval', $intervalo);
$ff_interval = (int) get_parameter ('module_ff_interval');
$quiet_module = (int) get_parameter ('quiet_module');
$cps_module = (int) get_parameter ('cps_module');
$id_plugin = (int) get_parameter ('id_plugin');
$id_export = (int) get_parameter ('id_export');
$disabled = (bool) get_parameter ('disabled');
@ -1318,6 +1339,7 @@ if ($update_module) {
'unit' => io_safe_output($unit),
'macros' => $macros,
'quiet' => $quiet_module,
'cps' => $cps_module,
'critical_instructions' => $critical_instructions,
'warning_instructions' => $warning_instructions,
'unknown_instructions' => $unknown_instructions,
@ -1362,8 +1384,8 @@ if ($update_module) {
}
else {
$check_dynamic =
db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed
FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module);
db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed
FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module);
if( ($check_dynamic['dynamic_interval'] == $dynamic_interval) &&
($check_dynamic['dynamic_max'] == $dynamic_max) &&
@ -1500,6 +1522,7 @@ if ($create_module) {
'unit' => io_safe_output($unit),
'macros' => $macros,
'quiet' => $quiet_module,
'cps' => $cps_module,
'critical_instructions' => $critical_instructions,
'warning_instructions' => $warning_instructions,
'unknown_instructions' => $unknown_instructions,

View File

@ -177,11 +177,11 @@ echo "</td>";
echo "<td>";
echo __('Operative System') . '&nbsp;';
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.description from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$fields = array();
foreach ($pre_fields as $key => $value) {
$fields[$value['id_os']] = $value['description'];
$fields[$value['id_os']] = $value['name'];
}
html_print_select($fields,"os",$os,'this.form.submit()','All',0);
@ -564,7 +564,7 @@ if ($agents !== false) {
if ($agent['quiet']) {
echo "&nbsp;";
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
html_print_image("images/dot_blue.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
}
if ($in_planned_downtime) {

View File

@ -650,7 +650,7 @@ foreach ($modules as $module) {
}
if ($module['quiet']) {
$data[0] .= html_print_image("images/dot_green.disabled.png",
$data[0] .= html_print_image("images/dot_blue.png",
true, array("border" => '0', "title" => __('Quiet'),
"alt" => "")) . "&nbsp;";
}

View File

@ -162,6 +162,7 @@ if ($id_agent_module) {
}
$ff_interval = $module['module_ff_interval'];
$quiet_module = $module['quiet'];
$cps_module = $module['cps'];
$unit = $module['unit'];
$tcp_port = $module['tcp_port'];
$tcp_send = $module['tcp_send'];
@ -289,7 +290,7 @@ if ($id_agent_module) {
else {
if (!isset ($moduletype)) {
$moduletype = (string) get_parameter ('moduletype');
// Clean up specific network modules fields
$name = '';
$description = '';
@ -302,6 +303,7 @@ else {
$max = '';
$interval = '';
$quiet_module = 0;
$cps_module = 0;
$unit = '';
$prediction_module = '';
$custom_integer_1 = 0;
@ -314,7 +316,7 @@ else {
$tcp_send = '';
$tcp_rcv = '';
$tcp_port = '';
if ($moduletype == "wmiserver")
$snmp_community = '';
else

View File

@ -566,11 +566,24 @@ if ($__code_from == 'modules') {
}
$table_advanced->data[7][0] = __('Quiet');
$table_advanced->data[7][0] .= ui_print_help_tip(
__('The module still stores data but the alerts and events will be stop'), true);
$table_advanced->colspan[7][1] = 7;
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1,
$quiet_module, true, $disabledBecauseInPolicy);
$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy);
$cps_array[-1] = __('Disabled');
if($cps_module > 0){
$cps_array[$cps_module] = __('Enabled');
}
else{
$cps_inc = 0;
if($id_agent_module){
$cps_inc = service_modules_cps($id_agent_module);
}
$cps_array[$cps_inc] = __('Enabled');
}
$table_advanced->data[7][2] = __('Cascade Protection Services');
$table_advanced->data[7][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
$table_advanced->colspan[7][3] = 5;
$table_advanced->data[7][3] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, "", $disabledBecauseInPolicy);
$table_advanced->data[8][0] = __('Critical instructions') .
ui_print_help_tip(__("Instructions when the status is critical"), true);

View File

@ -179,7 +179,7 @@ foreach ($fields_available as $key=>$available) {
}
$table->data[0][0] = '<b>' . __('Fields available').'</b>';
$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 300px');
$table->data[1][1] = '<a href="javascript:">' .
html_print_image('images/darrowright.png', true,
array('id' => 'right', 'title' => __('Add fields to select'))) .
@ -192,7 +192,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">' .
$table->data[0][1] = '';
$table->data[0][2] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][2] = html_print_select($result_selected,
'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 300px');
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields&amp;pure='.$config['pure'].'">';
html_print_table($table);

View File

@ -82,7 +82,7 @@ if ($update_agents) {
$values['delete_conf'] = get_parameter('delete_conf');
if (get_parameter('quiet_select', -1) != -1)
$values['quiet'] = get_parameter('quiet_select');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) $fields = array();

View File

@ -635,21 +635,23 @@ $table->data['edit11'][0] .= ui_print_help_tip(__('The module still store data b
$table->data['edit11'][1] = html_print_select(array(-1 => __('No change'),
1 => __('Yes'), 0 => __('No')),
"quiet_select", -1, "", '', 0, true);
$table->data['edit11'][2] = __('Timeout');
$table->data['edit11'][3] = html_print_input_text(
'max_timeout', '', '', 5, 10, true) . ' ' .
ui_print_help_tip (
__('Seconds that agent will wait for the execution of the module.'), true);
$table->data['edit16'][0] = __('Retries');
$table->data['edit16'][1] = html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' .
ui_print_help_tip (
__('Number of retries that the module will attempt to run.'), true);
$table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);;
$table->data['edit22'][1] = '<textarea id="textarea_plugin_parameter" name="plugin_parameter" cols="65" rows="15"></textarea>';
$table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);;
$table->data['edit22'][1] = '<textarea id="textarea_plugin_parameter" name="plugin_parameter" cols="65" rows="15"></textarea>';
$table->data['edit16'][2] = __('Port');
$table->data['edit16'][3] = html_print_input_text ('tcp_port', '', '', 5, 20, true);
@ -1491,7 +1493,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
$values['custom_string_2'] = io_input_password($snmp3_privacy_pass);
}
}
$throw_unknown_events = get_parameter('throw_unknown_events', '');
if ($throw_unknown_events !== '') {
//Set the event type that can show.
@ -1499,24 +1501,23 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
EVENTS_GOING_UNKNOWN => (int)$throw_unknown_events);
$values['disabled_types_event'] = json_encode($disabled_types_event);
}
if (strlen(get_parameter('history_data')) > 0) {
$values['history_data'] = get_parameter('history_data');
}
if (get_parameter('quiet_select', -1) != -1) {
$values['quiet'] = get_parameter('quiet_select');
}
$filter_modules = false;
if (!is_numeric($module_name) or ($module_name != 0))
$filter_modules['nombre'] = $module_name;
// Whether to update module tag info
$update_tags = get_parameter('id_tag', false);
if (array_search(0, $agents_select) !== false) {
//Apply at All agents.
$modules = db_get_all_rows_filter ('tagente_modulo',

View File

@ -190,7 +190,7 @@ $table->head = array ();
$table->head[0] = __('Name');
$table->head[1] = __('Description');
$table->head[2] = '<span style="margin-right:7%;">'.__('Action') .'</span>'.
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
html_print_checkbox('all_delete', 0, false, true, false);
$table->size = array ();
$table->size[1] = '65%';
$table->size[2] = '15%';
@ -239,12 +239,16 @@ echo '</div></form>';
?>
<script type="text/javascript">
function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) {
$(".check_delete").attr('checked', true);
}
else {
$(".check_delete").attr('checked', false);
}
}
// If you click on the input type checkbox with id checkbox-all_delete
$('#checkbox-all_delete').click(function() {
// If selected (if the checked property equals true)
if ($(this).prop('checked')) {
// Select each input that has the class .check_delete
$('.check_delete').prop('checked', true);
} else {
// deselect every input that has the class .check_delete
$('.check_delete').prop('checked', false);
}
});
</script>

View File

@ -234,7 +234,7 @@ echo "<td style='width:25%;'>";
echo __('Group') . '&nbsp;';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW"))
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "VR"))
$return_all_group = false;
else
$return_all_group = true;

View File

@ -125,7 +125,6 @@ switch ($action) {
$name = '';
$description = null;
$sql = null;
$show_in_two_columns = 0;
$show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0;
@ -167,7 +166,6 @@ switch ($action) {
$name = '';
$description = null;
$sql = null;
$show_in_two_columns = 0;
$show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0;
@ -195,7 +193,6 @@ switch ($action) {
$style = json_decode(io_safe_output($item['style']), true);
$show_in_same_row = $style['show_in_same_row'];
$show_in_two_columns = $style['show_in_two_columns'];
$show_in_landscape = $style['show_in_landscape'];
$hide_notinit_agents = $style['hide_notinit_agents'];
$dyn_height = $style['dyn_height'];
@ -1547,11 +1544,6 @@ You can of course remove the warnings, that's why we include the source and do n
html_print_checkbox('historical_db_check',1,$historical_db);?>
</td>
</tr>
<tr id="row_show_in_two_columns" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Show in two columns');?></td>
<td><?php html_print_checkbox('show_in_two_columns', 1, $show_in_two_columns);?></td>
</tr>
<tr id="row_dyn_height" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Height (dynamic graphs)');?></td>
@ -1582,8 +1574,7 @@ You can of course remove the warnings, that's why we include the source and do n
<td>
<?php
html_print_checkbox('show_in_landscape', 1,
$show_in_landscape, false, false,
'if ($(\'input[name=show_in_landscape]\').is(\':checked\')) $(\'input[name=show_in_two_columns]\').attr(\'checked\', false);');
$show_in_landscape, false, false);
?>
</td>
</tr>
@ -2827,7 +2818,6 @@ function chooseType() {
$("#row_quantity").hide();
$("#row_exception_condition_value").hide();
$("#row_exception_condition").hide();
$("#row_show_in_two_columns").hide();
$("#row_dyn_height").hide();
$("#row_show_in_same_row").hide();
$("#row_historical_db_check").hide();
@ -2883,7 +2873,6 @@ function chooseType() {
$("#row_period").show();
$("#row_servers").show();
$("#row_group").show();
$("#row_show_in_two_columns").show();
$("#row_event_filter").show();
$("#row_event_graphs").show();
@ -2944,7 +2933,6 @@ function chooseType() {
$("#row_period1").show();
$("#row_module").show();
$("#row_interval").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3018,7 +3006,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3027,7 +3014,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
@ -3039,7 +3025,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
@ -3051,7 +3036,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_lapse_calc").show();
$("#row_lapse").show();
$("#row_visual_format").show();
@ -3063,7 +3047,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3072,7 +3055,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3080,14 +3062,12 @@ function chooseType() {
$("#row_description").show();
$("#row_agent").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
case 'text':
$("#row_description").show();
$("#row_text").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3098,7 +3078,6 @@ function chooseType() {
$("#row_header").show();
$("#row_custom").show();
$("#row_custom_example").show();
$("#row_show_in_two_columns").show();
$("#row_dyn_height").show();
$("#row_servers").show();
$("#row_historical_db_check").show();
@ -3129,7 +3108,6 @@ function chooseType() {
$("#row_field_separator").show();
$("#row_line_separator").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3138,7 +3116,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3147,7 +3124,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3156,7 +3132,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3165,7 +3140,6 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3174,14 +3148,12 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
case 'alert_report_group':
$("#row_description").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_group").show();
$("#row_servers").show();
$("#row_historical_db_check").hide();
@ -3191,7 +3163,6 @@ function chooseType() {
$("#row_description").show();
$("#row_agent").show();
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3265,7 +3236,6 @@ function chooseType() {
$("#general_list").show();
$("#row_order_uptodown").show();
$("#row_show_resume").show();
$("#row_show_in_two_columns").show();
$("#row_show_in_same_row").show();
var checked = $("input[name='last_value']").prop("checked");
@ -3284,7 +3254,6 @@ function chooseType() {
$("#general_list").show();
$("#row_order_uptodown").show();
$("#row_show_address_agent").show();
$("#row_show_in_two_columns").show();
$("#row_show_resume").show();
$("#row_working_time").show();
$('#row_hide_notinit_agents').show();
@ -3315,7 +3284,6 @@ function chooseType() {
$("#row_order_uptodown").show();
$("#row_show_resume").show();
$("#row_show_graph").show();
$("#row_show_in_two_columns").show();
$("#row_historical_db_check").hide();
break;
@ -3328,7 +3296,6 @@ function chooseType() {
$("#row_order_uptodown").show();
$("#row_show_resume").show();
$("#row_show_graph").show();
$("#row_show_in_two_columns").show();
var checked = $("input[name='last_value']").prop("checked");
@ -3356,7 +3323,6 @@ function chooseType() {
$("#row_group").show();
$("#row_agent_multi").show();
$("#row_module_multi").show();
$("#row_show_in_two_columns").show();
$("#row_servers").show();
$("#id_agents").change(event_change_id_agent_inventory);
$("#id_agents").trigger('change');
@ -3374,7 +3340,6 @@ function chooseType() {
$("#row_agent_multi").show();
$("#row_module_multi").show();
$("#row_date").show();
$("#row_show_in_two_columns").show();
$("#id_agents")

View File

@ -1201,7 +1201,6 @@ switch ($action) {
$values['line_separator'] = get_parameter('line');
$style = array();
$style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0);
$style['show_in_same_row'] = get_parameter('show_in_same_row', 0);
$style['show_in_landscape'] = get_parameter('show_in_landscape', 0);
$style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0);
@ -1541,7 +1540,6 @@ switch ($action) {
$values['line_separator'] = get_parameter('line');
$style = array();
$style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0);
$style['show_in_same_row'] = get_parameter('show_in_same_row', 0);
$style['show_in_landscape'] = get_parameter('show_in_landscape', 0);
$style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0);

View File

@ -126,16 +126,11 @@ else {
}
$table->data[1][0] = __('Group:');
$groups = users_get_groups ($config['id_user'], 'RW');
$own_info = get_user_info($config['id_user']);
// Only display group "All" if user is administrator
// or has "RW" privileges
if ($own_info['is_admin'] || $vconsole_write || $vconsole_manage)
$display_all_group = true;
else
$display_all_group = false;
$display_all_group = (users_is_admin() || users_can_manage_group_all("RW"));
$table->data[1][1] = html_print_select_groups($config['id_user'], "RW",
$display_all_group, 'id_group', $idGroup, '', '', '', true);
$backgrounds_list = list_files(

View File

@ -0,0 +1,10 @@
<?php
$token_name = get_parameter('token_name',0);
$value_token = db_get_value('value',
'tconfig', 'token', $token_name);
echo (bool)$value_token;
?>

View File

@ -148,7 +148,7 @@ if ($perform_event_response) {
break;
}
echo system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $timeout_bin . " 90 " . io_safe_output($command) . " 2>&1\"", $ret_val);
system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $timeout_bin . " 90 " . io_safe_output($command) . " 2>&1\"", $ret_val);
}
}
else {
@ -163,7 +163,7 @@ if ($perform_event_response) {
$timeout_bin = '/usr/bin/timeout';
break;
}
echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
}
}
else {
@ -178,7 +178,7 @@ if ($perform_event_response) {
$timeout_bin = '/usr/bin/timeout';
break;
}
echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
}
return;

View File

@ -913,7 +913,7 @@ if ($list_modules) {
}
if ($module['quiet']) {
$data[3] .= html_print_image("images/dot_green.disabled.png", true,
$data[3] .= html_print_image("images/dot_blue.png", true,
array("border" => '0', "title" => __('Quiet'), "alt" => ""))
. "&nbsp;";
}

View File

@ -349,7 +349,7 @@ function process_user_login_remote ($login, $pass, $api = false) {
foreach ($attributes as $attr) {
$attr = explode('=', $attr, 2);
if(in_array($attr[1],$sr[$attr[0]])) {
if(preg_match('/' . $attr[1] . '/', $sr[$attr[0]][0])){
$permissions[$i]["profile"] = $ldap_adv_perm['profile'];
$permissions[$i]["groups"] = $ldap_adv_perm['group'];
$permissions[$i]["tags"] = implode(",",$ldap_adv_perm['tags']);

View File

@ -546,6 +546,7 @@ class Tree {
$group_filter
$agent_search_filter
$agent_status_filter
GROUP BY ta.id_agente
ORDER BY $order_fields";
}
}
@ -1914,7 +1915,7 @@ class Tree {
// Quiet image
if (isset($agent['quiet']) && $agent['quiet'])
$agent['quietImageHTML'] = html_print_image("/images/dot_green.disabled.png", true, array("title" => __('Quiet')));
$agent['quietImageHTML'] = html_print_image("/images/dot_blue.png", true, array("title" => __('Quiet')));
// Status
$agent['statusRaw'] = agents_get_status($agent['id'], !$this->strictACL);

View File

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

View File

@ -3093,7 +3093,7 @@ function series_type_graph_array($data, $show_elements_graph){
elseif(strpos($key, 'sum') !== false || strpos($key, 'baseline') !== false){
switch ($value['id_module_type']) {
case 21: case 2: case 6:
case 18: case 9: case 31:
case 18: case 9: case 31: case 100:
$data_return['series_type'][$key] = 'boolean';
break;
default:

View File

@ -3384,7 +3384,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) {
return;
}
if ($other['data'][2] < 15 or $other['data'][2] > 17) {
if ($other['data'][2] < 15 or $other['data'][2] > 18) {
returnError('error_create_snmp_module', __('Error in creation SNMP module. Invalid id_module_type for a SNMP module.'));
return;
}
@ -10368,7 +10368,9 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) {
$id_critical_module_template = $other['data'][9];
$id_unknown_module_template = 0;
$id_critical_module_sla = $other['data'][10];
$quiet = $other['data'][11];
$cascade_protection = $other['data'][12];
if(empty($name)){
returnError('error_create_service', __('Error in creation service. No name'));
return;
@ -10411,12 +10413,22 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) {
if(empty($id_critical_module_sla)){
$id_critical_module_sla = 0;
}
$result = services_create_service ($name, $description, $id_group,
$critical, $warning, SECONDS_5MINUTES, $mode, $id_agent, $sla_interval, $sla_limit,
if(empty($quiet)){
$quiet = 0;
}
if(empty($cascade_protection)){
$cascade_protection = 0;
}
$result = services_create_service (
$name, $description, $id_group,
$critical, $warning, SECONDS_5MINUTES,
$mode, $id_agent, $sla_interval, $sla_limit,
$id_warning_module_template, $id_critical_module_template,
$id_unknown_module_template, $id_critical_module_sla);
$id_unknown_module_template, $id_critical_module_sla,
$quiet, $cascade_protection
);
if($result){
returnData('string', array('type' => 'string', 'data' => $result));
} else {
@ -10485,9 +10497,9 @@ function api_set_update_service($thrash1, $thrash2, $other, $thrash3) {
if(empty($warning)){
$warning = $service['warning'];
}
$mode = 0;
$id_agent = $other['data'][5];
if(empty($id_agent)){
$id_agent = $service['id_agent_module'];
@ -10512,25 +10524,40 @@ function api_set_update_service($thrash1, $thrash2, $other, $thrash3) {
if(empty($id_critical_module_template)){
$id_critical_module_template = $service['id_template_alert_critical'];
}
$id_unknown_module_template = 0;
$id_critical_module_sla = $other['data'][10];
if(empty($id_critical_module_sla)){
$id_critical_module_sla = $service['id_template_alert_critical_sla'];
}
$result = services_update_service ($id_service, $name,$description, $id_group, $critical, $warning,
SECONDS_5MINUTES, $mode, $id_agent,$sla_interval, $sla_limit,$id_warning_module_template,
$id_critical_module_template,$id_unknown_module_template,$id_critical_module_sla);
$quiet = $other['data'][11];
if(empty($quiet)){
$quiet = $service['quiet'];
}
$cascade_protection = $other['data'][12];
if(empty($cascade_protection)){
$cascade_protection = $service['cascade_protection'];
}
$result = services_update_service (
$id_service, $name,$description, $id_group,
$critical, $warning, SECONDS_5MINUTES, $mode,
$id_agent, $sla_interval, $sla_limit,
$id_warning_module_template,
$id_critical_module_template,
$id_unknown_module_template,
$id_critical_module_sla,
$quiet, $cascade_protection
);
if($result){
returnData('string', array('type' => 'string', 'data' => $result));
} else {
returnError('error_update_service', __('Error in update service'));
}
}
/**

View File

@ -446,37 +446,27 @@ function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $
* Get the agents in layer but not by group in layer.
*
* @param integer $idLayer Layer ID.
* @param array $fields Fields of row tagente to return.
*
* @return array The array rows of tagente of agents in the layer.
*/
function gis_get_agents_layer($idLayer, $fields = null) {
if ($fields === null) {
$select = '*';
}
else {
$select = implode(',',$fields);
}
$sql = "SELECT $select
function gis_get_agents_layer($idLayer) {
$sql = "SELECT id_agente, nombre
FROM tagente
WHERE id_agente IN (
SELECT tagente_id_agente
FROM tgis_map_layer_has_tagente
WHERE tgis_map_layer_id_tmap_layer = $idLayer)";
$agents = db_get_all_rows_sql($sql);
$returned_agents = array();
if ($agents !== false) {
foreach ($agents as $index => $agent) {
$agents[$index] = $agent['nombre'];
$returned_agents[$agent['id_agente']] = $agent['nombre'];
}
}
else {
return array();
}
return $agents;
return $returned_agents;
}
function gis_add_point_path($layerName, $lat, $lon, $color, $manual = 1, $id) {

View File

@ -257,8 +257,16 @@ function grafico_modulo_sparse_data_chart (
);
}
else{
//all points(data)
if($params['zoom'] == 5){
//all points(data) and boolean
if( $params['zoom'] == 5 ||
$data_module_graph['id_module_type'] == 2 ||
$data_module_graph['id_module_type'] == 6 ||
$data_module_graph['id_module_type'] == 21 ||
$data_module_graph['id_module_type'] == 18 ||
$data_module_graph['id_module_type'] == 9 ||
$data_module_graph['id_module_type'] == 31 ||
$data_module_graph['id_module_type'] == 100 ){
$data = db_get_all_rows_filter (
'tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,

View File

@ -323,14 +323,7 @@ function menu_print_menu (&$menu) {
//Print second level submenu
if (isset($sub['sub2'])) {
//Display if father is selected
$display = "style='display:none;'";
if ($selected) {
$display = "";
}
$submenu2_list = '';
$count_sub2 = 0;
@ -374,12 +367,9 @@ function menu_print_menu (&$menu) {
// Added a top on inline styles
$top = menu_calculate_top($config['count_main_menu'], $count_sub, $count_sub2);
if ($top !== 0) {
$display = rtrim($display, "'");
$display .= "top: " . $top . "px;'";
}
//Add submenu2 to submenu string
$submenu_output .= "<ul id='sub" . str_replace(' ','_',$sub["id"]) . "' class=submenu2>";
$submenu_output .= "<ul style= top:" . $top . "px; id='sub" . str_replace(' ','_',$sub["id"]) . "' class=submenu2>";
$submenu_output .= $submenu2_list;
$submenu_output .= "</ul>";
}

View File

@ -2741,4 +2741,22 @@ function get_module_realtime_link_graph ($module) {
return $link_button;
}
/**
* @brief Force a module to adopt a determinated status.
* WARNING: Only use this function to modules that changes their status
* with some user action through the console
* @param int New status
* @param int Agent module to force new status
*/
function force_set_module_status ($status, $id_agent_module) {
return db_process_sql_update( 'tagente_estado',
array(
'estado' => $status,
'known_status' => $status,
'last_known_status' => $status
),
array('id_agente_modulo' => $id_agent_module)
);
}
?>

View File

@ -3879,8 +3879,23 @@ function reporting_value($report, $content, $type,$pdf) {
if($pdf){
$only_image = 1;
}
$params =array(
'agent_module_id' => $content['id_agent_module'],
'period' => $content['period'],
'width' => '600px',
'pure' => false,///true
'date' => $report["datetime"],
'only_image' => $only_image,
'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => 1,///2
'type_graph' => $config['type_module_charts'],
'time_interval' => $content['lapse'],
'server_id' => $id_meta
);
switch ($type) {
case 'max':
if($content['lapse_calc'] == 0){
$value = reporting_get_agentmodule_data_max(
@ -3893,20 +3908,6 @@ function reporting_value($report, $content, $type,$pdf) {
}
}
else{
$params =array(
'agent_module_id' => $content['id_agent_module'],
'period' => $content['period'],
'width' => '600px',
'pure' => false,///true
'date' => $report["datetime"],
'only_image' => $only_image,
'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => 1,///2
'type_graph' => $config['type_module_charts'],
'time_interval' => $content['lapse'],
'server_id' => $id_meta
);
$value = '
<table border="0" style="margin:0 auto;text-align:center;">
<tr>
@ -4159,7 +4160,6 @@ function reporting_value($report, $content, $type,$pdf) {
<td rowspan="2" width="150px">
</td>
<td rowspan="2">';
if($content['visual_format'] == 2 || $content['visual_format'] == 3){
$params['force_interval'] = 'avg_only';
$value .= grafico_modulo_sparse($params);

View File

@ -59,46 +59,152 @@ $(document).ready (function () {
});
$("a.show_systemalert_dialog").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.post ("ajax.php",
{"page": "operation/system_alert"},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.show ();
},
"html"
);
return false;
{"page": "include/ajax/config.ajax",
"token_name": 'visual_animation'
},
function (data, status) {
if(data){
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.001;z-index:1'></div>" );
jQuery.post ("ajax.php",
{"page": "operation/system_alert"},
function (data, status) {
$("#alert_messages").css('width','auto');
$("#alert_messages").css('height','auto');
$("#alert_messages").css('visibility','hidden');
$("#alert_messages").empty ().append (data);
$("#alert_messages").css('display','block');
setTimeout( function() {
animation_modal('alert_messages');
}, 50);
},
"html"
);
return false;
}
else{
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.post ("ajax.php",
{"page": "operation/system_alert"},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.show ();
},
"html"
);
return false;
}
},
"html"
);
});
$("a.modalpopup").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": $(this).attr("id")
},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.show ();
},
"html"
);
return false;
});
var elem = $(this).attr("id");
jQuery.post ("ajax.php",
{"page": "include/ajax/config.ajax",
"token_name": 'visual_animation'
},
function (data, status) {
if(data){
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.001;z-index:1'></div>" );
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": elem
},
function (data, status) {
$("#alert_messages").css('width','auto');
$("#alert_messages").css('height','auto');
$("#alert_messages").css('visibility','hidden');
$("#alert_messages").empty ().append (data);
$("#alert_messages").css('display','block');
setTimeout( function() {
animation_modal('alert_messages');
}, 50);
},
"html"
);
return false;
}
else{
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": elem
},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.show ();
},
"html"
);
return false;
}
},
"html"
);
});
// Creacion de ventana modal y botones
$(".publienterprise").click (function () {
var elem = $(this).attr("id");
jQuery.post ("ajax.php",
{"page": "include/ajax/config.ajax",
"token_name": 'visual_animation'
},
function (data, status) {
if(data){
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.001;z-index:1'></div>" );
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": elem
},
function (data, status) {
$("#alert_messages").css('width','auto');
$("#alert_messages").css('height','auto');
$("#alert_messages").css('visibility','hidden');
$("#alert_messages").empty ().append (data);
$("#alert_messages").css('display','block');
setTimeout( function() {
animation_modal('alert_messages');
}, 50);
},
"html"
);
return false;
}
else{
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": $(this).attr("id")
"message": elem
},
function (data, status) {
$("#alert_messages").hide ()
@ -109,9 +215,13 @@ $(document).ready (function () {
"html"
);
return false;
});
}
},
"html"
);
});
$(".publienterprisehide").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
@ -372,3 +482,23 @@ function forced_title_callback() {
$('#forced_title_layer').hide().empty();
});
}
function animation_modal(id){
var animation_width = $("#"+id).css('width');
var animation_height = $("#"+id).css('height');
var posanimation_left = parseInt($('#'+id).css('left'));
var preanimation_left = parseInt($('#'+id).css('left'))+parseInt($('#'+id).css('left'))/2;
$('#'+id).css({'width':'100px','height':'60px'});
$("#alert_messages").css('visibility','visible');
$('#'+id).css('left',+preanimation_left+'px');
$('#'+id).css('opacity',0);
$('#opacidad').animate({'opacity':0.8},2000);
$("#"+id)
.animate({'width': animation_width,'left':posanimation_left+'px','opacity':1},1000)
.animate({'height': animation_height},1000);
}

View File

@ -3596,7 +3596,6 @@ div.simple_value > a > span.text p
position:fixed;
width:750px;
max-width:750px;
min-width:750px;
top: 20%;
background:white;
}

View File

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

View File

@ -152,7 +152,7 @@ class Agent {
}
else if ($this->agent['quiet']) {
$agent_alias = "<em>" . $agent_alias . "&nbsp;" .
html_print_image("images/dot_green.disabled.png",
html_print_image("images/dot_blue.png",
true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}

View File

@ -631,7 +631,7 @@ foreach ($agents as $agent) {
if ($agent['quiet']) {
$data[0] .= "&nbsp;";
$data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
$data[0] .= html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
}
if ($in_planned_downtime) {

View File

@ -91,10 +91,10 @@ if ($agent['disabled']) {
}
else if ($agent['quiet']) {
if ($in_planned_downtime) {
$agent_name = "<em'>" . $agent_name . "&nbsp;" . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
$agent_name = "<em'>" . $agent_name . "&nbsp;" . html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
}
else {
$agent_name = "<em'>" . $agent_name . "&nbsp;" . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
$agent_name = "<em'>" . $agent_name . "&nbsp;" . html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}
}
else {

View File

@ -388,7 +388,7 @@ echo "</div>";
});
}
var requestSparseGraph = function (moduleId, period, showEvents, width, height, title, showAlerts, avgOnly, date, unit, type_g) {
var requestSparseGraph = function (moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g) {
return requestGraph('sparse', {
page: 'include/ajax/graph.ajax',
print_sparse_graph: 1,
@ -488,7 +488,7 @@ echo "</div>";
$container.html($errorMessage.html());
}
requestSparseGraph(moduleId, period, showEvents, width, height, title, showAlerts, avgOnly, date, unit, type_g)
requestSparseGraph(moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g)
.done(handleSuccess)
.fail(handleError);
}

View File

@ -222,8 +222,14 @@ else {
$table->data[0][1] = html_print_input_text ('name', $name, '', 30,
100,true);
$table->data[1][0] = __('Group');
$table->data[1][1] = html_print_select_groups(false, "AR", true,
'id_group', $id_group, '', '', 0, true);
// Only display group "All" if user is administrator
// or has "AR" privileges
$display_all_group = (users_is_admin() || users_can_manage_group_all("AR"));
$table->data[1][1] = html_print_select_groups($config['id_user'], "AR",
$display_all_group, 'id_group', $idGroup, '', '', '', true);
$table->data[2][0] = __('Node radius');
$table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2,

View File

@ -286,18 +286,20 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Zoom');
$options = array ();
$options[$zoom] = 'x' . $zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = __('full');
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
if(!modules_is_boolean($id)){
$data = array();
$data[0] = __('Zoom');
$options = array ();
$options[$zoom] = 'x' . $zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = __('full');
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
}
$data = array();
$data[0] = __('Time range');
@ -456,6 +458,6 @@ ui_include_time_picker(true);
});
$(window).resize(function() {
$("#field_list").css('height', ($(window).height() - 160) + 'px');
$("#field_list").css('height', ($(document).height() - 160) + 'px');
});
</script>

View File

@ -763,14 +763,16 @@ else {
echo '<div style="width:' . $table->width . ';" class="action-buttons">';
//~ if (!$readonly && tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
if (!$readonly && $show_validate_button) {
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"');
html_print_button(__('In progress selected'), 'validate_button', false, 'validate_selected(2);', 'class="sub ok"');
echo " ";
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected(1);', 'class="sub ok"');
// Fix: validated_selected JS function has to be included with the proper user ACLs
?>
<script type="text/javascript">
function validate_selected() {
function validate_selected(new_status) {
$(".chk_val").each(function() {
if($(this).is(":checked")) {
validate_event_advanced($(this).val(),1);
validate_event_advanced($(this).val(), new_status);
}
});
}

View File

@ -146,13 +146,10 @@ if ($layers != false) {
$agentNamesByGroup = agents_get_group_agents($layer['tgrupo_id_grupo'],
false, 'none', true, true, false);
}
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer'],
array('nombre'));
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer);
foreach ($agentNames as $agentName) {
$idAgent = agents_get_agent_id($agentName);
$coords = gis_get_data_last_position_agent($idAgent);
@ -167,8 +164,7 @@ if ($layers != false) {
gis_add_path($layer['layer_name'], $idAgent, $lastPosition);
}
}
$icon = gis_get_agent_icon_map($idAgent, true);
$icon_size = getimagesize($icon);
$icon_width = $icon_size[0];

View File

@ -182,13 +182,10 @@ if ($layers != false) {
$agentNamesByGroup = agents_get_group_agents($layer['tgrupo_id_grupo'],
false, 'none', true, true, false);
}
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer'],
array('nombre'));
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer);
foreach ($agentNames as $key => $agentName) {
$idAgent = $key;
$coords = gis_get_data_last_position_agent($idAgent);

View File

@ -97,7 +97,7 @@ else {
if ($agent['quiet']) {
$cellName .= "&nbsp;";
$cellName .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
$cellName .= html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
}
$in_planned_downtime = db_get_sql('SELECT executed FROM tplanned_downtime

View File

@ -50,7 +50,7 @@ if (is_ajax()) {
else {
snmp_browser_print_tree ($snmp_tree);
echo html_print_submit_button(__('Create network components'),'create_network_component',
false, array('style' => 'display: none', 'class' => 'sub add'), true);
false, array('style' => 'display: none; position: fixed; bottom: 55px; right: 80px;', 'class' => 'sub add'), true);
echo '<div id="dialog_error" style="display: none" title="Network components">';
echo "<div>";

View File

@ -18,6 +18,7 @@
// Load global vars
global $config;
enterprise_include ("operation/snmpconsole/snmp_view.php");
enterprise_include ("include/functions_snmp.php");
require_once("include/functions_agents.php");
require_once("include/functions_snmp.php");
@ -97,18 +98,19 @@ else {
if (isset ($_GET["delete"])) {
$id_trap = (int) get_parameter_get ("delete", 0);
if ($id_trap > 0 && check_acl ($config['id_user'], 0, "IM")) {
if($group_by){
$sql_ids_traps = "SELECT id_trap FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = ".$id_trap.")
$sql_ids_traps = "SELECT id_trap, source FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = ".$id_trap.")
AND source IN (SELECT source FROM ttrap WHERE id_trap = ".$id_trap.")";
$ids_traps = db_get_all_rows_sql($sql_ids_traps);
foreach ($ids_traps as $key => $value) {
$result = db_process_sql_delete('ttrap', array('id_trap' => $value['id_trap']));
enterprise_hook('snmp_update_forwarded_modules', array($value));
}
} else {
$forward_info = db_get_row('ttrap', 'id_trap', $id_trap);
$result = db_process_sql_delete('ttrap', array('id_trap' => $id_trap));
enterprise_hook('snmp_update_forwarded_modules', array($forward_info));
ui_print_result_message ($result,
__('Successfully deleted'),
__('Could not be deleted'));
@ -129,7 +131,8 @@ if (isset ($_GET["check"])) {
'status' => 1,
'id_usuario' => $config["id_user"]);
$result = db_process_sql_update('ttrap', $values, array('id_trap' => $id_trap));
enterprise_hook('snmp_update_forwarded_modules', array($id_trap));
ui_print_result_message ($result,
__('Successfully updated'),
__('Could not be updated'));
@ -146,17 +149,20 @@ if (isset ($_POST["deletebt"])) {
if (is_array ($trap_ids) && check_acl ($config['id_user'], 0, "IW")) {
if($group_by){
foreach ($trap_ids as $key => $value) {
$sql_ids_traps = "SELECT id_trap FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = ".$value.")
$sql_ids_traps = "SELECT id_trap, source FROM ttrap WHERE oid IN (SELECT oid FROM ttrap WHERE id_trap = ".$value.")
AND source IN (SELECT source FROM ttrap WHERE id_trap = ".$value.")";
$ids_traps = db_get_all_rows_sql($sql_ids_traps);
foreach ($ids_traps as $key2 => $value2) {
$result = db_process_sql_delete('ttrap', array('id_trap' => $value2['id_trap']));
enterprise_hook('snmp_update_forwarded_modules', array($value2));
}
}
} else {
foreach ($trap_ids as $id_trap) {
$forward_info = db_get_row('ttrap', 'id_trap', $id_trap);
db_process_sql_delete('ttrap', array('id_trap' => $id_trap));
enterprise_hook('snmp_update_forwarded_modules', array($forward_info));
}
}
}
@ -173,6 +179,7 @@ if (isset ($_POST["updatebt"])) {
foreach ($trap_ids as $id_trap) {
$sql = sprintf ("UPDATE ttrap SET status = 1, id_usuario = '%s' WHERE id_trap = %d", $config["id_user"], $id_trap);
db_process_sql ($sql);
enterprise_hook('snmp_update_forwarded_modules', array($id_trap));
}
}
else {

View File

@ -196,7 +196,7 @@ $ignored_params['refr'] = '';
$('body').css('margin','0');
$('body').css('height','100%');
$('body').css('overflow','hidden');
$('p').css('margin-top','25px');
$(".module_graph .menu_graph").css('display','none');
$(".parent_graph").each(function(){

View File

@ -311,6 +311,7 @@ $ignored_params['refr'] = '';
});
$('.item > div').each( function() {
$(this).css('margin-bottom','20px');
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
if($(this).attr('id').indexOf('clock') || $(this).attr('id').indexOf('overlay')){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');

View File

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

View File

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

View File

@ -87,6 +87,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`transactional_agent` tinyint(1) NOT NULL default '0',
`alias_as_name` tinyint(2) NOT NULL default '0',
`safe_mode_module` int(10) unsigned NOT NULL default '0',
`cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
@ -259,6 +260,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`prediction_samples` int(4) default 0,
`prediction_threshold` int(4) default 0,
`parent_module_id` int(10) unsigned NOT NULL,
`cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente_modulo`),
KEY `main_idx` (`id_agente_modulo`,`id_agente`),
KEY `tam_agente` (`id_agente`),
@ -2424,6 +2426,9 @@ CREATE TABLE IF NOT EXISTS `tservice` (
`id_template_alert_critical` int(10) unsigned NOT NULL default 0,
`id_template_alert_unknown` int(10) unsigned NOT NULL default 0,
`id_template_alert_critical_sla` int(10) unsigned NOT NULL default 0,
`quiet` tinyint(1) NOT NULL default 0,
`cps` int NOT NULL default 0,
`cascade_protection` tinyint(1) NOT NULL default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
COMMENT = 'Table to define services to monitor'
@ -3005,6 +3010,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`alias` varchar(600) BINARY NOT NULL default '',
`alias_as_name` tinyint(2) NOT NULL default '0',
`safe_mode_module` int(10) unsigned NOT NULL default '0',
`cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),

View File

@ -109,7 +109,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 17),
('MR', 18),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '724'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.724-180625
Version: 7.0NG.724-180628
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

@ -330,7 +330,7 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
if ($EventStormProtection == 1) {
return;
}
# Warmup interval for alerts.
if ($pa_config->{'warmup_alert_on'} == 1) {
@ -344,20 +344,29 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
if ($agent->{'quiet'} == 1) {
logger($pa_config, "Generate Alert. The agent '" . $agent->{'nombre'} . "' is in quiet mode.", 10);
return;
}
if ($module->{'quiet'} == 1) {
logger($pa_config, "Generate Alert. The module '" . $module->{'nombre'} . "' is in quiet mode.", 10);
return;
}
if ($agent->{'cps'} > 0) {
logger($pa_config, "Generate Alert. The agent '" . $agent->{'nombre'} . "' is in quiet mode by cascade protection services.", 10);
return;
}
if ($module->{'cps'} > 0) {
logger($pa_config, "Generate Alert. The module '" . $module->{'nombre'} . "' is in quiet mode by cascade protection services.", 10);
return;
}
# Do not generate alerts for disabled groups
if (is_group_disabled ($dbh, $agent->{'id_grupo'})) {
return;
}
# Get enabled alerts associated with this module
my $alert_type_filter = defined ($alert_type) ? " AND type = '$alert_type'" : '';
my @alerts = get_db_rows ($dbh, '
@ -367,11 +376,11 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
WHERE talert_template_modules.id_alert_template = talert_templates.id
AND id_agent_module = ?
AND disabled = 0' . $alert_type_filter, $module->{'id_agente_modulo'});
foreach my $alert (@alerts) {
my $rc = pandora_evaluate_alert($pa_config, $agent, $data,
$status, $alert, $utimestamp, $dbh, $last_data_value);
pandora_process_alert ($pa_config, $data, $agent, $module,
$alert, $rc, $dbh, $timestamp, $extra_macros);
}
@ -3131,8 +3140,13 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) {
logger($pa_config, "Generate Event. The agent '" . $agent->{'nombre'} . "' is in quiet mode.", 10);
return;
}
if (defined ($agent) && $agent->{'cps'} > 0) {
logger($pa_config, "Generate Event. The agent '" . $agent->{'nombre'} . "' is in quiet mode by cascade protection services.", 10);
return;
}
}
my $module = undef;
if (defined($id_agentmodule) && $id_agentmodule != 0) {
$module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $id_agentmodule);
@ -3140,8 +3154,13 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) {
logger($pa_config, "Generate Event. The module '" . $module->{'nombre'} . "' is in quiet mode.", 10);
return;
}
if (defined ($module) && $module->{'cps'} > 0) {
logger($pa_config, "Generate Event. The module '" . $module->{'nombre'} . "' is in quiet mode by cascade protection services.", 10);
return;
}
}
# Get module tags
my $module_tags = '';
if (defined ($tags) && ($tags ne '')) {
@ -3152,8 +3171,8 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) {
$module_tags = pandora_get_module_tags ($pa_config, $dbh, $id_agentmodule);
}
}
# Set default values for optional parameters
$source = 'monitoring_server' unless defined ($source);
$comment = '' unless defined ($comment);

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.724";
my $pandora_build = "180625";
my $pandora_build = "180628";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -46,6 +46,7 @@ our @EXPORT = qw(
api_create_tag
api_create_group
call_url
check_lib_version
decrypt
empty
encrypt
@ -95,12 +96,34 @@ our @EXPORT = qw(
my $DevNull = ($^O =~ /win/i)?'/NUL':'/dev/null';
################################################################################
#
# Returns current library version
################################################################################
sub get_lib_version {
return $VERSION;
}
################################################################################
# Check version compatibility
################################################################################
sub check_lib_version {
my ($plugin_version) = @_;
$plugin_version = "0NG.0" if empty($plugin_version);
my ($main,$oum) = split /NG./, $plugin_version;
$main = 0 if empty($main) || !looks_like_number($main);
$oum = 0 if empty($oum) || !looks_like_number($oum);
my ($libmain,$liboum) = split /NG./, $pandora_version;
if (($liboum < $oum)
|| ($libmain != $main)) {
return 0;
}
return 1;
}
################################################################################
# Get current time (milis)
@ -679,7 +702,8 @@ sub transfer_xml {
# Reassign default values if not present
$conf->{tentacle_client} = "tentacle_client" if empty($conf->{tentacle_client});
$conf->{tentacle_port} = "44121" if empty($conf->{tentacle_port});
$conf->{tentacle_port} = "41121" if empty($conf->{tentacle_port});
$conf->{tentacle_opts} = "" if empty($conf->{tentacle_opts});
$conf->{mode} = $conf->{transfer_mode} if empty($conf->{mode});
if (empty ($conf->{mode}) ) {
@ -689,26 +713,30 @@ sub transfer_xml {
#Transfering XML file
if ($conf->{mode} eq "tentacle") {
my $msg = "";
my $r = -1;
#Send using tentacle
if ($^O =~ /win/i) {
`$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path"`;
$msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path"`;
$r = $?;
}
else {
`$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path" 2>&1 > /dev/null`;
$msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path" 2>&1`;
$r = $?;
}
#If no errors were detected delete file
if (! $?) {
if ($r == 0) {
unlink ($file_path);
} else {
print_stderror($conf, "[ERROR] There was a problem sending file [$file_path] using tentacle");
return undef;
}
}
}
else {
print_stderror($conf, trim($msg) . " File [$file_path]");
return undef;
}
}
else {
#Copy file to local folder
my $dest_dir = $conf->{local_folder};
@ -1409,7 +1437,7 @@ sub process_performance {
$instances = trim (head(`$_PluginTools_system->{ps} | $_PluginTools_system->{grep} "$process"| $_PluginTools_system->{wcl}`, 1));
}
}
elsif ($^O =~ /linux/i ){
$cpu = trim(`$_PluginTools_system->{ps} | $_PluginTools_system->{grep} -w "$process" | $_PluginTools_system->{grep} -v grep | awk 'BEGIN {sum=0} {sum+=\$2} END{print sum}'`);
$mem = trim(`$_PluginTools_system->{ps} | $_PluginTools_system->{grep} -w "$process" | $_PluginTools_system->{grep} -v grep | awk 'BEGIN {sum=0} {sum+=\$1} END{print sum}'`);
@ -1834,13 +1862,13 @@ sub api_create_group {
# $snmp{host}
# $snmp{oid}
# $snmp{port}
# $snmp{securityName}
# $snmp{context
# $snmp{securityLevel}
# $snmp{authProtocol}
# $snmp{authKey}
# $snmp{privProtocol}
# $snmp{privKey}
# $snmp{securityName}
# $snmp{context
# $snmp{securityLevel}
# $snmp{authProtocol}
# $snmp{authKey}
# $snmp{privProtocol}
# $snmp{privKey}
################################################################################
sub snmp_walk {
my $snmp = shift;
@ -1940,13 +1968,13 @@ sub snmp_walk {
# $snmp{host}
# $snmp{oid}
# $snmp{port}
# $snmp{securityName}
# $snmp{context
# $snmp{securityLevel}
# $snmp{authProtocol}
# $snmp{authKey}
# $snmp{privProtocol}
# $snmp{privKey}
# $snmp{securityName}
# $snmp{context
# $snmp{securityLevel}
# $snmp{authProtocol}
# $snmp{authKey}
# $snmp{privProtocol}
# $snmp{privKey}
################################################################################
sub snmp_get {
my $snmp = shift;

View File

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

View File

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

View File

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

View File

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

View File

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