Merge branch 'develop' into 1827-Graficas_TIP_eje_x_no_mantiene_ratio
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.718-180131
|
||||
Version: 7.0NG.718-180210
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.718-180131"
|
||||
pandora_version="7.0NG.718-180210"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -41,7 +41,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.718';
|
||||
use constant AGENT_BUILD => '180131';
|
||||
use constant AGENT_BUILD => '180210';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.718"
|
||||
PI_BUILD="180131"
|
||||
PI_BUILD="180210"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{180131}
|
||||
{180210}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.718(Build 180131)")
|
||||
#define PANDORA_VERSION ("7.0NG.718(Build 180210)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.718(Build 180131))"
|
||||
VALUE "ProductVersion", "(7.0NG.718(Build 180210))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.718-180131
|
||||
Version: 7.0NG.718-180210
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.718-180131"
|
||||
pandora_version="7.0NG.718-180210"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
44
pandora_console/extras/mr/12.sql
Normal file
@ -0,0 +1,44 @@
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE tcontainer_item ADD COLUMN type_graph tinyint(1) unsigned default '0';
|
||||
|
||||
ALTER TABLE tlayout_data ADD COLUMN `clock_animation` varchar(60) NOT NULL default "analogic_1";
|
||||
ALTER TABLE tlayout_data ADD COLUMN `time_format` varchar(60) NOT NULL default "time";
|
||||
ALTER TABLE tlayout_data ADD COLUMN `timezone` varchar(60) NOT NULL default "Europe/Madrid";
|
||||
|
||||
create table IF NOT EXISTS tcluster(
|
||||
id int unsigned not null auto_increment,
|
||||
name tinytext not null default '',
|
||||
cluster_type enum('AA','AP') not null default 'AA',
|
||||
description text not null default '',
|
||||
group int(10) unsigned NOT NULL default '0',
|
||||
id_agent int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
FOREIGN KEY (id_agent) REFERENCES tagente(id_agente)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
create table IF NOT EXISTS tcluster_item(
|
||||
id int unsigned not null auto_increment,
|
||||
name tinytext not null default '',
|
||||
item_type enum('AA','AP') not null default 'AA',
|
||||
critical_limit int unsigned NOT NULL default '0',
|
||||
warning_limit int unsigned NOT NULL default '0',
|
||||
is_critical tinyint(2) unsigned NOT NULL default '0',
|
||||
id_cluster int unsigned,
|
||||
PRIMARY KEY (id),
|
||||
FOREIGN KEY (id_cluster) REFERENCES tcluster(id)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
create table IF NOT EXISTS tcluster_agent(
|
||||
id_cluster int unsigned not null,
|
||||
id_agent int(10) unsigned not null,
|
||||
PRIMARY KEY (id_cluster,id_agent),
|
||||
FOREIGN KEY (id_agent) REFERENCES tagente(id_agente)
|
||||
ON UPDATE CASCADE,
|
||||
FOREIGN KEY (id_cluster) REFERENCES tcluster(id)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
@ -1159,10 +1159,10 @@ 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', 11);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 12);
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '718');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '719');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tplanned_downtime_agents`
|
||||
@ -1248,6 +1248,9 @@ ALTER TABLE tlayout_data ADD COLUMN `show_statistics` tinyint(2) NOT NULL defaul
|
||||
ALTER TABLE tlayout_data ADD COLUMN `element_group` int(10) NOT NULL default '0';
|
||||
ALTER TABLE tlayout_data ADD COLUMN `id_layout_linked_weight` int(10) NOT NULL default '0';
|
||||
ALTER TABLE tlayout_data ADD COLUMN `show_on_top` tinyint(1) NOT NULL default '0';
|
||||
ALTER TABLE tlayout_data ADD COLUMN `clock_animation` varchar(60) NOT NULL default "analogic_1";
|
||||
ALTER TABLE tlayout_data ADD COLUMN `time_format` varchar(60) NOT NULL default "time";
|
||||
ALTER TABLE tlayout_data ADD COLUMN `timezone` varchar(60) NOT NULL default "Europe/Madrid";
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagent_custom_fields`
|
||||
@ -1411,6 +1414,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
|
||||
`agent` varchar(100) NOT NULL default '',
|
||||
`module` varchar(100) NOT NULL default '',
|
||||
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
||||
`type_graph` tinyint(1) unsigned NOT NULL DEFAULT 0,
|
||||
`fullscale` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||
PRIMARY KEY(`id_ci`),
|
||||
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
||||
@ -1482,3 +1486,50 @@ ALTER TABLE `tdashboard` ADD COLUMN `cells_slideshow` TINYINT(1) NOT NULL defaul
|
||||
-- ---------------------------------------------------------------------
|
||||
SELECT max(unified_filters_id) INTO @max FROM tsnmp_filter;
|
||||
UPDATE tsnmp_filter tsf,(SELECT @max:= @max) m SET tsf.unified_filters_id = @max:= @max + 1 where tsf.unified_filters_id=0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`cluster_type` enum('AA','AP') not null default 'AA',
|
||||
`description` text not null default '',
|
||||
`group` int(10) unsigned NOT NULL default '0',
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_item`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`item_type` enum('AA','AP') not null default 'AA',
|
||||
`critical_limit` int unsigned NOT NULL default '0',
|
||||
`warning_limit` int unsigned NOT NULL default '0',
|
||||
`is_critical` tinyint(2) unsigned NOT NULL default '0',
|
||||
`id_cluster` int unsigned,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_agent`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_agent`(
|
||||
`id_cluster` int unsigned not null,
|
||||
`id_agent` int(10) unsigned not null,
|
||||
PRIMARY KEY (`id_cluster`,`id_agent`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
56
pandora_console/general/firts_task/cluster_builder.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 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; 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;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Inventory");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
ui_require_css_file ('firts_task');
|
||||
?>
|
||||
<?php
|
||||
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no clusters defined yet.') ) );
|
||||
?>
|
||||
|
||||
<div class="new_task_cluster">
|
||||
<div class="image_task_cluster">
|
||||
<?php echo html_print_image('images/firts_task/icono-cluster-activo.png', true, array("title" => __('Clusters')));?>
|
||||
</div>
|
||||
<div class="text_task_cluster">
|
||||
<h3> <?php echo __('Create Cluster'); ?></h3>
|
||||
<p id="description_task"> <?php
|
||||
|
||||
echo __('A cluster is a group of devices that provide the same service in high availability.').'<br><br>';
|
||||
|
||||
echo __('Depending on how they provide that service, we can find two types:').'<br><br>';
|
||||
|
||||
echo __('<b>Clusters to balance the service load</b>: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'<br><br>';
|
||||
|
||||
echo __('<b>Clusters to guarantee service</b>: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.');
|
||||
|
||||
?></p>
|
||||
<form action="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&step=1" method="post">
|
||||
<input style="margin-bottom:20px;" type="submit" class="button_task" value="<?php echo __('Create Cluster'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -102,12 +102,11 @@ echo '<div id="header_login">';
|
||||
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="pandora_console">';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="list_icon_docs_support"><ul>';
|
||||
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
|
||||
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
|
||||
echo '<li>' . __('Docs') . '</li>';
|
||||
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
|
||||
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
|
||||
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
|
||||
} else {
|
||||
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
|
||||
}
|
||||
|
@ -263,23 +263,23 @@ if ($create_agent) {
|
||||
}
|
||||
}
|
||||
|
||||
$info = 'Name: ' . $nombre_agente .
|
||||
' IP: ' . $direccion_agente .
|
||||
' Group: ' . $grupo .
|
||||
' Interval: ' . $intervalo .
|
||||
' Comments: ' . $comentarios .
|
||||
' Mode: ' . $modo .
|
||||
' ID_parent: ' . $id_parent .
|
||||
' Server: ' . $server_name .
|
||||
' ID os: ' . $id_os .
|
||||
' Disabled: ' . $disabled .
|
||||
' Custom ID: ' . $custom_id .
|
||||
' Cascade protection: ' . $cascade_protection .
|
||||
' Cascade protection module: ' . $cascade_protection_module .
|
||||
' Icon path: ' . $icon_path .
|
||||
' Update GIS data: ' . $update_gis_data .
|
||||
' Url description: ' . $url_description .
|
||||
' Quiet: ' . (int)$quiet;
|
||||
$info = '{"Name":"' . $nombre_agente .'",
|
||||
"IP":"' . $direccion_agente .'",
|
||||
"Group":"' . $grupo .'",
|
||||
"Interval":"' . $intervalo .'",
|
||||
"Comments":"' . $comentarios .'",
|
||||
"Mode":"' . $modo .'",
|
||||
"ID_parent:":"' . $id_parent .'",
|
||||
"Server":"' . $server_name .'",
|
||||
"ID os":"' . $id_os .'",
|
||||
"Disabled":"' . $disabled .'",
|
||||
"Custom ID":"' . $custom_id .'",
|
||||
"Cascade protection":"' . $cascade_protection .'",
|
||||
"Cascade protection module":"' . $cascade_protection_module .'",
|
||||
"Icon path":"' . $icon_path .'",
|
||||
"Update GIS data":"' . $update_gis_data .'",
|
||||
"Url description":"' . $url_description .'",
|
||||
"Quiet":"' . (int)$quiet.'"}';
|
||||
|
||||
db_pandora_audit("Agent management",
|
||||
"Created agent $alias", false, true, $info);
|
||||
@ -876,15 +876,24 @@ if ($update_agent) { // if modified some agent paramenter
|
||||
}
|
||||
}
|
||||
|
||||
$info = 'Group: ' . $grupo . ' Interval: ' . $intervalo .
|
||||
' Comments: ' . $comentarios . ' Mode: ' . $modo .
|
||||
' ID OS: ' . $id_os . ' Disabled: ' . $disabled .
|
||||
' Server Name: ' . $server_name . ' ID parent: ' . $id_parent .
|
||||
' Custom ID: ' . $custom_id . ' Cascade Protection: ' . $cascade_protection .
|
||||
' Cascade protection module: ' . $cascade_protection_module .
|
||||
' Icon Path: ' . $icon_path . 'Update GIS data: ' .$update_gis_data .
|
||||
' Url description: ' . $url_description .
|
||||
' Quiet: ' . (int)$quiet;
|
||||
$info = '{
|
||||
"id_agente":"' . $id_agente . '",
|
||||
"alias":"' . $alias . '",
|
||||
"Group":"' . $grupo . '",
|
||||
"Interval" : "' . $intervalo .'",
|
||||
"Comments":"' . $comentarios . '",
|
||||
"Mode":"' . $modo . '",
|
||||
"ID OS":"' . $id_os . '",
|
||||
"Disabled":"' . $disabled .'",
|
||||
"Server Name":"' . $server_name .'",
|
||||
"ID parent":"' . $id_parent .'",
|
||||
"Custom ID":"' . $custom_id . '",
|
||||
"Cascade Protection":"' . $cascade_protection .'",
|
||||
"Cascade protection module":"' . $cascade_protection_module .'",
|
||||
"Icon Path":"' . $icon_path . '",
|
||||
"Update GIS data":"' .$update_gis_data .'",
|
||||
"Url description":"' . $url_description .'",
|
||||
"Quiet":"' . (int)$quiet.'"}';
|
||||
|
||||
enterprise_hook ('update_agent', array ($id_agente));
|
||||
ui_print_success_message (__('Successfully updated'));
|
||||
@ -1249,7 +1258,9 @@ if ($update_module || $create_module) {
|
||||
if ($update_module) {
|
||||
$id_agent_module = (int) get_parameter ('id_agent_module');
|
||||
|
||||
$values = array ('descripcion' => $description,
|
||||
$values = array (
|
||||
'id_agente_modulo' => $id_agent_module,
|
||||
'descripcion' => $description,
|
||||
'id_module_group' => $id_module_group,
|
||||
'nombre' => $name,
|
||||
'max' => $max,
|
||||
@ -1307,7 +1318,7 @@ if ($update_module) {
|
||||
'warning_inverse' => $warning_inverse,
|
||||
'cron_interval' => $cron_interval,
|
||||
'id_category' => $id_category,
|
||||
'disabled_types_event' => $disabled_types_event,
|
||||
'disabled_types_event' => addslashes($disabled_types_event),
|
||||
'module_macros' => $module_macros);
|
||||
|
||||
// In local modules, the interval is updated by agent
|
||||
@ -1467,7 +1478,7 @@ if ($create_module) {
|
||||
'warning_inverse' => $warning_inverse,
|
||||
'cron_interval' => $cron_interval,
|
||||
'id_category' => $id_category,
|
||||
'disabled_types_event' => $disabled_types_event,
|
||||
'disabled_types_event' => addslashes($disabled_types_event),
|
||||
'module_macros' => $module_macros);
|
||||
|
||||
if ($prediction_module == 3 && $serialize_ops == '') {
|
||||
|
@ -343,7 +343,6 @@ if($os != 0){
|
||||
|
||||
// Show only selected groups
|
||||
if ($ag_group > 0) {
|
||||
|
||||
$ag_groups = array();
|
||||
$ag_groups = (array)$ag_group;
|
||||
if ($recursion) {
|
||||
@ -391,53 +390,6 @@ if ($ag_group > 0) {
|
||||
$total_agents = db_get_sql ($sql_total);
|
||||
}
|
||||
else {
|
||||
|
||||
// Admin user get ANY group, even if they doesnt exist
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
|
||||
$sql = sprintf ('SELECT COUNT(*) FROM tagente WHERE 1=1 %s', $search_sql);
|
||||
$total_agents = db_get_sql ($sql);
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$order['field2'] = "";
|
||||
/*
|
||||
$sql = sprintf ('SELECT *
|
||||
FROM tagente
|
||||
WHERE 1=1
|
||||
%s
|
||||
ORDER BY %s %s, %s %s LIMIT %d, %d', $search_sql, $order['field'],$order['order'], $order['field2'],
|
||||
$order['order'], $offset, $config["block_size"]);
|
||||
*/
|
||||
$sql = sprintf ('SELECT *
|
||||
FROM tagente
|
||||
WHERE 1=1
|
||||
%s
|
||||
ORDER BY %s %s %s LIMIT %d, %d', $search_sql, $order['field'], $order['field2'],
|
||||
$order['order'], $offset, $config["block_size"]);
|
||||
break;
|
||||
case "postgresql":
|
||||
$sql = sprintf ('SELECT *
|
||||
FROM tagente
|
||||
WHERE 1=1
|
||||
%s
|
||||
ORDER BY %s %s, %s %s LIMIT %d OFFSET %d', $search_sql, $order['field'],$order['order'], $order['field2'],
|
||||
$order['order'], $config["block_size"], $offset);
|
||||
break;
|
||||
case "oracle":
|
||||
$set = array ();
|
||||
$set['limit'] = $config["block_size"];
|
||||
$set['offset'] = $offset;
|
||||
$sql = sprintf ('SELECT *
|
||||
FROM tagente
|
||||
WHERE 1=1
|
||||
%s
|
||||
ORDER BY %s %s, %s %s', $search_sql, $order['field'],$order['order'], $order['field2'], $order['order']);
|
||||
$sql = oracle_recode_query ($sql, $set);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// Concatenate AW and AD permisions to get all the possible groups where the user can manage
|
||||
$user_groupsAW = users_get_groups ($config['id_user'], 'AW');
|
||||
$user_groupsAD = users_get_groups ($config['id_user'], 'AD');
|
||||
@ -489,8 +441,6 @@ else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$agents = db_get_all_rows_sql ($sql);
|
||||
|
||||
|
@ -42,11 +42,12 @@ if (is_ajax()){
|
||||
$id_agent_module = get_parameter('id_agent_module');
|
||||
$time_lapse = get_parameter('time_lapse');
|
||||
$only_avg = get_parameter('only_avg');
|
||||
$simple_type_graph = get_parameter('simple_type_graph');
|
||||
$fullscale = get_parameter('fullscale');
|
||||
|
||||
if($only_avg != 'false'){
|
||||
$only_avg = 1;
|
||||
}
|
||||
else{
|
||||
} else{
|
||||
$only_avg = 0;
|
||||
}
|
||||
|
||||
@ -64,8 +65,8 @@ if (is_ajax()){
|
||||
'id_agent_module' => $id_agent_module,
|
||||
'time_lapse' => $time_lapse,
|
||||
'only_average' => $only_avg,
|
||||
'fullscale' => $fullscale
|
||||
);
|
||||
'type_graph' => $simple_type_graph,
|
||||
'fullscale' => $fullscale);
|
||||
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
@ -102,14 +103,14 @@ if (is_ajax()){
|
||||
$module_name = get_parameter('module_name','');
|
||||
$tag = get_parameter('tag',0);
|
||||
$only_avg = get_parameter('only_avg');
|
||||
$simple_type_graph2 = get_parameter('simple_type_graph2');
|
||||
$fullscale = get_parameter('fullscale');
|
||||
if($only_avg != 'false') {
|
||||
$only_avg = 1;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$only_avg = 0;
|
||||
}
|
||||
|
||||
$fullscale = get_parameter('fullscale');
|
||||
if($fullscale != 'false'){
|
||||
$fullscale = 1;
|
||||
}
|
||||
@ -127,8 +128,9 @@ if (is_ajax()){
|
||||
'module' => $module_name,
|
||||
'id_tag' => $tag,
|
||||
'only_average' => $only_avg,
|
||||
'fullscale' => $fullscale
|
||||
);
|
||||
'type_graph' => $simple_type_graph2,
|
||||
'fullscale' => $fullscale);
|
||||
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
}
|
||||
@ -299,6 +301,10 @@ if($edit_container){
|
||||
$periods[SECONDS_15DAYS] = __('15 days');
|
||||
$periods[SECONDS_1MONTH] = __('1 month');
|
||||
|
||||
$type_graphs = array();
|
||||
$type_graphs[0] = __('Area');
|
||||
$type_graphs[1] = __('Line');
|
||||
|
||||
$single_table = "<table width='100%' cellpadding=4 cellspacing=4>";
|
||||
$single_table .= "<tr id='row_time_lapse' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;width: 13%;'>";
|
||||
@ -359,6 +365,16 @@ if($edit_container){
|
||||
$single_table .= html_print_checkbox('only_avg', 1, true,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
$single_table .= "<tr id='row_only_avg' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Type of graph');
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "<td>";
|
||||
$single_table .= html_print_select ($type_graphs, 'simple_type_graph', "","","",0,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
$single_table .= "<tr id='row_fullscale' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Show full scale graph (TIP)') . ui_print_help_tip('This option may cause performance issues', true);
|
||||
@ -367,6 +383,7 @@ if($edit_container){
|
||||
$single_table .= html_print_checkbox('fullscale', 1, false,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
$single_table .= "<tr>";
|
||||
$single_table .= "<td >";
|
||||
$single_table .= "</td>";
|
||||
@ -491,6 +508,12 @@ if($edit_container){
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Type of graph');
|
||||
$data[1] = html_print_select ($type_graphs, 'simple_type_graph2', "","","",0,true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Only average');
|
||||
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
|
||||
@ -613,6 +636,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
if(id_agent_module !== '0'){
|
||||
var id_agent = $("#hidden-id_agent").attr('value');
|
||||
var time_lapse = $("#hidden-period_single").attr('value');
|
||||
var simple_type_graph = $("#simple_type_graph option:selected").attr('value');
|
||||
var only_avg = $("#checkbox-only_avg").prop("checked");
|
||||
var fullscale = $("#checkbox-fullscale").prop("checked");
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
@ -622,6 +646,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
"id_agent" : id_agent,
|
||||
"id_agent_module" : id_agent_module,
|
||||
"time_lapse" : time_lapse,
|
||||
"simple_type_graph": simple_type_graph,
|
||||
"only_avg" : only_avg,
|
||||
"fullscale" : fullscale,
|
||||
"id_container" : id_container,
|
||||
@ -664,6 +689,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
var time_lapse = $("#hidden-period_dynamic").attr('value');
|
||||
var group = $("#container_id_group1").val();
|
||||
var module_group = $("#combo_modulegroup").val();
|
||||
var simple_type_graph2 = $("#simple_type_graph2 option:selected").attr('value');
|
||||
var tag = $("#tag").val();
|
||||
var only_avg = $("#checkbox-only_avg_2").prop("checked");
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
@ -676,6 +702,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
"module_group" : module_group,
|
||||
"agent_alias" : agent_alias,
|
||||
"module_name" : module_name,
|
||||
"simple_type_graph2": simple_type_graph2,
|
||||
"tag" : tag,
|
||||
"id_container" : id_container,
|
||||
"only_avg" : only_avg,
|
||||
|
@ -374,8 +374,7 @@ function update_button_palette_callback() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
@ -503,7 +502,7 @@ function update_button_palette_callback() {
|
||||
}
|
||||
|
||||
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
@ -626,6 +625,14 @@ function update_button_palette_callback() {
|
||||
|
||||
setBarsGraph(idItem, values);
|
||||
break;
|
||||
|
||||
case 'clock':
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
setClock(idItem, values);
|
||||
break;
|
||||
|
||||
case 'auto_sla_graph':
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
@ -679,7 +686,7 @@ function update_button_palette_callback() {
|
||||
}
|
||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
@ -856,6 +863,9 @@ function readFields() {
|
||||
values['label_position'] = $(".labelpos[sel=yes]").attr('position');
|
||||
values['show_statistics'] = $("input[name=show_statistics]").is(':checked') ? 1 : 0;
|
||||
values['show_on_top'] = $("input[name=show_on_top]").is(':checked') ? 1 : 0;
|
||||
values['time_format'] = $("select[name=time_format]").val();
|
||||
values['timezone'] = $("select[name=timezone]").val();
|
||||
values['clock_animation'] = $("select[name=clock_animation]").val();
|
||||
|
||||
if (is_metaconsole()) {
|
||||
values['metaconsole'] = 1;
|
||||
@ -1216,6 +1226,7 @@ function toggle_item_palette() {
|
||||
activeToolboxButton('simple_value', true);
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('clock', true);
|
||||
activeToolboxButton('percentile_item', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('box_item', true);
|
||||
@ -1247,6 +1258,7 @@ function toggle_item_palette() {
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('clock', false);
|
||||
activeToolboxButton('percentile_item', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
activeToolboxButton('box_item', false);
|
||||
@ -1558,6 +1570,13 @@ function loadFieldsFromDB(item) {
|
||||
.css('background-color', val);
|
||||
}
|
||||
|
||||
if (key == 'clock_animation')
|
||||
$("select[name=clock_animation]").val(val);
|
||||
if (key == 'time_format')
|
||||
$("select[name=time_format]").val(val);
|
||||
if (key == 'timezone')
|
||||
$("select[name=timezone]").val(val);
|
||||
|
||||
if (key == 'value_show') {
|
||||
$("select[name=value_show]").val(val);
|
||||
}
|
||||
@ -1869,6 +1888,15 @@ function hiddenFields(item) {
|
||||
$("#line_width_row").css('display', 'none');
|
||||
$("#line_width_row." + item).css('display', '');
|
||||
|
||||
$("#timezone_row").css('display', 'none');
|
||||
$("#timezone_row." + item).css('display', '');
|
||||
|
||||
$("#timeformat_row").css('display', 'none');
|
||||
$("#timeformat_row." + item).css('display', '');
|
||||
|
||||
$("#clock_animation_row").css('display', 'none');
|
||||
$("#clock_animation_row." + item).css('display', '');
|
||||
|
||||
$("#line_case").css('display', 'none');
|
||||
$("#line_case." + item).css('display', '');
|
||||
|
||||
@ -1908,7 +1936,7 @@ function cleanFields(item) {
|
||||
$("input[name='grid_color']").val('#000000');
|
||||
$("input[name='resume_color']").val('#000000');
|
||||
$("input[name='border_width']").val(3);
|
||||
$("input[name='fill_color']").val('#ffffff');
|
||||
$("input[name='fill_color']").val('#000000');
|
||||
$("input[name='line_width']").val(3);
|
||||
$("input[name='line_color']").val('#000000');
|
||||
$("select[name=type_percentile]").val('');
|
||||
@ -1917,6 +1945,9 @@ function cleanFields(item) {
|
||||
$("input[name=percentile_label]").val('');
|
||||
$(".ColorPickerDivSample").css('background-color', '#FFF');
|
||||
$("input[name=show_on_top]").prop("checked", false);
|
||||
$("select[name='time_format']").val('time');
|
||||
$("select[name='timezone']").val('Europe/Madrid');
|
||||
$("select[name='clock_animation']").val('analogic_1');
|
||||
|
||||
|
||||
$("#preview").empty();
|
||||
@ -2102,6 +2133,84 @@ function setBarsGraph(id_data, values) {
|
||||
});
|
||||
}
|
||||
|
||||
function setClock(id_data, values) {
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_type_string"});
|
||||
parameter.push ({name: "time_format", value: values['time_format']});
|
||||
parameter.push ({name: "timezone", value: values['timezone']});
|
||||
parameter.push ({name: "clock_animation", value: values['clock_animation']});
|
||||
parameter.push ({name: "label", value: values['label']});
|
||||
parameter.push ({name: "width", value: values['width_percentile']});
|
||||
parameter.push ({name: "always_on_top", value: values['always_on_top']});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
if(values['clock_animation'] == 'analogic_1'){
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/clock.png');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/digital-clock.png');
|
||||
}
|
||||
|
||||
if (values['width_percentile'] == 0) {
|
||||
if(values['clock_animation'] == 'analogic_1'){
|
||||
$("#" + id_data + " img").css('width', 200 + 'px');
|
||||
$("#" + id_data + " img").css('height', 240 + 'px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', 200 + 'px');
|
||||
|
||||
if(values['time_format'] == 'time'){
|
||||
$("#" + id_data + " img").css('height', 71 + 'px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('height', 91 + 'px');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
if(values['clock_animation'] == 'analogic_1'){
|
||||
$("#" + id_data + " img").css('width', values['width_percentile'] + 'px');
|
||||
$("#" + id_data + " img").css('height', parseInt(values['width_percentile'])+40 + 'px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', values['width_percentile'] + 'px');
|
||||
|
||||
if(values['time_format'] == 'time'){
|
||||
$("#" + id_data + " img").css('height', parseInt(values['width_percentile'])/3.9+20 + 'px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('height', parseInt(values['width_percentile'])/3.9+40 + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
|
||||
$('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
|
||||
}
|
||||
else{
|
||||
$('#'+id_data+ ' img').css('margin-left', parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setModuleGraph(id_data) {
|
||||
var parameter = Array();
|
||||
|
||||
@ -2719,8 +2828,10 @@ function createItem(type, values, id_data) {
|
||||
|
||||
break;
|
||||
case 'group_item':
|
||||
|
||||
class_type = "group_item";
|
||||
|
||||
|
||||
img_src = "images/spinner.gif";
|
||||
|
||||
item = $('<div></div>')
|
||||
@ -2798,24 +2909,19 @@ function createItem(type, values, id_data) {
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
// Do none
|
||||
if(values['image'] != '' && values['image'] != 'none'){
|
||||
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
else{
|
||||
$image.attr('width', $('#preview > img')[0].naturalWidth)
|
||||
.attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$image.attr('width', values['naturalWidth'])
|
||||
.attr('height', values['naturalHeight']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
$image.attr('width', values['width'])
|
||||
@ -2917,13 +3023,13 @@ function createItem(type, values, id_data) {
|
||||
|
||||
if(values['image'] != '' && values['image'] != 'none'){
|
||||
// Do none
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
else{
|
||||
$image.attr('width', $('#preview > img')[0].naturalWidth)
|
||||
.attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$image.attr('width', values['naturalWidth'])
|
||||
.attr('height', values['naturalHeight']);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -3008,13 +3114,13 @@ function createItem(type, values, id_data) {
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
// Do none
|
||||
if(values['image'] != '' && values['image'] != 'none'){
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
else{
|
||||
$image.attr('width', $('#preview > img')[0].naturalWidth)
|
||||
.attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$image.attr('width', values['naturalWidth'])
|
||||
.attr('height', values['naturalHeight']);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -3141,13 +3247,13 @@ function createItem(type, values, id_data) {
|
||||
|
||||
if(values['image'] != '' && values['image'] != 'none'){
|
||||
// Do none
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
else{
|
||||
$image.attr('width', $('#preview > img')[0].naturalWidth)
|
||||
.attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$image.attr('width', values['naturalWidth'])
|
||||
.attr('height', values['naturalHeight']);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -3398,6 +3504,42 @@ function createItem(type, values, id_data) {
|
||||
|
||||
setBarsGraph(id_data, values);
|
||||
break;
|
||||
case 'clock':
|
||||
sizeStyle = '';
|
||||
imageSize = '';
|
||||
|
||||
if(values['label_position'] == 'up'){
|
||||
item = $('<div id="' + id_data + '" class="item clock" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'down'){
|
||||
item = $('<div id="' + id_data + '" class="item clock" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'left'){
|
||||
item = $('<div id="' + id_data + '" class="item clock" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img style="float:right" class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table style="float:left;height:'+values['height_module_graph']+'px;"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'right'){
|
||||
item = $('<div id="' + id_data + '" class="item clock" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img style="float:left" class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table style="float:right;height:'+values['height_module_graph']+'px;"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
setClock(id_data, values);
|
||||
|
||||
break;
|
||||
case 'simple_value':
|
||||
sizeStyle = '';
|
||||
imageSize = '';
|
||||
@ -3422,7 +3564,7 @@ function createItem(type, values, id_data) {
|
||||
break;
|
||||
case 'icon':
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalWidth'] > 150){
|
||||
sizeStyle = 'width: ' + '70' + 'px; height: ' + '70' + 'px;';
|
||||
imageSize = 'width="' + '70' + '" height="' + '70' + '"';
|
||||
}
|
||||
@ -3527,6 +3669,10 @@ function insertDB(type, values) {
|
||||
success: function (data) {
|
||||
if (data['correct']) {
|
||||
id = data['id_data'];
|
||||
if((type === 'group_item') || (type === 'icon') || (type === 'static_graph')){
|
||||
values['naturalWidth'] = $('#preview > img')[0].naturalWidth;
|
||||
values['naturalHeight'] = $('#preview > img')[0].naturalHeight;
|
||||
}
|
||||
createItem(type, values, id);
|
||||
addItemSelectParents(id, data['text']);
|
||||
//Reload all events for the item and new item.
|
||||
@ -3623,6 +3769,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
||||
case 'icon':
|
||||
case 'module_graph':
|
||||
case 'bars_graph':
|
||||
case 'clock':
|
||||
case 'auto_sla_graph':
|
||||
case 'donut_graph':
|
||||
|
||||
@ -3867,6 +4014,11 @@ function copyDB(idItem) {
|
||||
type = data['type'];
|
||||
id = data['id_data'];
|
||||
|
||||
if((type === 'group_item') || (type === 'icon') || (type === 'static_graph')){
|
||||
values['naturalWidth'] = $('#image_'+idItem).prop('naturalWidth');
|
||||
values['naturalHeight'] = $('#image_'+idItem).prop('naturalHeight');
|
||||
}
|
||||
|
||||
createItem(type, values, id);
|
||||
addItemSelectParents(id, data['text']);
|
||||
|
||||
@ -4111,6 +4263,15 @@ function eventsItems(drag) {
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('clock')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'clock';
|
||||
idItem = $(divParent).attr('id');
|
||||
activeToolboxButton('copy_item', true);
|
||||
activeToolboxButton('edit_item', true);
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('handler_start')) {
|
||||
idItem = $(divParent).attr('id')
|
||||
.replace("handler_start_", "");
|
||||
@ -4295,6 +4456,9 @@ function eventsItems(drag) {
|
||||
if ($(event.target).hasClass('icon')) {
|
||||
selectedItem = 'icon';
|
||||
}
|
||||
if ($(event.target).hasClass('clock')) {
|
||||
selectedItem = 'clock';
|
||||
}
|
||||
if ($(event.target).hasClass('handler_start')) {
|
||||
selectedItem = 'handler_start';
|
||||
}
|
||||
@ -4617,6 +4781,10 @@ function click_button_toolbox(id) {
|
||||
toolbuttonActive = creationItem = 'icon';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'clock':
|
||||
toolbuttonActive = creationItem = 'clock';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'group_item':
|
||||
toolbuttonActive = creationItem = 'group_item';
|
||||
toggle_item_palette();
|
||||
@ -4658,6 +4826,7 @@ function click_button_toolbox(id) {
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('clock', false);
|
||||
activeToolboxButton('service', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
@ -4691,6 +4860,7 @@ function click_button_toolbox(id) {
|
||||
activeToolboxButton('simple_value', true);
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('clock', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
activeToolboxButton('donut_graph', true);
|
||||
@ -4744,6 +4914,7 @@ function click_button_toolbox(id) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
$('.ColorPickerDivSample').css('background-color',"black");
|
||||
}
|
||||
|
||||
function showPreview(image) {
|
||||
|
@ -248,6 +248,18 @@ if(enterprise_installed()) {
|
||||
$row++;
|
||||
}
|
||||
|
||||
if(enterprise_installed()) {
|
||||
$table_styles->data[$row][0] = __('Docs URL (login)');
|
||||
$table_styles->data[$row][1] = html_print_input_text ('custom_docs_url', $config["custom_docs_url"], '', 50, 50, true);
|
||||
$row++;
|
||||
}
|
||||
|
||||
if(enterprise_installed()) {
|
||||
$table_styles->data[$row][0] = __('Support URL (login)');
|
||||
$table_styles->data[$row][1] = html_print_input_text ('custom_support_url', $config["custom_support_url"], '', 50, 50, true);
|
||||
$row++;
|
||||
}
|
||||
|
||||
$table_styles->data[$row][0] = __('Disable logo in graphs');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) .
|
||||
@ -475,8 +487,8 @@ if (!enterprise_installed()) {
|
||||
$disabled_graph_precision = true;
|
||||
}
|
||||
|
||||
$table_chars->data[$row][0] = __('Data precision for reports');
|
||||
$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown in reports. It must be a number between 0 and 5'), true);
|
||||
$table_chars->data[$row][0] = __('Data precision for reports and visual consoles');
|
||||
$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown in reports and visual consoles. It must be a number between 0 and 5'), true);
|
||||
$table_chars->data[$row][1] = html_print_input_text ('graph_precision', $config["graph_precision"], '', 5, 5, true, $disabled_graph_precision, false, "onChange=\"change_precision()\"");
|
||||
$row++;
|
||||
|
||||
|
@ -152,7 +152,7 @@ if ($create_user) {
|
||||
}
|
||||
|
||||
$values = array ();
|
||||
$id = (string) get_parameter ('id_user');
|
||||
$values['id_user'] = (string) get_parameter ('id_user');
|
||||
$values['fullname'] = (string) get_parameter ('fullname');
|
||||
$values['firstname'] = (string) get_parameter ('firstname');
|
||||
$values['lastname'] = (string) get_parameter ('lastname');
|
||||
@ -220,15 +220,14 @@ if ($create_user) {
|
||||
$new_user = true;
|
||||
}
|
||||
else {
|
||||
$info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] .
|
||||
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
||||
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
||||
' Is_admin: ' . $values['is_admin'] .
|
||||
' Language: ' . $values['language'] .
|
||||
' Block size: ' . $values['block_size'] . ' Interactive Charts: ' . $values['flash_chart'];
|
||||
$info =
|
||||
'{"Id_user":"' . $values['id_user'] . '","FullName":"' . $values['fullname'] . '","Firstname":"'. $values['firstname'] .'","Lastname":"'. $values['lastname'] . '","Email":"' . $values['email'] . '","Phone":"' . $values['phone'] . '","Comments":"' . $values['comments'] .'","Is_admin":"' . $values['is_admin'] .'","Language":"' . $values['language'] . '","Block size":"' . $values['block_size'] . '","Interactive Charts":"' . $values['flash_chart'].'"';
|
||||
|
||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||
$info .= ' Skin: ' . $values['id_skin'];
|
||||
$info .= ',"Skin":"' . $values['id_skin'].'"}';
|
||||
}
|
||||
else{
|
||||
$info .= '}';
|
||||
}
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
@ -278,6 +277,7 @@ if ($create_user) {
|
||||
|
||||
if ($update_user) {
|
||||
$values = array ();
|
||||
$values['id_user'] = (string) get_parameter ('id_user');
|
||||
$values['fullname'] = (string) get_parameter ('fullname');
|
||||
$values['firstname'] = (string) get_parameter ('firstname');
|
||||
$values['lastname'] = (string) get_parameter ('lastname');
|
||||
@ -362,21 +362,40 @@ if ($update_user) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
$info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] .
|
||||
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
||||
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
||||
' Is_admin: ' . $values['is_admin'] .
|
||||
' Language: ' . $values['language'] .
|
||||
' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'] .
|
||||
' Section: ' . $values['section'];
|
||||
|
||||
$has_skin = false;
|
||||
$has_wizard = false;
|
||||
|
||||
$info = '{"id_user":"'.$values['id_user'].'",
|
||||
"FullName":"' . $values['fullname'] .'",
|
||||
"Firstname":"' . $values['firstname'] .'",
|
||||
"Lastname":"' . $values['lastname'] . '",
|
||||
"Email":"' . $values['email'] . '",
|
||||
"Phone":"' . $values['phone'] . '",
|
||||
"Comments":"' . $values['comments'] . '",
|
||||
"Is_admin":"' . $values['is_admin'] . '",
|
||||
"Language":"' . $values['language'] . '",
|
||||
"Block size":"' . $values['block_size'] . '",
|
||||
"Flash Chats":"' . $values['flash_chart'] . '",
|
||||
"Section":"' . $values['section'].'"';
|
||||
|
||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||
$info .= ' Skin: ' . $values['id_skin'];
|
||||
$info .= ',"Skin":"' . $values['id_skin'].'"';
|
||||
$has_skin = true;
|
||||
}
|
||||
|
||||
if(enterprise_installed() && defined('METACONSOLE')) {
|
||||
$info .= ' Wizard access: ' . $values['metaconsole_access'];
|
||||
$info .= ',"Wizard access":"' . $values['metaconsole_access'].'"}';
|
||||
$has_wizard = true;
|
||||
}
|
||||
elseif($has_skin){
|
||||
$info .= '}';
|
||||
}
|
||||
|
||||
if(!$has_skin && !$has_wizard){
|
||||
$info .= '}';
|
||||
}
|
||||
|
||||
|
||||
db_pandora_audit("User management", "Updated user ".io_safe_input($id),
|
||||
false, false, $info);
|
||||
|
BIN
pandora_console/images/clock-tab.disabled.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
pandora_console/images/clock-tab.png
Normal file
After Width: | Height: | Size: 602 B |
BIN
pandora_console/images/console/signes/clock.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
pandora_console/images/console/signes/digital-clock.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
pandora_console/images/firts_task/icono-cluster-activo.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
pandora_console/images/networkmap/so_cluster.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
pandora_console/images/os_icons/so_big_icons/so_cluster.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
pandora_console/images/os_icons/so_cluster.png
Normal file
After Width: | Height: | Size: 850 B |
BIN
pandora_console/images/os_icons/so_cluster_small.png
Normal file
After Width: | Height: | Size: 659 B |
@ -159,6 +159,9 @@ if ($get_graphs){
|
||||
if($period > 1){
|
||||
$value['time_lapse'] = $period;
|
||||
}
|
||||
|
||||
$type_graph = ($value['type_graph'])? "line" : "area";
|
||||
|
||||
switch ($value['type']) {
|
||||
case 'simple_graph':
|
||||
if ($contador > 0) {
|
||||
@ -195,9 +198,8 @@ if ($get_graphs){
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
'area',
|
||||
$value['fullscale']
|
||||
);
|
||||
$type_graph,
|
||||
$value['fullscale']);
|
||||
$contador --;
|
||||
}
|
||||
// $table .= "</br>";
|
||||
@ -339,9 +341,8 @@ if ($get_graphs){
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
'area',
|
||||
$value['fullscale']
|
||||
);
|
||||
$type_graph,
|
||||
$value['fullscale']);
|
||||
$contador --;
|
||||
}
|
||||
}
|
||||
|
@ -283,6 +283,14 @@ if ($get_module_detail) {
|
||||
if ($attr[1] != "modules_format_data") {
|
||||
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
|
||||
}
|
||||
elseif(is_snapshot_data($row[$attr[0]])){
|
||||
if($config['command_snapshot']){
|
||||
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
|
||||
}
|
||||
else{
|
||||
$data[] = "<span>".wordwrap(io_safe_input($row[$attr[0]]),60,"<br>\n",true)."</span>";
|
||||
}
|
||||
}
|
||||
elseif (($config['command_snapshot'] == '0') && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
|
||||
// Its a single-data, multiline data (data snapshot) ?
|
||||
|
||||
@ -341,15 +349,6 @@ if ($get_module_detail) {
|
||||
if ($row[$attr[0]] == '') {
|
||||
$data[] = 'No data';
|
||||
}
|
||||
else {
|
||||
if(is_snapshot_data($row[$attr[0]])){
|
||||
if($config['command_snapshot']){
|
||||
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
|
||||
}
|
||||
else{
|
||||
$data[] = "<span>".wordwrap(io_safe_input($row[$attr[0]]),60,"<br>\n",true)."</span>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
|
||||
if($data_macro){
|
||||
@ -361,7 +360,6 @@ if ($get_module_detail) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
array_push ($table->data, $data);
|
||||
if (count($table->data) > 200)
|
||||
@ -472,6 +470,7 @@ if ($list_modules) {
|
||||
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
|
||||
|
||||
$id_agente = $id_agent = (int)get_parameter('id_agente', 0);
|
||||
$show_notinit = (int)get_parameter('show_notinit', 0);
|
||||
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agent;
|
||||
$selectTypeUp = '';
|
||||
$selectTypeDown = '';
|
||||
@ -593,6 +592,13 @@ if ($list_modules) {
|
||||
$status_text_monitor_sql .= $status_text_monitor . '%';
|
||||
}
|
||||
|
||||
if(!$show_notinit){
|
||||
$monitor_filter = AGENT_MODULE_STATUS_NO_DATA;
|
||||
}
|
||||
else{
|
||||
$monitor_filter = -15;
|
||||
}
|
||||
|
||||
//Count monitors/modules
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
@ -610,7 +616,7 @@ if ($list_modules) {
|
||||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
case "postgresql":
|
||||
@ -632,7 +638,7 @@ if ($list_modules) {
|
||||
tagente_modulo.nombre
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql,
|
||||
$tags_sql, AGENT_MODULE_STATUS_NO_DATA,$status_module_group_filter,$order['field'],
|
||||
$tags_sql, $monitor_filter,$status_module_group_filter,$order['field'],
|
||||
$order['order']);
|
||||
break;
|
||||
case "oracle":
|
||||
@ -650,7 +656,7 @@ if ($list_modules) {
|
||||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s
|
||||
", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter,$order['field'], $order['order']);
|
||||
break;
|
||||
}
|
||||
@ -679,7 +685,7 @@ if ($list_modules) {
|
||||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
|
||||
break;
|
||||
@ -698,7 +704,7 @@ if ($list_modules) {
|
||||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
// If Dbms is Oracle then field_list in sql statement has to be recoded. See oracle_list_all_field_table()
|
||||
@ -721,7 +727,7 @@ if ($list_modules) {
|
||||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s
|
||||
", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ $parent = get_parameter('parent', null);
|
||||
$map_linked = get_parameter('map_linked', null);
|
||||
$map_linked_weight = get_parameter('map_linked_weight', null);
|
||||
$element_group = get_parameter('element_group', null);
|
||||
$width_percentile = get_parameter('width_percentile', null);
|
||||
$width_percentile = get_parameter('width_percentile', 0);
|
||||
$bars_graph_height = get_parameter('bars_graph_height', null);
|
||||
$max_percentile = get_parameter('max_percentile', null);
|
||||
$height_module_graph = get_parameter('height_module_graph', null);
|
||||
@ -145,6 +145,10 @@ $type_graph = get_parameter('type_graph', 'area');
|
||||
$label_position = get_parameter('label_position', 'down');
|
||||
$show_statistics = get_parameter('show_statistics', 0);
|
||||
|
||||
$clock_animation = get_parameter('clock_animation', 'analogic_1');
|
||||
$time_format = get_parameter('time_format', 'time');
|
||||
$timezone = get_parameter('timezone', 'Europe/Madrid');
|
||||
|
||||
switch ($action) {
|
||||
case 'get_font':
|
||||
$return = array();
|
||||
@ -735,6 +739,23 @@ switch ($action) {
|
||||
$values['width'] = $width;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'clock':
|
||||
if ($clock_animation !== null) {
|
||||
$values['clock_animation'] = $clock_animation;
|
||||
}
|
||||
if ($time_format !== null) {
|
||||
$values['time_format'] = $time_format;
|
||||
}
|
||||
if ($timezone !== null) {
|
||||
$values['timezone'] = $timezone;
|
||||
}
|
||||
if ($width !== null) {
|
||||
$values['width'] = $width_percentile;
|
||||
}
|
||||
if ($fill_color !== null) {
|
||||
$values['fill_color'] = $fill_color;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (enterprise_installed()) {
|
||||
@ -782,6 +803,13 @@ switch ($action) {
|
||||
unset($values['width']);
|
||||
unset($values['id_agent']);
|
||||
break;
|
||||
case 'clock':
|
||||
unset($values['clock_animation']);
|
||||
unset($values['time_format']);
|
||||
unset($values['timezone']);
|
||||
unset($values['fill_color']);
|
||||
unset($values['width']);
|
||||
break;
|
||||
case 'box_item':
|
||||
unset($values['border_width']);
|
||||
unset($values['border_color']);
|
||||
@ -843,6 +871,7 @@ switch ($action) {
|
||||
case 'simple_value':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'clock':
|
||||
case 'auto_sla_graph':
|
||||
case 'donut_graph':
|
||||
$elementFields = db_get_row_filter('tlayout_data',
|
||||
@ -945,6 +974,9 @@ switch ($action) {
|
||||
$elementFields['width_module_graph'] = $elementFields['width'];
|
||||
$elementFields['height_module_graph'] = $elementFields['height'];
|
||||
break;
|
||||
case 'clock':
|
||||
$elementFields['width_percentile'] = $elementFields['width'];
|
||||
break;
|
||||
case 'bars_graph':
|
||||
$elementFields['width_percentile'] = $elementFields['width'];
|
||||
$elementFields['bars_graph_height'] = $elementFields['height'];
|
||||
@ -1120,6 +1152,14 @@ switch ($action) {
|
||||
$values['border_color'] = $grid_color;
|
||||
$values['id_agent'] = $id_agent_string;
|
||||
break;
|
||||
case 'clock':
|
||||
$values['type'] = CLOCK;
|
||||
$values['width'] = $width_percentile;
|
||||
$values['clock_animation'] = $clock_animation;
|
||||
$values['fill_color'] = $fill_color;
|
||||
$values['time_format'] = $time_format;
|
||||
$values['timezone'] = $timezone;
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
$values['type'] = AUTO_SLA_GRAPH;
|
||||
$values['period'] = $event_max_time_row;
|
||||
|
@ -22,7 +22,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC180131';
|
||||
$build_version = 'PC180210';
|
||||
$pandora_version = 'v7.0NG.718';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -201,6 +201,7 @@ define('CIRCULAR_PROGRESS_BAR', 15);
|
||||
define('CIRCULAR_INTERIOR_PROGRESS_BAR', 16);
|
||||
define('DONUT_GRAPH', 17);
|
||||
define('BARS_GRAPH', 18);
|
||||
define('CLOCK', 19);
|
||||
//Some styles
|
||||
define('MIN_WIDTH', 300);
|
||||
define('MIN_HEIGHT', 120);
|
||||
@ -321,6 +322,9 @@ define ('MODULE_WUX', 8);
|
||||
define ('MODULE_PREDICTION_SERVICE', 2);
|
||||
define ('MODULE_PREDICTION_SYNTHETIC', 3);
|
||||
define ('MODULE_PREDICTION_NETFLOW', 4);
|
||||
define ('MODULE_PREDICTION_CLUSTER', 5);
|
||||
define ('MODULE_PREDICTION_CLUSTER_AA', 6);
|
||||
define ('MODULE_PREDICTION_CLUSTER_AP', 7);
|
||||
|
||||
/* SNMP CONSTANTS */
|
||||
define('SNMP_DIR_MIBS', "attachment/mibs");
|
||||
|
@ -1810,7 +1810,7 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
|
||||
}
|
||||
|
||||
if ($id_group != 0 || $onlyOneGroup === true) {
|
||||
$groups_list_acl = users_get_groups ($id_user, 'AR', false, true, null);
|
||||
$groups_list_acl = users_get_groups ($id_user, $access, false, true, null);
|
||||
}
|
||||
else{
|
||||
$groups_list_acl = get_users_acl($id_user);
|
||||
@ -2143,18 +2143,7 @@ function is_image_data ($data) {
|
||||
* Looks for two or more carriage returns.
|
||||
*/
|
||||
function is_snapshot_data ($data) {
|
||||
|
||||
// TODO IDEA: In the future, we can set a variable in setup
|
||||
// to define how many \n must have a snapshot to define it's
|
||||
// a snapshot. I think two or three is a good value anyway.
|
||||
|
||||
$temp = array();
|
||||
$count = preg_match_all ("/\n/", $data, $temp);
|
||||
|
||||
if ( ($count > 2) || (is_image_data($data)) )
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return is_image_data($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2775,6 +2764,12 @@ function register_pass_change_try ($id_user, $success) {
|
||||
$values['success'] = $success;
|
||||
db_process_sql_insert('treset_pass_history', $values);
|
||||
}
|
||||
|
||||
function isJson($string) {
|
||||
json_decode($string);
|
||||
return (json_last_error() == JSON_ERROR_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true or false if it is a valid ip
|
||||
* checking ipv4 and ipv6 or resolves the name dns
|
||||
|
@ -1747,10 +1747,21 @@ function get_group_alerts($id_group, $filter = '', $options = false,
|
||||
break;
|
||||
}
|
||||
|
||||
//WHEN SELECT ALL TAGS TO FILTER ALERTS
|
||||
|
||||
$modules_tags = count(db_process_sql('select * from ttag'));
|
||||
|
||||
$modules_user_tags = count(explode(",", $tag));
|
||||
|
||||
if($modules_tags != $modules_user_tags){
|
||||
if ($tag) {
|
||||
$filter .= ' AND (id_agent_module IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN ('.$tag.')))';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//WHEN SELECT ALL TAGS TO FILTER ALERTS
|
||||
|
||||
if($action_filter){
|
||||
$filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))';
|
||||
}
|
||||
|
@ -513,6 +513,11 @@ function config_update_config () {
|
||||
if (!config_update_value ('login_background', (string) get_parameter ('login_background')))
|
||||
$error_update[] = __('Login background');
|
||||
|
||||
if (!config_update_value ('custom_docs_url', (string) get_parameter ('custom_docs_url')))
|
||||
$error_update[] = __('Custom Docs url');
|
||||
if (!config_update_value ('custom_support_url', (string) get_parameter ('custom_support_url')))
|
||||
$error_update[] = __('Custom support url');
|
||||
|
||||
if (!config_update_value ('meta_custom_logo', (string) get_parameter ('meta_custom_logo')))
|
||||
$error_update[] = __('Custom logo metaconsole');
|
||||
if (!config_update_value ('meta_custom_logo_login', (string) get_parameter ('meta_custom_logo_login')))
|
||||
@ -526,6 +531,11 @@ function config_update_config () {
|
||||
if (!config_update_value ('meta_login_background', (string) get_parameter ('meta_login_background')))
|
||||
$error_update[] = __('Login background metaconsole');
|
||||
|
||||
if (!config_update_value ('meta_custom_docs_url', (string) get_parameter ('meta_custom_docs_url')))
|
||||
$error_update[] = __('Custom Docs url');
|
||||
if (!config_update_value ('meta_custom_support_url', (string) get_parameter ('meta_custom_support_url')))
|
||||
$error_update[] = __('Custom support url');
|
||||
|
||||
if (!config_update_value ('vc_refr', get_parameter('vc_refr')))
|
||||
$error_update[] = __('Default interval for refresh on Visual Console');
|
||||
if (!config_update_value ('vc_favourite_view', (int) get_parameter('vc_favourite_view', 5)))
|
||||
@ -1186,6 +1196,22 @@ function config_process_config () {
|
||||
config_update_value ('custom_title2_login', __('NEXT GENERATION'));
|
||||
}
|
||||
|
||||
if (!isset ($config["custom_docs_url"])) {
|
||||
config_update_value ('custom_docs_url', 'http://wiki.pandorafms.com/');
|
||||
}
|
||||
|
||||
if (!isset ($config["custom_support_url"])) {
|
||||
config_update_value ('custom_support_url', 'https://support.artica.es');
|
||||
}
|
||||
|
||||
if (!isset ($config["meta_custom_docs_url"])) {
|
||||
config_update_value ('meta_custom_docs_url', 'http://wiki.pandorafms.com/index.php?title=Main_Page');
|
||||
}
|
||||
|
||||
if (!isset ($config["meta_custom_support_url"])) {
|
||||
config_update_value ('meta_custom_support_url', 'https://support.artica.es');
|
||||
}
|
||||
|
||||
if (!isset ($config["meta_custom_logo"])) {
|
||||
config_update_value ('meta_custom_logo', 'logo_pandora_metaconsola.png');
|
||||
}
|
||||
|
@ -2283,7 +2283,7 @@ function events_page_details ($event, $server = "") {
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Instructions');
|
||||
$data[1] = events_display_instructions ($event['event_type'], $events, true);
|
||||
$data[1] = events_display_instructions ($event['event_type'], $event, true);
|
||||
$table_details->data[] = $data;
|
||||
|
||||
$data = array();
|
||||
|
@ -2046,6 +2046,15 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
}
|
||||
|
||||
foreach ($module_list as $key => $value) {
|
||||
if (is_metaconsole()) {
|
||||
$server = metaconsole_get_connection_by_id ($value['server']);
|
||||
metaconsole_connect($server);
|
||||
$value = $value['module'];
|
||||
}
|
||||
if ($labels[$value] != ''){
|
||||
$module_name_list[$key] = $labels[$value];
|
||||
}
|
||||
else {
|
||||
$agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
|
||||
$alias = db_get_value ("alias","tagente","nombre",$agent_name);
|
||||
$module_name = io_safe_output( modules_get_agentmodule_name ($value) );
|
||||
@ -2057,12 +2066,27 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
$module_name_list[$key] = $alias . " / " . $module_name;
|
||||
}
|
||||
}
|
||||
if (is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($percentil) && $percentil) {
|
||||
foreach ($module_list as $key => $value) {
|
||||
if (is_metaconsole()) {
|
||||
$server = metaconsole_get_connection_by_id ($value['server']);
|
||||
metaconsole_connect($server);
|
||||
$value = $value['module'];
|
||||
}
|
||||
|
||||
$agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
|
||||
$alias = db_get_value ("alias","tagente","nombre",$agent_name);
|
||||
$module_name = io_safe_output( modules_get_agentmodule_name ($value) );
|
||||
|
||||
if (is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$module_name_list['percentil'.$key] = __('Percentile %dº', $config['percentil']) . __(' of module ') . $agent_name .' / ' . $module_name . ' (' . $percentil_result[$key][0] . ' ' . $unit . ') ';
|
||||
$series_type[$key] = 'line';
|
||||
}
|
||||
@ -2468,17 +2492,21 @@ function fullscale_data_combined($module_list, $period, $date, $flash_charts, $p
|
||||
$array_percentil = array();
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$server = metaconsole_get_connection_by_id ($value_module['server']);
|
||||
metaconsole_connect($server);
|
||||
$previous_data = modules_get_previous_data ($value_module['module'], $datelimit);
|
||||
$data_uncompress = db_uncompress_module_data($value_module['module'], $datelimit, $date);
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
else{
|
||||
$previous_data = modules_get_previous_data ($value_module, $datelimit);
|
||||
$data_uncompress = db_uncompress_module_data($value_module, $datelimit, $date);
|
||||
}
|
||||
|
||||
foreach ($data_uncompress as $key_data => $value_data) {
|
||||
foreach ($value_data['data'] as $k => $v) {
|
||||
if($flash_charts) {
|
||||
$real_date = date("Y M d H:i:s", $v['utimestamp']);
|
||||
}
|
||||
else{
|
||||
$real_date = $v['utimestamp'];
|
||||
}
|
||||
|
||||
if(!isset($v['datos'])){
|
||||
$v['datos'] = $previous_data;
|
||||
@ -2513,9 +2541,17 @@ function fullscale_data_combined($module_list, $period, $date, $flash_charts, $p
|
||||
}
|
||||
|
||||
$data_prev = array();
|
||||
|
||||
$data_all_rev = array();
|
||||
ksort($data_all);
|
||||
|
||||
foreach ($data_all as $key => $value) {
|
||||
if($flash_charts) {
|
||||
$real_date = date("Y M d H:i:s", $key);
|
||||
}
|
||||
else{
|
||||
$real_date = $key;
|
||||
}
|
||||
|
||||
foreach ($module_list as $key_module => $value_module) {
|
||||
if(!isset($value[$key_module])){
|
||||
$data_all[$key][$key_module] = $data_prev[$key_module];
|
||||
@ -2524,13 +2560,14 @@ function fullscale_data_combined($module_list, $period, $date, $flash_charts, $p
|
||||
$data_prev[$key_module] = $value[$key_module];
|
||||
}
|
||||
}
|
||||
$data_all_rev[$real_date] = $data_all[$key];
|
||||
}
|
||||
|
||||
if (!is_null($percentil) && $percentil) {
|
||||
$data_all['percentil'] = $percentil_result;
|
||||
$data_all_rev['percentil'] = $percentil_result;
|
||||
}
|
||||
|
||||
return $data_all;
|
||||
return $data_all_rev;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1649,6 +1649,11 @@ function modules_is_unit_macro($macro) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function modules_get_last_contact ($id_agentmodule) {
|
||||
return db_get_value ('utimestamp', 'tagente_estado',
|
||||
'id_agente_modulo', $id_agentmodule);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value of an agent module.
|
||||
*
|
||||
|
@ -74,4 +74,8 @@ function os_get_os() {
|
||||
|
||||
return $op_systems;
|
||||
}
|
||||
|
||||
function os_get_icon($id_os) {
|
||||
return db_get_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
|
||||
}
|
||||
?>
|
||||
|
@ -1432,8 +1432,12 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags = array(), $c
|
||||
AND id_perfil IN (
|
||||
SELECT id_perfil
|
||||
FROM tperfil
|
||||
WHERE ".get_acl_column($access)." = 1)
|
||||
AND id_grupo = ".$id_group;
|
||||
WHERE ".get_acl_column($access)." = 1)";
|
||||
|
||||
if(isset($id_group)){
|
||||
$sql .= "AND id_grupo = ".$id_group;
|
||||
}
|
||||
|
||||
$user_has_perm_without_tags = db_get_all_rows_sql ($sql);
|
||||
|
||||
if ($user_has_perm_without_tags) {
|
||||
|
@ -140,6 +140,9 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro
|
||||
}
|
||||
|
||||
function get_group_ancestors($group_id, $groups) {
|
||||
if($group_id == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!isset($groups[$group_id])) {
|
||||
return null;
|
||||
@ -151,17 +154,13 @@ function get_group_ancestors($group_id, $groups) {
|
||||
return $group_id;
|
||||
}
|
||||
|
||||
if ($parent == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$r = get_group_ancestors($parent, $groups);
|
||||
|
||||
if (is_array($r)) {
|
||||
$r = array_merge(array($parent), $r);
|
||||
$r = array_merge(array($group_id), $r);
|
||||
}
|
||||
else {
|
||||
$r = array($parent, $r);
|
||||
$r = array($group_id, $r);
|
||||
}
|
||||
|
||||
return $r;
|
||||
@ -300,8 +299,7 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
|
||||
}
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$parents = get_group_ancestors($group["id_grupo"],$groups);
|
||||
|
||||
$parents = get_group_ancestors($group["parent"],$groups);
|
||||
if (is_array($parents)) {
|
||||
foreach ($parents as $parent) {
|
||||
if ( (isset($forest_acl[$parent])) && ($groups[$parent]["propagate"] == 1)) {
|
||||
@ -325,7 +323,6 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the group cache.
|
||||
$group_cache[$id_user] = $forest_acl;
|
||||
}
|
||||
@ -409,7 +406,7 @@ function old_users_get_groups ($id_user = false, $privilege = "AR", $returnAllGr
|
||||
$query = sprintf("SELECT tgrupo.*, tperfil.*, tusuario_perfil.tags FROM tgrupo, tusuario_perfil, tperfil
|
||||
WHERE (tgrupo.id_grupo = tusuario_perfil.id_grupo OR tusuario_perfil.id_grupo = 0)
|
||||
AND tusuario_perfil.id_perfil = tperfil.id_perfil
|
||||
AND tusuario_perfil.id_usuario = '%s' ORDER BY nombre", $id_user);
|
||||
AND tusuario_perfil.id_usuario = '%s' ORDER BY tgrupo.nombre", $id_user);
|
||||
$groups = db_get_all_rows_sql ($query);
|
||||
|
||||
// Get children groups.
|
||||
|
@ -112,6 +112,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$fill_color = $layoutData['fill_color'];
|
||||
$label_position = $layoutData['label_position'];
|
||||
$show_on_top = $layoutData['show_on_top'];
|
||||
$clock_animation = $layoutData['clock_animation'];
|
||||
$time_format = $layoutData['time_format'];
|
||||
$timezone = $layoutData['timezone'];
|
||||
|
||||
if($show_on_top){
|
||||
$show_on_top_index = 10;
|
||||
@ -155,6 +158,35 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$tableheight0 = $height;
|
||||
}
|
||||
|
||||
if ($layoutData['width'] == 0){
|
||||
switch($type) {
|
||||
case 19:
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$himg = '200';
|
||||
$wimg ='200';
|
||||
}
|
||||
else{
|
||||
$himg = '60';
|
||||
$wimg ='200';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
switch($type) {
|
||||
case 19:
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$himg = $width;
|
||||
$wimg = $width;
|
||||
}
|
||||
else{
|
||||
$himg = $width/3.9;
|
||||
$wimg = $width;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($layoutData['width'] == 0 || $layoutData['height'] == 0) {
|
||||
switch($type) {
|
||||
case 0:
|
||||
@ -1426,6 +1458,125 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
case BOX_ITEM:
|
||||
$z_index = 1;
|
||||
break;
|
||||
case CLOCK:
|
||||
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
|
||||
if($width == 0){
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$img = '<img src="../../images/console/signes/clock.png" style="width:200px;height:240px;">';
|
||||
}
|
||||
else{
|
||||
|
||||
if($layoutData['time_format'] = 'time'){
|
||||
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:200px;height:71px;">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:200px;height:91px;">';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$img = '<img src="images/console/signes/clock.png" style="width:200px;height:240px;">';
|
||||
}
|
||||
else{
|
||||
|
||||
if($layoutData['time_format'] == 'time'){
|
||||
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:71px">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:91px">';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$img = '<img src="../../images/console/signes/clock.png" style="width:'.$width.'px;height:'. ($width+40).'px;">';
|
||||
}
|
||||
else{
|
||||
|
||||
if($layoutData['time_format'] == 'time'){
|
||||
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:'.$width.'px;height:'. (($width/3.9)+20).'px;">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:'.$width.'px;height:'. (($width/3.9)+40).'px;">';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
$img = '<img src="images/console/signes/clock.png" style="width:'.$width.'px;height:'. ($width+40).'px;">';
|
||||
}
|
||||
else{
|
||||
if($layoutData['time_format'] == 'time'){
|
||||
$img = '<img src="images/console/signes/digital-clock.png" style="width:'.$width.'px;height:'. (($width/3.9)+20).'px;">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="images/console/signes/digital-clock.png" style="width:'.$width.'px;height:'. (($width/3.9)+40).'px;">';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($layoutData['clock_animation'] == 'analogic_1'){
|
||||
|
||||
if ($width == 0) {
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">' .print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
else {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';height:'.$himg.'px;">' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' .print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
else {
|
||||
$img ='<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';height:'.$himg.'px;">' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
elseif($layoutData['clock_animation'] == 'digital_1'){
|
||||
|
||||
if ($width == 0) {
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">' .print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
else {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';height:'.$himg.'px;">' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' .print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
else {
|
||||
$img ='<div id="clock_'.$layoutData['id'].'" style="z-index:'.$show_on_top_index.';height:'.$himg.'px;">' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
|
||||
if($width == 0 || $height == 0){
|
||||
@ -1517,6 +1668,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
case ICON:
|
||||
$class .= "icon";
|
||||
break;
|
||||
case CLOCK:
|
||||
$class .= "clock";
|
||||
break;
|
||||
case BOX_ITEM:
|
||||
$class .= "box_item";
|
||||
break;
|
||||
@ -1585,6 +1739,68 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
case STATIC_GRAPH:
|
||||
case GROUP_ITEM:
|
||||
|
||||
|
||||
if (! defined ('METACONSOLE')) {
|
||||
}
|
||||
else {
|
||||
// For each server defined and not disabled:
|
||||
$servers = db_get_all_rows_sql ('SELECT *
|
||||
FROM tmetaconsole_setup
|
||||
WHERE disabled = 0');
|
||||
if ($servers === false)
|
||||
$servers = array();
|
||||
|
||||
$result = array();
|
||||
$count_modules = 0;
|
||||
foreach ($servers as $server) {
|
||||
// If connection was good then retrieve all data server
|
||||
if (metaconsole_connect($server) == NOERR)
|
||||
$connection = true;
|
||||
else
|
||||
$connection = false;
|
||||
|
||||
$result_server = db_get_all_rows_sql ($sql);
|
||||
|
||||
if (!empty($result_server)) {
|
||||
|
||||
// Create HASH login info
|
||||
$pwd = $server['auth_token'];
|
||||
$auth_serialized = json_decode($pwd,true);
|
||||
|
||||
if (is_array($auth_serialized)) {
|
||||
$pwd = $auth_serialized['auth_token'];
|
||||
$api_password = $auth_serialized['api_password'];
|
||||
$console_user = $auth_serialized['console_user'];
|
||||
$console_password = $auth_serialized['console_password'];
|
||||
}
|
||||
|
||||
$user = $config['id_user'];
|
||||
$user_rot13 = str_rot13($config['id_user']);
|
||||
$hashdata = $user.$pwd;
|
||||
$hashdata = md5($hashdata);
|
||||
$url_hash = '&' .
|
||||
'loginhash=auto&' .
|
||||
'loginhash_data=' . $hashdata . '&' .
|
||||
'loginhash_user=' . $user_rot13;
|
||||
|
||||
foreach ($result_server as $result_element_key => $result_element_value) {
|
||||
|
||||
$result_server[$result_element_key]['server_id'] = $server['id'];
|
||||
$result_server[$result_element_key]['server_name'] = $server['server_name'];
|
||||
$result_server[$result_element_key]['server_url'] = $server['server_url'].'/';
|
||||
$result_server[$result_element_key]['hashdata'] = $hashdata;
|
||||
$result_server[$result_element_key]['user'] = $config['id_user'];
|
||||
|
||||
$count_modules++;
|
||||
|
||||
}
|
||||
|
||||
$result = array_merge($result, $result_server);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (($layoutData['image'] != null && $layoutData['image'] != 'none') || $layoutData['show_statistics'] == 1) {
|
||||
|
||||
|
||||
@ -1608,7 +1824,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
if (!modules_is_boolean($layoutData['id_agente_modulo'])) {
|
||||
$img_style_title .=
|
||||
" <br>" . __("Last value: ")
|
||||
. remove_right_zeros(number_format($value, $config['graph_precision']));
|
||||
. remove_right_zeros(number_format($value, $config['graph_precision'])).$unit_text;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1781,6 +1997,13 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
|
||||
if (! defined ('METACONSOLE')) {
|
||||
}
|
||||
else {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case PERCENTILE_BAR:
|
||||
@ -1958,6 +2181,19 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
|
||||
echo $img;
|
||||
|
||||
if ($layoutData['label_position']=='down') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
elseif($layoutData['label_position']=='left' || $layoutData['label_position']=='right') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
break;
|
||||
case CLOCK:
|
||||
if ($layoutData['label_position']=='up') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
echo $img;
|
||||
|
||||
if ($layoutData['label_position']=='down') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
@ -3390,6 +3626,10 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
||||
if ($returnAllGroup) {
|
||||
$groups = users_get_groups ($id_user, 'VR', true, true);
|
||||
} else {
|
||||
if(users_is_admin($id_user)){
|
||||
$groups = users_get_groups ($id_user, 'VR', true, true);
|
||||
}
|
||||
else{
|
||||
if(!empty($filter['group'])) {
|
||||
$permissions_group = users_get_groups ($id_user, 'VR', false, true);
|
||||
if(empty($permissions_group)){
|
||||
@ -3402,6 +3642,8 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
||||
$groups = users_get_groups ($id_user, 'VM', false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($filter['group']);
|
||||
}
|
||||
|
||||
@ -3422,7 +3664,6 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
||||
}
|
||||
|
||||
$layouts = db_get_all_rows_filter ('tlayout', $where);
|
||||
|
||||
if ($layouts == false)
|
||||
return array ();
|
||||
|
||||
@ -3662,6 +3903,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
||||
case MODULE_GRAPH:
|
||||
$text = __('Module graph');
|
||||
break;
|
||||
case 'clock':
|
||||
case CLOCK:
|
||||
$text = __('Clock');
|
||||
break;
|
||||
case 'bars_graph':
|
||||
case BARS_GRAPH:
|
||||
$text = __('Bars graph');
|
||||
@ -3810,6 +4055,9 @@ function visual_map_type_in_js($type) {
|
||||
case ICON:
|
||||
return 'icon';
|
||||
break;
|
||||
case CLOCK:
|
||||
return 'clock';
|
||||
break;
|
||||
case SIMPLE_VALUE_MAX:
|
||||
return 'simple_value';
|
||||
break;
|
||||
|
@ -59,6 +59,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
|
||||
'label' => __('Label'),
|
||||
'icon' => __('Icon'),
|
||||
'clock' => __('Clock'),
|
||||
'group_item' => __('Group'),
|
||||
'box_item' => __('Box'),
|
||||
'line_item' => __('Line'));
|
||||
@ -136,11 +137,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
|
||||
|
||||
$form_items['fill_color_row'] = array();
|
||||
$form_items['fill_color_row']['items'] = array('datos', 'box_item');
|
||||
$form_items['fill_color_row']['items'] = array('datos', 'box_item','clock');
|
||||
$form_items['fill_color_row']['html'] =
|
||||
'<td align="left" valign="top" style="">' . __('Fill color') . '</td>' .
|
||||
'<td align="left" style="">' .
|
||||
html_print_input_text_extended ('fill_color', '#ffffff',
|
||||
html_print_input_text_extended ('fill_color', '#000000',
|
||||
'text-fill_color', '', 7, 7, false, '',
|
||||
'class="fill_color"', true) .
|
||||
'</td>';
|
||||
@ -162,7 +163,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
'datos',
|
||||
'group_item',
|
||||
'auto_sla_graph',
|
||||
'bars_graph');
|
||||
'bars_graph',
|
||||
'clock');
|
||||
$form_items['label_row']['html'] =
|
||||
'<td align="left" valign="top" style="">' . __('Label') . '
|
||||
|
||||
@ -204,6 +206,45 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', 'none', true) .
|
||||
'</td>';
|
||||
|
||||
$form_items['clock_animation_row'] = array();
|
||||
$form_items['clock_animation_row']['items'] = array('clock');
|
||||
$form_items['clock_animation_row']['html'] = '<td align="left"><span>' .
|
||||
__('Clock animation') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('analogic_1' => __('Simple analogic'),
|
||||
'digital_1' => __('Simple digital')),
|
||||
'clock_animation', '', '', 0, 'analogic_1', true, false, false) . '</td>';
|
||||
|
||||
$form_items['timeformat_row'] = array();
|
||||
$form_items['timeformat_row']['items'] = array('clock');
|
||||
$form_items['timeformat_row']['html'] = '<td align="left"><span>' .
|
||||
__('Time format') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('time' => __('Only time'),
|
||||
'timedate' => __('Time and date')),
|
||||
'time_format', '', '', 0, 'time', true, false, false) . '</td>';
|
||||
|
||||
$zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarctica' => __('Antarctica'), 'Arctic' => __('Arctic'), 'Asia' => __('Asia'), 'Atlantic' => __('Atlantic'), 'Australia' => __('Australia'), 'Europe' => __('Europe'), 'Indian' => __('Indian'), 'Pacific' => __('Pacific'), 'UTC' => __('UTC'));
|
||||
$zone_selected = 'Europe';
|
||||
|
||||
$timezones = timezone_identifiers_list();
|
||||
foreach ($timezones as $timezone) {
|
||||
if (strpos($timezone, $zone_selected) !== false) {
|
||||
$timezone_n[$timezone] = $timezone;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$form_items['timezone_row'] = array();
|
||||
$form_items['timezone_row']['items'] = array('clock');
|
||||
$form_items['timezone_row']['html'] = '<td align="left"><span>' .
|
||||
__('Time zone') . '</span></td>
|
||||
<td align="left">'.
|
||||
html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true).
|
||||
" ". html_print_select($timezone_n, 'timezone','', '', '', '', true).
|
||||
'</td>';
|
||||
|
||||
|
||||
|
||||
$form_items['enable_link_row'] = array();
|
||||
$form_items['enable_link_row']['items'] = array(
|
||||
@ -454,7 +495,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
|
||||
|
||||
$form_items['percentile_bar_row_1'] = array();
|
||||
$form_items['percentile_bar_row_1']['items'] = array('percentile_bar', 'percentile_item', 'datos', 'donut_graph', 'bars_graph');
|
||||
$form_items['percentile_bar_row_1']['items'] = array('percentile_bar', 'percentile_item', 'datos', 'donut_graph', 'bars_graph','clock');
|
||||
$form_items['percentile_bar_row_1']['html'] = '<td align="left">' .
|
||||
__('Width') . '</td>
|
||||
<td align="left">' . html_print_input_text('width_percentile', 0, '', 3, 5, true) . '</td>';
|
||||
@ -613,7 +654,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
$form_items_advance['position_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'label', 'icon', 'datos', 'box_item',
|
||||
'auto_sla_graph', 'bars_graph');
|
||||
'auto_sla_graph', 'bars_graph','clock');
|
||||
$form_items_advance['position_row']['html'] = '
|
||||
<td align="left">' . __('Position') . '</td>
|
||||
<td align="left">(' . html_print_input_text('left', '0', '', 3, 5, true) .
|
||||
@ -788,6 +829,25 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
|
||||
|
||||
});
|
||||
|
||||
function show_timezone () {
|
||||
zone = $("#zone").val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#timezone").empty();
|
||||
jQuery.each (data, function (id, value) {
|
||||
timezone = value;
|
||||
var timezone_country = timezone.replace (/^.*\//g, "");
|
||||
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
@ -810,6 +870,7 @@ function visual_map_editor_print_toolbox() {
|
||||
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
|
||||
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
|
||||
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
|
||||
visual_map_print_button_editor('clock', __('Clock'), 'left', false, 'clock_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('line_item', __('Line'), 'left', false, 'line_item_min', true);
|
||||
|
@ -408,4 +408,252 @@ function d3_donut_graph ($id, $width, $height, $module_data, $resume_color) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
function print_clock_analogic_1 ($time_format, $timezone, $clock_animation,$width,$height,$id_element,$color) {
|
||||
global $config;
|
||||
$output .= "<style type=\"text/css\">
|
||||
body {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
svg{
|
||||
stroke: #000;
|
||||
font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;
|
||||
}
|
||||
|
||||
#rim {
|
||||
fill: none;
|
||||
stroke: #999;
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
.second-hand{
|
||||
stroke-width:3;
|
||||
|
||||
}
|
||||
|
||||
.minute-hand{
|
||||
stroke-width:8;
|
||||
stroke-linecap:round;
|
||||
}
|
||||
|
||||
.hour-hand{
|
||||
stroke-width:12;
|
||||
stroke-linecap:round;
|
||||
}
|
||||
|
||||
.hands-cover{
|
||||
stroke-width:3;
|
||||
fill:#fff;
|
||||
}
|
||||
|
||||
.second-tick{
|
||||
stroke-width:3;
|
||||
fill:#000;
|
||||
}
|
||||
|
||||
.hour-tick{
|
||||
stroke-width:8; //same as the miute hand
|
||||
}
|
||||
|
||||
.second-label{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.hour-label{
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>";
|
||||
|
||||
$tz = $timezone;
|
||||
$timestamp = time();
|
||||
$dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
|
||||
$dt->setTimestamp($timestamp); //adjust the object to correct timestamp
|
||||
|
||||
$dateTimeZoneOption = new DateTimeZone(date_default_timezone_get());
|
||||
$dateTimeZonePandora = new DateTimeZone($timezone);
|
||||
|
||||
$dateTimeOption = new DateTime("now", $dateTimeZoneOption);
|
||||
$dateTimePandora = new DateTime("now", $dateTimeZonePandora);
|
||||
|
||||
$timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption);
|
||||
|
||||
$output .= include_javascript_d3(true);
|
||||
|
||||
if($width == 0){
|
||||
$date_width = 200;
|
||||
}
|
||||
else{
|
||||
$date_width = $width;
|
||||
}
|
||||
|
||||
$output .= '<div style="width:'.$date_width.'px;text-align:center;font-style:italic;font-size:12pt;color:'.$color.'">';
|
||||
|
||||
if($time_format == 'timedate'){
|
||||
$output .= $dt->format('d / m / Y').' - ';
|
||||
|
||||
}
|
||||
|
||||
$output .= $dt->format('a').'</div>';
|
||||
|
||||
|
||||
|
||||
$output .= "<script language=\"javascript\" type=\"text/javascript\">
|
||||
printClockAnalogic1('" . $time_format . "', '" . $timeOffset . "', '" . $clock_animation . "','" . $width . "','" . $height . "','" . $id_element . "','" . $color . "');
|
||||
</script>";
|
||||
|
||||
$timezone_short = explode("/", $timezone);
|
||||
$timezone_short_end = end($timezone_short);
|
||||
|
||||
$output .= '<div style="width:'.$date_width.'px;text-align:center;font-style:italic;font-size:12pt;color:'.$color.'">'.$timezone_short_end.'</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function print_clock_digital_1 ($time_format, $timezone, $clock_animation,$width,$height,$id_element,$color) {
|
||||
global $config;
|
||||
$output .= "<style type=\"text/css\">
|
||||
|
||||
#underlay_".$id_element." path,
|
||||
#underlay circle {
|
||||
fill: none;
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
#underlay_".$id_element." .lit {
|
||||
fill: ".$color.";
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
#overlay_".$id_element." path,
|
||||
#overlay_".$id_element." circle {
|
||||
fill: #f6f6f6;
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
#overlay_".$id_element." .lit {
|
||||
fill: ".$color.";
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
</style>";
|
||||
|
||||
$output .= include_javascript_d3(true);
|
||||
$tz = $timezone;
|
||||
$timestamp = time();
|
||||
$dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
|
||||
$dt->setTimestamp($timestamp); //adjust the object to correct timestamp
|
||||
|
||||
$dateTimeZoneOption = new DateTimeZone(date_default_timezone_get());
|
||||
$dateTimeZonePandora = new DateTimeZone($timezone);
|
||||
|
||||
$dateTimeOption = new DateTime("now", $dateTimeZoneOption);
|
||||
$dateTimePandora = new DateTime("now", $dateTimeZonePandora);
|
||||
|
||||
$timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption);
|
||||
|
||||
$output .= include_javascript_d3(true);
|
||||
|
||||
if($width == 0){
|
||||
$date_width = 200;
|
||||
}
|
||||
else{
|
||||
$date_width = $width;
|
||||
}
|
||||
|
||||
if($time_format == 'timedate'){
|
||||
$output .= '<div style="width:'.$date_width.'px;text-align:center;font-style:italic;font-size:12pt;color:'.$color.'">';
|
||||
$output .= $dt->format('d / m / Y').'</div>';
|
||||
}
|
||||
|
||||
$output .=
|
||||
|
||||
'
|
||||
|
||||
<svg width="'.$date_width.'" height="'.($date_width/3.9).'" viewBox="0 0 375 96">
|
||||
<g transform="translate(17,0)">
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M10,8L14,4L42,4L46,8L42,12L14,12L10,8z"/>
|
||||
<path d="M8,10L12,14L12,42L8,46L4,42L4,14L8,10z"/>
|
||||
<path d="M48,10L52,14L52,42L48,46L44,42L44,14L48,10z"/>
|
||||
<path d="M10,48L14,44L42,44L46,48L42,52L14,52L10,48z"/>
|
||||
<path d="M8,50L12,54L12,82L8,86L4,82L4,54L8,50z"/>
|
||||
<path d="M48,50L52,54L52,82L48,86L44,82L44,54L48,50z"/>
|
||||
<path d="M10,88L14,84L42,84L46,88L42,92L14,92L10,88z"/>
|
||||
</g>
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M66,8L70,4L98,4L102,8L98,12L70,12L66,8z"/>
|
||||
<path d="M64,10L68,14L68,42L64,46L60,42L60,14L64,10z"/>
|
||||
<path d="M104,10L108,14L108,42L104,46L100,42L100,14L104,10z"/>
|
||||
<path d="M66,48L70,44L98,44L102,48L98,52L70,52L66,48z"/>
|
||||
<path d="M64,50L68,54L68,82L64,86L60,82L60,54L64,50z"/>
|
||||
<path d="M104,50L108,54L108,82L104,86L100,82L100,54L104,50z"/>
|
||||
<path d="M66,88L70,84L98,84L102,88L98,92L70,92L66,88z"/>
|
||||
</g>
|
||||
<g class="separator">
|
||||
<circle r="4" cx="112" cy="28"/>
|
||||
<circle r="4" cx="103.5" cy="68"/>
|
||||
</g>
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M134,8L138,4L166,4L170,8L166,12L138,12L134,8z"/>
|
||||
<path d="M132,10L136,14L136,42L132,46L128,42L128,14L132,10z"/>
|
||||
<path d="M172,10L176,14L176,42L172,46L168,42L168,14L172,10z"/>
|
||||
<path d="M134,48L138,44L166,44L170,48L166,52L138,52L134,48z"/>
|
||||
<path d="M132,50L136,54L136,82L132,86L128,82L128,54L132,50z"/>
|
||||
<path d="M172,50L176,54L176,82L172,86L168,82L168,54L172,50z"/>
|
||||
<path d="M134,88L138,84L166,84L170,88L166,92L138,92L134,88z"/>
|
||||
</g>
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M190,8L194,4L222,4L226,8L222,12L194,12L190,8z"/>
|
||||
<path d="M188,10L192,14L192,42L188,46L184,42L184,14L188,10z"/>
|
||||
<path d="M228,10L232,14L232,42L228,46L224,42L224,14L228,10z"/>
|
||||
<path d="M190,48L194,44L222,44L226,48L222,52L194,52L190,48z"/>
|
||||
<path d="M188,50L192,54L192,82L188,86L184,82L184,54L188,50z"/>
|
||||
<path d="M228,50L232,54L232,82L228,86L224,82L224,54L228,50z"/>
|
||||
<path d="M190,88L194,84L222,84L226,88L222,92L194,92L190,88z"/>
|
||||
</g>
|
||||
<g class="separator">
|
||||
<circle r="4" cx="236" cy="28"/>
|
||||
<circle r="4" cx="227.5" cy="68"/>
|
||||
</g>
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M258,8L262,4L290,4L294,8L290,12L262,12L258,8z"/>
|
||||
<path d="M256,10L260,14L260,42L256,46L252,42L252,14L256,10z"/>
|
||||
<path d="M296,10L300,14L300,42L296,46L292,42L292,14L296,10z"/>
|
||||
<path d="M258,48L262,44L290,44L294,48L290,52L262,52L258,48z"/>
|
||||
<path d="M256,50L260,54L260,82L256,86L252,82L252,54L256,50z"/>
|
||||
<path d="M296,50L300,54L300,82L296,86L292,82L292,54L296,50z"/>
|
||||
<path d="M258,88L262,84L290,84L294,88L290,92L262,92L258,88z"/>
|
||||
</g>
|
||||
<g class="digit" transform="skewX(-12)">
|
||||
<path d="M314,8L318,4L346,4L350,8L346,12L318,12L314,8z"/>
|
||||
<path d="M312,10L316,14L316,42L312,46L308,42L308,14L312,10z"/>
|
||||
<path d="M352,10L356,14L356,42L352,46L348,42L348,14L352,10z"/>
|
||||
<path d="M314,48L318,44L346,44L350,48L346,52L318,52L314,48z"/>
|
||||
<path d="M312,50L316,54L316,82L312,86L308,82L308,54L312,50z"/>
|
||||
<path d="M352,50L356,54L356,82L352,86L348,82L348,54L352,50z"/>
|
||||
<path d="M314,88L318,84L346,84L350,88L346,92L318,92L314,88z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
';
|
||||
|
||||
|
||||
|
||||
$output .= "<script language=\"javascript\" type=\"text/javascript\">
|
||||
printClockDigital1('" . $time_format . "', '" . $timeOffset . "', '" . $clock_animation . "','" . $width . "','" . $height . "','" . $id_element . "','" . $color . "');
|
||||
</script>";
|
||||
|
||||
$timezone_short = explode("/", $timezone);
|
||||
$timezone_short_end = end($timezone_short);
|
||||
|
||||
$output .= '<div style="width:'.$date_width.'px;text-align:center;font-style:italic;font-size:12pt;color:'.$color.'">'.$timezone_short_end.'</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -2090,3 +2090,253 @@ function print_donut_graph (recipient, width, height, module_data, resume_color)
|
||||
slice.exit().remove();
|
||||
}
|
||||
}
|
||||
|
||||
function printClockAnalogic1 (time_format, timezone, clock_animation,width,height,id_element,color) {
|
||||
|
||||
if(width != 0){
|
||||
width = width-20;
|
||||
height = width-20;
|
||||
}
|
||||
|
||||
|
||||
if(width == 0){
|
||||
width = 180;
|
||||
height = 180;
|
||||
}
|
||||
|
||||
var radians = 0.0174532925,
|
||||
clockRadius = width/2,
|
||||
margin = 10,
|
||||
width = (clockRadius+margin)*2,
|
||||
height = (clockRadius+margin)*2,
|
||||
hourHandLength = 2*clockRadius/3,
|
||||
minuteHandLength = clockRadius,
|
||||
secondHandLength = clockRadius-12,
|
||||
secondHandBalance = 30,
|
||||
secondTickStart = clockRadius;
|
||||
secondTickLength = -10,
|
||||
hourTickStart = clockRadius,
|
||||
hourTickLength = -18,
|
||||
secondLabelRadius = clockRadius + 16,
|
||||
secondLabelYOffset = 5,
|
||||
hourLabelRadius = clockRadius - 40,
|
||||
hourLabelYOffset = 7;
|
||||
|
||||
var hourScale = d3.scale.linear()
|
||||
.range([0,330])
|
||||
.domain([0,11]);
|
||||
|
||||
var minuteScale = secondScale = d3.scale.linear()
|
||||
.range([0,354])
|
||||
.domain([0,59]);
|
||||
|
||||
var handData = [
|
||||
{
|
||||
type:'hour',
|
||||
value:0,
|
||||
length:-hourHandLength,
|
||||
scale:hourScale
|
||||
},
|
||||
{
|
||||
type:'minute',
|
||||
value:0,
|
||||
length:-minuteHandLength,
|
||||
scale:minuteScale
|
||||
},
|
||||
{
|
||||
type:'second',
|
||||
value:0,
|
||||
length:-secondHandLength,
|
||||
scale:secondScale,
|
||||
balance:secondHandBalance
|
||||
}
|
||||
];
|
||||
|
||||
function drawClock(){ //create all the clock elements
|
||||
updateData(timezone); //draw them in the correct starting position
|
||||
var svg = d3.select("#clock_"+id_element).append("svg")
|
||||
.attr("width", width)
|
||||
.attr("height", height);
|
||||
|
||||
var face = svg.append('g')
|
||||
.attr('id','clock-face')
|
||||
.attr('transform','translate(' + (clockRadius + margin) + ',' + (clockRadius + margin) + ')');
|
||||
|
||||
//add marks for seconds
|
||||
face.selectAll('.second-tick')
|
||||
.data(d3.range(0,60)).enter()
|
||||
.append('line')
|
||||
.attr('class', 'second-tick')
|
||||
.attr('x1',0)
|
||||
.attr('x2',0)
|
||||
.attr('y1',secondTickStart)
|
||||
.attr('y2',secondTickStart + secondTickLength)
|
||||
.attr('stroke',color)
|
||||
.attr('transform',function(d){
|
||||
return 'rotate(' + secondScale(d) + ')';
|
||||
});
|
||||
//and labels
|
||||
|
||||
// face.selectAll('.second-label')
|
||||
// .data(d3.range(5,61,5))
|
||||
// .enter()
|
||||
// .append('text')
|
||||
// .attr('class', 'second-label')
|
||||
// .attr('text-anchor','middle')
|
||||
// .attr('x',function(d){
|
||||
// return secondLabelRadius*Math.sin(secondScale(d)*radians);
|
||||
// })
|
||||
// .attr('y',function(d){
|
||||
// return -secondLabelRadius*Math.cos(secondScale(d)*radians) + secondLabelYOffset;
|
||||
// })
|
||||
// .text(function(d){
|
||||
// return d;
|
||||
// });
|
||||
|
||||
//... and hours
|
||||
face.selectAll('.hour-tick')
|
||||
.data(d3.range(0,12)).enter()
|
||||
.append('line')
|
||||
.attr('class', 'hour-tick')
|
||||
.attr('x1',0)
|
||||
.attr('x2',0)
|
||||
.attr('y1',hourTickStart)
|
||||
.attr('y2',hourTickStart + hourTickLength)
|
||||
.attr('stroke',color)
|
||||
.attr('transform',function(d){
|
||||
return 'rotate(' + hourScale(d) + ')';
|
||||
});
|
||||
|
||||
face.selectAll('.hour-label')
|
||||
.data(d3.range(3,13,3))
|
||||
.enter()
|
||||
.append('text')
|
||||
.attr('class', 'hour-label')
|
||||
.attr('text-anchor','middle')
|
||||
.attr('stroke',color)
|
||||
.attr('x',function(d){
|
||||
return hourLabelRadius*Math.sin(hourScale(d)*radians);
|
||||
})
|
||||
.attr('y',function(d){
|
||||
return -hourLabelRadius*Math.cos(hourScale(d)*radians) + hourLabelYOffset;
|
||||
})
|
||||
.text(function(d){
|
||||
return d;
|
||||
});
|
||||
|
||||
|
||||
var hands = face.append('g').attr('id','clock-hands');
|
||||
|
||||
face.append('g').attr('id','face-overlay')
|
||||
.append('circle').attr('class','hands-cover')
|
||||
.attr('stroke',color)
|
||||
.attr('x',0)
|
||||
.attr('y',0)
|
||||
.attr('r',clockRadius/20);
|
||||
|
||||
hands.selectAll('line')
|
||||
.data(handData)
|
||||
.enter()
|
||||
.append('line')
|
||||
.attr('stroke',color)
|
||||
.attr('class', function(d){
|
||||
return d.type + '-hand';
|
||||
})
|
||||
.attr('x1',0)
|
||||
.attr('y1',function(d){
|
||||
return d.balance ? d.balance : 0;
|
||||
})
|
||||
.attr('x2',0)
|
||||
.attr('y2',function(d){
|
||||
return d.length;
|
||||
})
|
||||
.attr('transform',function(d){
|
||||
return 'rotate('+ d.scale(d.value) +')';
|
||||
});
|
||||
}
|
||||
|
||||
function moveHands(){
|
||||
d3.select("#clock_"+id_element+' #clock-hands').selectAll('line')
|
||||
.data(handData)
|
||||
.transition()
|
||||
.attr('transform',function(d){
|
||||
return 'rotate('+ d.scale(d.value) +')';
|
||||
});
|
||||
}
|
||||
|
||||
function updateData(tz){
|
||||
|
||||
var d = new Date();
|
||||
var dt = d.getTime();
|
||||
os = d.getTimezoneOffset();
|
||||
tz = parseInt(tz) + parseInt(os * 60);
|
||||
var t = new Date((dt + (tz * 1000)));
|
||||
|
||||
handData[0].value = (t.getHours() % 12) + t.getMinutes()/60 ;
|
||||
handData[1].value = t.getMinutes();
|
||||
handData[2].value = t.getSeconds();
|
||||
}
|
||||
|
||||
drawClock();
|
||||
|
||||
setInterval(function(){
|
||||
updateData(timezone);
|
||||
moveHands();
|
||||
}, 1000);
|
||||
|
||||
d3.select(self.frameElement).style("height", height + "px");
|
||||
|
||||
$('#clock_'+id_element).css('margin-top','0');
|
||||
|
||||
}
|
||||
|
||||
function printClockDigital1 (time_format, timezone, clock_animation,width,height,id_element,color) {
|
||||
|
||||
var svgUnderlay = d3.select("#clock_"+id_element+" svg"),
|
||||
svgOverlay = d3.select("#clock_"+id_element),
|
||||
svg = d3.selectAll("#clock_"+id_element+" svg");
|
||||
|
||||
svgUnderlay.attr("id", "underlay_"+id_element);
|
||||
svgOverlay.attr("id", "overlay_"+id_element);
|
||||
|
||||
var digit = svg.selectAll(".digit"),
|
||||
separator = svg.selectAll(".separator circle");
|
||||
|
||||
var digitPattern = [
|
||||
[1,0,1,1,0,1,1,1,1,1],
|
||||
[1,0,0,0,1,1,1,0,1,1],
|
||||
[1,1,1,1,1,0,0,1,1,1],
|
||||
[0,0,1,1,1,1,1,0,1,1],
|
||||
[1,0,1,0,0,0,1,0,1,0],
|
||||
[1,1,0,1,1,1,1,1,1,1],
|
||||
[1,0,1,1,0,1,1,0,1,1]
|
||||
];
|
||||
|
||||
(function tick() {
|
||||
|
||||
var tz = timezone;
|
||||
var d = new Date();
|
||||
var dt = d.getTime();
|
||||
os = d.getTimezoneOffset();
|
||||
tz = parseInt(tz) + parseInt(os * 60);
|
||||
var t = new Date((dt + (tz * 1000)));
|
||||
|
||||
var now = new Date,
|
||||
hours = t.getHours(),
|
||||
minutes = t.getMinutes(),
|
||||
seconds = t.getSeconds();
|
||||
|
||||
digit = digit.data([hours / 10 | 0, hours % 10, minutes / 10 | 0, minutes % 10, seconds / 10 | 0, seconds % 10]);
|
||||
digit.select("path:nth-child(1)").classed("lit", function(d) { return digitPattern[0][d]; });
|
||||
digit.select("path:nth-child(2)").classed("lit", function(d) { return digitPattern[1][d]; });
|
||||
digit.select("path:nth-child(3)").classed("lit", function(d) { return digitPattern[2][d]; });
|
||||
digit.select("path:nth-child(4)").classed("lit", function(d) { return digitPattern[3][d]; });
|
||||
digit.select("path:nth-child(5)").classed("lit", function(d) { return digitPattern[4][d]; });
|
||||
digit.select("path:nth-child(6)").classed("lit", function(d) { return digitPattern[5][d]; });
|
||||
digit.select("path:nth-child(7)").classed("lit", function(d) { return digitPattern[6][d]; });
|
||||
separator.classed("lit", seconds & 1);
|
||||
|
||||
setTimeout(tick, 1000 - now % 1000);
|
||||
})();
|
||||
|
||||
}
|
@ -61,6 +61,17 @@ Besides the defined module macros, the following macros are available:
|
||||
<li>_modulegraphth_nh_:Same operation as the previous macro only with the critical and warning thresholds of the module provided they are defined.</li>
|
||||
<li>_modulegroup_: Module’s group name.</li>
|
||||
<li>_modulestatus_: Module status.</li>
|
||||
<li>_moduledata_X_: Last data of module X (module name, cannot have white spaces).</li>
|
||||
<li>_alert_name_: Alert name.</li>
|
||||
<li>_alert_priority_: Alert’s numeric priority.</li>
|
||||
<li>_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).</li>
|
||||
<li>_event_text_severity_: (Only event alerts) Text event (which triggered the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
|
||||
<li>_event_description_: (Only event alerts) The textual description of the Pandora FMS event.</li>
|
||||
<li>_id_agent_: Agent’s ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.</li>
|
||||
<li>_id_group_ : Agent group ID.</li>
|
||||
<li>_id_module_ : ID of module.</li>
|
||||
<li>_id_alert_: Alert’s numeric ID (unique), used to correlate the alert with third party software.</li>
|
||||
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
|
||||
<li>_name_tag_: Names of the tags related to the module.</li>
|
||||
<li>_phone_tag_: Phone numbers related to the module’s tags.</li>
|
||||
|
@ -4,13 +4,17 @@
|
||||
*/
|
||||
?>
|
||||
<h1>Module definition</h1>
|
||||
<p>
|
||||
There are three modes for an agent:
|
||||
</p>
|
||||
<p>Agents can be configured from the console in three working modes:</p>
|
||||
<ul>
|
||||
<li><i>Learning mode:</i> All the modules sent by the agent are accepted. If modules are not defined, they will be automatically defined by the system. It is recommended to activate the agents in this mode and change it once the user is familiar with Pandora FMS.<br>From version 4.0.3, in this mode, Pandora console collect all the configuration specified by the agent configuration file the first time and thereafter any changes should be made through console, will not catch changes in config file.</li>
|
||||
<li>
|
||||
<b>Learning mode:</b> If the XML received from the software agent contains new modules, they will be automatically created. This is the default behavior.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>Normal mode:</i> The modules in this mode must be configured manually. The self definition of the modules is not allowed in this mode.</li>
|
||||
<li>
|
||||
<b>Normal mode:</b> No new modules will be created that arrive in XML if they have not been previously declared in the console.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>Autodisable mode:</i> It behaves exactly the same as an agent in learning mode: when the first XML reaches it, the first agent is created and, on each report, if there are new modules they can also be added automatically. Nevertheless, when all modules from an agent that are in autodisable mode are also marked as unknown, the agent is automatically disabled. In any case, if the agent reports again, it gets enabled again on its own.</li>
|
||||
<li>
|
||||
<b>Autodisable mode:</b> Similar to learning mode, in this mode, also, if all modules pass to unknown state the agent will be automatically disabled, going to be enabled again if it receives new information.
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -9,6 +9,68 @@
|
||||
Además de las macros de módulo definidas, las siguientes macros están disponibles:
|
||||
</p>
|
||||
<ul>
|
||||
<li>_field1_: Campo 1 definido por el usuario.</li>
|
||||
<li>_field2_: Campo 2 definido por el usuario.</li>
|
||||
<li>_field3_: Campo 3 definido por el usuario.</li>
|
||||
<li>_field4_: Campo 4 definido por el usuario.</li>
|
||||
<li>_field5_: Campo 5 definido por el usuario.</li>
|
||||
<li>_field6_: Campo 6 definido por el usuario.</li>
|
||||
<li>_field7_: Campo 7 definido por el usuario.</li>
|
||||
<li>_field8_: Campo 8 definido por el usuario.</li>
|
||||
<li>_field9_: Campo 9 definido por el usuario.</li>
|
||||
<li>_field10_: Campo 10 definido por el usuario.</li>
|
||||
<li>_agent_: Nombre del agente que disparó la alerta.</li>
|
||||
<li>_agentcustomfield_<i>n</i>_: Campo personalizado número <i>n</i> del agente (eg. _agentcustomfield_9_). </li>
|
||||
<li>_agentcustomid_: ID personalizado del agente. </li>
|
||||
<li>_agentdescription_: Descripción del agente que disparó la alerta.</li>
|
||||
<li>_agentgroup_: Nombre del grupo del agente.</li>
|
||||
<li>_agentstatus_: Estado actual del agente.</li>
|
||||
<li>_agentos_: Sistema operativo del agente.</li>
|
||||
<li>_address_: Dirección del agente que disparó la alerta.</li>
|
||||
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
|
||||
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
|
||||
<li>_data_: Dato que hizo que la alerta se disparase.</li>
|
||||
<li>_prevdata_: Dato previo antes de disparase la alerta.</li>
|
||||
<li>_alert_description_: Descripción de la alerta.</li>
|
||||
<li>_alert_threshold_: Umbral de la alerta.</li>
|
||||
<li>_alert_times_fired_: Número de veces que se ha disparado la alerta.</li>
|
||||
<li>_module_: Nombre del módulo.</li>
|
||||
<li>_modulecustomid_: ID personalizado del módulo.</li>
|
||||
<li>_modulegroup_: Nombre del grupo del módulo.</li>
|
||||
<li>_moduledescription_: Descripcion del modulo.</li>
|
||||
<li>_modulestatus_: Estado del módulo.</li>
|
||||
<li>_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).</li>
|
||||
<li>_alert_name_: Nombre de la alerta.</li>
|
||||
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
|
||||
<li>_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_eventt_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
|
||||
<li>_event_description_: (Sólo en alertas de evento) la descripción textual del evento que disparó la alerta.</li>
|
||||
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
|
||||
<li>_id_group_ : Id del grupo de agente.</li>
|
||||
<li>_id_module_ : ID del módulo.</li>
|
||||
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
|
||||
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
|
||||
<li>_interval_: Intervalo de la ejecución del módulo. </li>
|
||||
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
|
||||
<li>_target_port_: Puerto del objetivo del módulo.</li>
|
||||
<li>_plugin_parameters_: Parámetros del plugin del módulo.</li>
|
||||
<li>_server_ip_ : Ip del servidor al que el agente está asignado. </li>
|
||||
<li>_server_name_ : Nombre del servidor al que el agente está asignado. </li>
|
||||
<li>_groupcontact_: Información de contacto del grupo. Se configura al crear el grupo.</li>
|
||||
<li>_groupcustomid_: ID personalizado del grupo.</li>
|
||||
<li>_groupother_: Otra información sobre el grupo. Se configura al crear el grupo.</li>
|
||||
<li>_name_tag_: Nombre de los tags asociados al módulo.</li>
|
||||
<li>_email_tag_: Emails asociados a los tags de módulos.</li>
|
||||
<li>_phone_tag_: Teléfonos asociados a los tags de módulos.</li>
|
||||
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
|
||||
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
|
||||
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
|
||||
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
|
||||
<li>_modulegraph_<i>n</i>h_: (>=6.0) (Solo para alertas que usen el comando <i>eMail</i>)
|
||||
Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de <i>n</i> horas (eg. _modulegraph_24h_).
|
||||
Requiere de una configuración correcta de la conexión del servidor a la consola vía api,
|
||||
la cual se realiza en el fichero de configuración del servidor.</li>
|
||||
|
||||
<li>_address_: Dirección del agente que disparó la alerta.</li>
|
||||
<li>_address_n_ : La dirección del agente que corresponde a la posicion indicada en "n" ejemplo: address_1_ , address_2_</li>
|
||||
@ -74,7 +136,6 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
|
||||
<li>_target_port_: Puerto del objetivo del módulo.</li>
|
||||
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
|
||||
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
@ -4,14 +4,17 @@
|
||||
*/
|
||||
?>
|
||||
<h1>Definición de módulo</h1>
|
||||
|
||||
<p>
|
||||
Existen tres modos para un agente:
|
||||
</p>
|
||||
<p>Los agentes pueden configurarse desde la consola en tres modos de trabajo:</p>
|
||||
<ul>
|
||||
<li><i>Modo aprendizaje:</i>Si el XML recibido del agente software contiene nuevos módulos, éstos serán automáticamente creados. Este es el comportamiento por defecto.</li>
|
||||
<li>
|
||||
<b>Modo aprendizaje:</b> Si el XML recibido del agente software contiene nuevos módulos, éstos serán automáticamente creados. Este es el comportamiento por defecto.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>Modo normal:</i>No se crearán nuevos módulos que lleguen en el XML si no han sido declarados previamente en la consola.</li>
|
||||
<li>
|
||||
<b>Modo normal:</b> No se crearán nuevos módulos que lleguen en el XML si no han sido declarados previamente en la consola.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>Modo auto deshabilitado:</i>Similar al modo aprendizaje, en este modo, además, si todos los módulos pasan a estado desconocido el agente se deshabilitará automáticamente, pasando a habilitarse de nuevo si recibe nueva información.</li>
|
||||
<li>
|
||||
<b>Modo autodeshabilitado:</b> Similar al modo aprendizaje, en este modo, además, si todos los módulos pasan a estado desconocido el agente se deshabilitará automáticamente, pasando a habilitarse de nuevo si recibe nueva información.
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -45,6 +45,7 @@
|
||||
<li>_alert_text_severity_ : テキストでのアラートの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
|
||||
<li>_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
|
||||
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
|
||||
<li>_event_description_: (イベントアラートのみ) Pandora FMS イベントの説明 です。</li>
|
||||
<li>_event_extra_id_: (Only event alerts) Extra id.</li>
|
||||
<li>_event_cfX_ : (Only event alerts) Key of the event custom field that fired the alert.</li>
|
||||
<li>_id_agent_ : エージェントのID / Webコンソールへのリンクを生成するのに便利です</li>
|
||||
|
@ -4,13 +4,17 @@
|
||||
*/
|
||||
?>
|
||||
<h1>モジュール定義</h1>
|
||||
|
||||
エージェントには、次の2つのモードがあります:
|
||||
<p>Agents can be configured from the console in three working modes:</p>
|
||||
<ul>
|
||||
<li><i>学習モード:</i> エージェントから通知されるモジュール情報を受け取ります。モジュールが定義されていない場合は自動的にそれが追加されます。エージェントの設定でこのモードを有効にすることをお勧めします。Pandora FMS が使いやすいです。<br>バージョン 4.0.3 からは、このモードの場合、コンソールが初回はエージェント設定ファイルの全設定内容を読み込みますが、その後はコンソールから変更可能で設定ファイル側の変更は反映されません。
|
||||
<li>
|
||||
<b>Learning mode:</b> If the XML received from the software agent contains new modules, they will be automatically created. This is the default behavior.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>通常モード:</i> このモードでは、モジュール設定を手動で実施する必要があります。自動設定は行われません。</li>
|
||||
<li>
|
||||
<b>Normal mode:</b> No new modules will be created that arrive in XML if they have not been previously declared in the console.
|
||||
</li>
|
||||
<br>
|
||||
<li><i>Autodisable mode:</i> In terms of creating agents and modules it behaves exactly the same as an agent in learning mode: when the first XML reaches it, the first agent is created and, on each report, if there are new modules they can also be added automatically. Nevertheless, when all modules from an agent that are in autodisable mode are also marked as unknown, the agent is automatically disabled. In any case, if the agent reports again, it gets enabled again on its own.</li>
|
||||
<li>
|
||||
<b>Autodisable mode:</b> Similar to learning mode, in this mode, also, if all modules pass to unknown state the agent will be automatically disabled, going to be enabled again if it receives new information.
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -2078,10 +2078,16 @@ function add_interface_link_js() {
|
||||
success: function (data) {
|
||||
if (data['correct']) {
|
||||
var temp_link = {};
|
||||
temp_link['status_start'] = "0";
|
||||
temp_link['status_end'] = "0";
|
||||
|
||||
temp_link['id_db'] = data['id_db_link'];
|
||||
|
||||
if (data['type_source'] == 1) {
|
||||
temp_link['arrow_start'] = "module";
|
||||
temp_link['id_module_start'] = source_value;
|
||||
temp_link["status_start"] = data['status'];
|
||||
temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
|
||||
}
|
||||
else {
|
||||
temp_link['arrow_start'] = "";
|
||||
@ -2091,15 +2097,14 @@ function add_interface_link_js() {
|
||||
if (data['type_target'] == 1) {
|
||||
temp_link['arrow_end'] = "module";
|
||||
temp_link['id_module_end'] = target_value;
|
||||
temp_link["status_end"] = data['status'];
|
||||
temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
|
||||
}
|
||||
else {
|
||||
temp_link['arrow_end'] = "";
|
||||
temp_link['id_agent_end'] = target_value;
|
||||
temp_link['id_module_end'] = 0;
|
||||
}
|
||||
temp_link['status_start'] = "0";
|
||||
temp_link['status_end'] = "0";
|
||||
|
||||
|
||||
temp_link['text_start'] = data['text_start'];
|
||||
temp_link['text_end'] = data['text_end'];
|
||||
|
@ -7,6 +7,18 @@
|
||||
background-color: #ececec;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
}
|
||||
div.new_task_cluster
|
||||
{
|
||||
margin-top: 30px;
|
||||
left: 20px;
|
||||
width: 60%;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
}
|
||||
|
||||
div.new_task_cluster, div.new_task_cluster > div
|
||||
{
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.title_task
|
||||
{
|
||||
@ -24,6 +36,14 @@
|
||||
height:100%;
|
||||
float:left;
|
||||
}
|
||||
.image_task_cluster
|
||||
{
|
||||
width:20%;
|
||||
height:100%;
|
||||
float:left;
|
||||
margin-left: 50px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
.image_task>img {
|
||||
margin-top: 35%;
|
||||
margin-left: 15%;
|
||||
@ -36,6 +56,14 @@
|
||||
height: 100%;
|
||||
padding-right: 25px;
|
||||
}
|
||||
.text_task_cluster
|
||||
{
|
||||
width: 70%;
|
||||
height: 100%;
|
||||
padding-right: 25px;
|
||||
margin-left:270px;
|
||||
padding-top:10px;
|
||||
}
|
||||
.text_task>p
|
||||
{
|
||||
margin-top: 4%;
|
||||
|
@ -829,6 +829,12 @@ input.icon_min {
|
||||
input.icon_min[disabled] {
|
||||
background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important;
|
||||
}
|
||||
input.clock_min {
|
||||
background: #fefefe url(../../images/clock-tab.png) no-repeat center !important;
|
||||
}
|
||||
input.clock_min[disabled] {
|
||||
background: #fefefe url(../../images/clock-tab.disabled.png) no-repeat center !important;
|
||||
}
|
||||
input.box_item {
|
||||
background: #fefefe url(../../images/box_item.png) no-repeat center !important;
|
||||
}
|
||||
@ -4233,7 +4239,7 @@ div#footer_help{
|
||||
left: 90% !important;
|
||||
}
|
||||
|
||||
.graph_conteiner_inside > .parent_graph > .noresizevc{
|
||||
.graph_conteiner_inside > .parent_graph > .graph{
|
||||
width: 90% !important;
|
||||
}
|
||||
|
||||
@ -4369,8 +4375,14 @@ div#footer_help{
|
||||
.route {
|
||||
fill: none;
|
||||
transition: all 2s ease-in-out;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
}
|
||||
|
||||
.limit_scroll{
|
||||
max-width: 800px;
|
||||
overflow-x:scroll;
|
||||
}
|
||||
#is_favourite ul.container{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@ -4451,3 +4463,12 @@ form ul.form_flex li ul li{
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#modal_module_popup_close:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal_module_list:hover{
|
||||
cursor: pointer;
|
||||
>>>>>>> develop
|
||||
}
|
@ -475,7 +475,18 @@ if (! isset ($config['id_user'])) {
|
||||
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $nick_in_db;
|
||||
$config['id_user'] = $nick_in_db;
|
||||
|
||||
// Check if connection goes through F5 balancer. If it does, then don't call config_prepare_session() or user will be back to login all the time
|
||||
$prepare_session = true;
|
||||
foreach ($_COOKIE as $key=>$value) {
|
||||
if (preg_match('/BIGipServer*/',$key) ) {
|
||||
$prepare_session = false;
|
||||
}
|
||||
}
|
||||
if ($prepare_session){
|
||||
config_prepare_session();
|
||||
}
|
||||
|
||||
if (is_user_admin($config['id_user'])) {
|
||||
// PHP configuration values
|
||||
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
|
||||
|
@ -71,7 +71,7 @@
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.718';
|
||||
$build = '180131';
|
||||
$build = '180210';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
@ -172,7 +172,7 @@ switch ($action) {
|
||||
if ($user->isWaitingDoubleAuth()) {
|
||||
if ($user->validateDoubleAuthCode()) {
|
||||
// Logged. Refresh the page
|
||||
header('Refresh:0');
|
||||
header('Location: .');
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@ -181,7 +181,7 @@ switch ($action) {
|
||||
}
|
||||
else {
|
||||
// Logged. Refresh the page
|
||||
header('Refresh:0');
|
||||
header('Location: .');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,8 @@ if (!empty($sub2)) {
|
||||
$sub["snmpconsole"]["subtype"] = "nolink";
|
||||
}
|
||||
|
||||
enterprise_hook ('cluster_menu');
|
||||
|
||||
if (!empty($sub)) {
|
||||
$menu_operation["estado"]["text"] = __('Monitoring');
|
||||
$menu_operation["estado"]["sec2"] = "operation/agentes/tactical";
|
||||
|
@ -382,6 +382,7 @@ $autorefresh_list_out['operation/snmpconsole/snmp_view'] = "snmp_view";
|
||||
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = "networkmap";
|
||||
$autorefresh_list_out['operation/visual_console/render_view'] = "render_view";
|
||||
$autorefresh_list_out['operation/events/events'] = "events";
|
||||
$autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = "cluster_view";
|
||||
|
||||
if(!isset($autorefresh_list)){
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
|
@ -241,7 +241,12 @@ $ignored_params['refr'] = '';
|
||||
|
||||
$('.item > div').each( function() {
|
||||
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');
|
||||
}
|
||||
else{
|
||||
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
|
||||
}
|
||||
$(this).css('margin-left','');
|
||||
}
|
||||
else {
|
||||
|
@ -206,17 +206,18 @@ $ignored_params['refr'] = '';
|
||||
|
||||
$('.item > div').each( function() {
|
||||
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');
|
||||
}
|
||||
else{
|
||||
$(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(){
|
||||
|
@ -312,7 +312,12 @@ $ignored_params['refr'] = '';
|
||||
|
||||
$('.item > div').each( function() {
|
||||
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');
|
||||
}
|
||||
else{
|
||||
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
|
||||
}
|
||||
$(this).css('margin-left','');
|
||||
}
|
||||
else {
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -605,6 +605,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
|
||||
`agent` varchar(100) NOT NULL default '',
|
||||
`module` varchar(100) NOT NULL default '',
|
||||
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
||||
`type_graph` tinyint(1) unsigned NOT NULL DEFAULT 0,
|
||||
`fullscale` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||
PRIMARY KEY(`id_ci`),
|
||||
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
||||
@ -1373,6 +1374,10 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
|
||||
`id_layout_linked_weight` int(10) NOT NULL default '0',
|
||||
`element_group` int(10) NOT NULL default '0',
|
||||
`show_on_top` tinyint(1) NOT NULL default '0',
|
||||
`clock_animation` varchar(60) NOT NULL default "analogic_1",
|
||||
`time_format` varchar(60) NOT NULL default "time",
|
||||
`timezone` varchar(60) NOT NULL default "Europe/Madrid",
|
||||
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
@ -3028,3 +3033,51 @@ CREATE TABLE IF NOT EXISTS `treset_pass` (
|
||||
`reset_time` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`cluster_type` enum('AA','AP') not null default 'AA',
|
||||
`description` text not null default '',
|
||||
`group` int(10) unsigned NOT NULL default '0',
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_item`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`item_type` enum('AA','AP') not null default 'AA',
|
||||
`critical_limit` int unsigned NOT NULL default '0',
|
||||
`warning_limit` int unsigned NOT NULL default '0',
|
||||
`is_critical` tinyint(2) unsigned NOT NULL default '0',
|
||||
`id_cluster` int unsigned,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_agent`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_agent`(
|
||||
`id_cluster` int unsigned not null,
|
||||
`id_agent` int(10) unsigned not null,
|
||||
PRIMARY KEY (`id_cluster`,`id_agent`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
||||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||
('custom_report_front_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
('MR', 11),
|
||||
('MR', 12),
|
||||
('identification_reminder', 1),
|
||||
('identification_reminder_timestamp', 0),
|
||||
('current_package_enterprise', '718'),
|
||||
('current_package_enterprise', '719'),
|
||||
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}');
|
||||
|
||||
UNLOCK TABLES;
|
||||
@ -141,7 +141,8 @@ INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
|
||||
(17, 'Router', 'Generic router', 'so_router.png'),
|
||||
(18, 'Switch', 'Generic switch', 'so_switch.png'),
|
||||
(19, 'Satellite', 'Satellite agent', 'satellite.png'),
|
||||
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png');
|
||||
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
|
||||
(21, 'Cluster', 'Cluster agent', 'so_cluster.png');
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.718-180131
|
||||
Version: 7.0NG.718-180210
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.718-180131"
|
||||
pandora_version="7.0NG.718-180210"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
@ -120,6 +120,7 @@ snmp_pdu_address 0
|
||||
#snmp_forward_privProtocol
|
||||
#snmp_forward_privPassword
|
||||
#snmp_forward_secLevel
|
||||
#snmp_forward_community
|
||||
|
||||
# Activate (1) Pandora Network Server
|
||||
|
||||
@ -622,6 +623,9 @@ syslog_max 65535
|
||||
# Sync timeout
|
||||
#sync_timeout 10
|
||||
|
||||
# Address
|
||||
# sync_address
|
||||
|
||||
# Target LogStash server, to allow Dataserver and SyslogServer store log information in ElasticSearch
|
||||
#logstash_host ip
|
||||
#logstash_port 10514
|
||||
|
@ -43,7 +43,7 @@ our @EXPORT = qw(
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.718";
|
||||
my $pandora_build = "180131";
|
||||
my $pandora_build = "180210";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -31,7 +31,7 @@ our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.718";
|
||||
my $pandora_build = "180131";
|
||||
my $pandora_build = "180210";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
@ -427,7 +427,14 @@ sub print_module {
|
||||
if (ref ($data->{value}) eq "ARRAY") {
|
||||
$xml_module .= "\t<datalist>\n";
|
||||
foreach (@{$data->{value}}) {
|
||||
$xml_module .= "\t<data><![CDATA[" . $data->{value} . "]]></data>\n";
|
||||
if ((ref($_) eq "HASH") && defined($_->{value})) {
|
||||
$xml_module .= "\t<data>\n";
|
||||
$xml_module .= "\t\t<value><![CDATA[" . $_->{value} . "]]></value>\n";
|
||||
if (defined($_->{timestamp})) {
|
||||
$xml_module .= "\t\t<timestamp><![CDATA[" . $_->{timestamp} . "]]></timestamp>\n";
|
||||
}
|
||||
$xml_module .= "\t</data>\n";
|
||||
}
|
||||
}
|
||||
$xml_module .= "\t</datalist>\n";
|
||||
}
|
||||
|
@ -196,6 +196,27 @@ sub exec_prediction_module ($$$$) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Cluster status module.
|
||||
if ($agent_module->{'prediction_module'} == 5) {
|
||||
logger ($pa_config, "Executing cluster status module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_status_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Cluster active-active module.
|
||||
if ($agent_module->{'prediction_module'} == 6) {
|
||||
logger ($pa_config, "Executing cluster active-active module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_aa_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Cluster active-passive module.
|
||||
if ($agent_module->{'prediction_module'} == 7) {
|
||||
logger ($pa_config, "Executing cluster active-passive module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_ap_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Get a full hash for target agent_module record reference ($target_module)
|
||||
my $target_module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $agent_module->{'custom_integer_1'});
|
||||
return unless defined $target_module;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.718
|
||||
%define release 180131
|
||||
%define release 180210
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.718"
|
||||
PI_BUILD="180131"
|
||||
PI_BUILD="180210"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -33,7 +33,7 @@ use PandoraFMS::Tools;
|
||||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.718 PS180131";
|
||||
my $version = "7.0NG.718 PS180210";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
||||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.718 PS180131";
|
||||
my $version = "7.0NG.718 PS180210";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|