Merge branch 'develop' into ent-11807-security-hardening-console-informes

This commit is contained in:
Daniel Cebrian 2023-09-07 13:55:48 +02:00
commit 39a44828fc
68 changed files with 2613 additions and 768 deletions

View File

@ -78,16 +78,16 @@ cd unix && ./pandora_agent_installer --install
}
install_autodiscover () {
local arch=$1
wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
unzip autodiscover-linux.zip
chmod +x $arch/autodiscover
mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
}
# install_autodiscover () {
# local arch=$1
# wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
# unzip autodiscover-linux.zip
# chmod +x $arch/autodiscover
# mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
# }
## Main
echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
echo "Starting PandoraFMS Agent binary deployment ver. $S_VERSION"
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
@ -104,8 +104,6 @@ OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
# initialice logfile
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
@ -126,6 +124,30 @@ check_repo_connection
execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
# Arch check
arch=$(uname -m)
case $arch in
x86_64)
echo -e "${cyan}Arch: $arch ${reset} "
;;
x86)
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
exit -1
;;
armv7l)
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
exit -1
;;
*)
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
exit -1
;;
esac
# Creating working directory
rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
@ -148,6 +170,10 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
# Check rh version
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
package_manager_cmd=dnf
execute_cmd "$package_manager_cmd install -y libnsl" "Installing dependencies"
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '9' ] ; then
package_manager_cmd=dnf
execute_cmd "$package_manager_cmd install -y libnsl libxcrypt-compat" "Installing dependencies"
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
package_manager_cmd=yum
@ -158,24 +184,23 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
# Insatall pandora agent
$package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
check_cmd_status 'Error installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm "
execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package'
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
fi
if [[ $OS_RELEASE == 'debian' ]]; then
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz'
execute_cmd "apt update" 'Updating repos'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package'
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
cd $HOME/pandora_deploy_tmp
fi
# Configuring Agente
[[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF
[[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF
[[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF
@ -187,27 +212,6 @@ fi
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
#installing autodiscover
arch=$(uname -m)
case $arch in
x86_64)
execute_cmd 'install_autodiscover x86_64' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
;;
x86)
execute_cmd 'install_autodiscover x84' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
;;
armv7l)
echo -e "${cyan}Skiping autodiscover installation arch $arch not suported${reset}"
;;
*)
echo -e "${yellow}Skiping autodiscover installation arch $arch not suported${reset}"
;;
esac
#Starting pandora agent daemon.
execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'

View File

@ -166,7 +166,7 @@ module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_max_critical 0
module_unit %
module_end

View File

@ -119,7 +119,7 @@ module_description CPU Load (%)
module_min_warning 80
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_max_critical 0
module_end
# Number processes

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230907
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -187,7 +187,7 @@ module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_max_critical 0
module_end
#Get load average

View File

@ -219,7 +219,7 @@ module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_max_critical 0
module_unit %
module_group System
module_end

View File

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230905
%define release 230907
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230905
%define release 230907
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230905
%define release 230907
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="230905"
PI_BUILD="230907"
OS_NAME=`uname -s`
FORCE=0

View File

@ -165,7 +165,7 @@ module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_max_critical 0
module_unit %
module_group System
module_end

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230905}
{230907}
ViewReadme
{Yes}

View File

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

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.773.3(Build 230905))"
VALUE "ProductVersion", "(7.0NG.773.3(Build 230907))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230907
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -22,6 +22,28 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
ALTER TABLE `tsesion_filter_log_viewer`
CHANGE COLUMN `date_range` `custom_date` INT NULL DEFAULT NULL ,
CHANGE COLUMN `start_date_defined` `date` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `start_date_time` `date_text` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `start_date_date` `date_units` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `start_date_date_range` `date_init` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `start_date_time_range` `time_init` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `end_date_date_range` `date_end` VARCHAR(45) NULL DEFAULT NULL ,
CHANGE COLUMN `end_date_time_range` `time_end` VARCHAR(45) NULL DEFAULT NULL ;
ALTER TABLE `tsesion_filter`
CHANGE COLUMN `period` `date_text` VARCHAR(45) NULL DEFAULT NULL AFTER `user`;
ALTER TABLE `tsesion_filter`
ADD COLUMN `custom_date` INT NULL AFTER `user`,
ADD COLUMN `date` VARCHAR(45) NULL AFTER `custom_date`,
ADD COLUMN `date_units` VARCHAR(45) NULL AFTER `date_text`,
ADD COLUMN `date_init` VARCHAR(45) NULL AFTER `date_units`,
ADD COLUMN `time_init` VARCHAR(45) NULL AFTER `date_init`,
ADD COLUMN `date_end` VARCHAR(45) NULL AFTER `time_init`,
ADD COLUMN `time_end` VARCHAR(45) NULL AFTER `date_end`;
ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;

View File

@ -1475,13 +1475,13 @@ if ($update_module === true || $create_module === true) {
$plugin_pass = io_input_password(
(string) get_parameter('snmp3_auth_pass')
);
$plugin_parameter = (string) get_parameter('snmp3_auth_method');
$plugin_parameter = (string) get_parameter('snmp3_auth_method', 'MD5');
$custom_string_1 = (string) get_parameter('snmp3_privacy_method');
$custom_string_1 = (string) get_parameter('snmp3_privacy_method', 'DES');
$custom_string_2 = io_input_password(
(string) get_parameter('snmp3_privacy_pass')
);
$custom_string_3 = (string) get_parameter('snmp3_security_level');
$custom_string_3 = (string) get_parameter('snmp3_security_level', 'noAuthNoPriv');
} else if ($id_module_type >= 34 && $id_module_type <= 37) {
$tcp_send = (string) get_parameter('command_text');
$custom_string_1 = (string) get_parameter(

View File

@ -459,10 +459,10 @@ if ($id_agent_module) {
$snmp_version = 1;
$snmp3_auth_user = '';
$snmp3_auth_pass = '';
$snmp3_auth_method = '';
$snmp3_privacy_method = '';
$snmp3_auth_method = 'MD5';
$snmp3_privacy_method = 'DES';
$snmp3_privacy_pass = '';
$snmp3_security_level = '';
$snmp3_security_level = 'noAuthNoPriv';
// For Remote CMD.
$command_text = '';

View File

@ -405,7 +405,22 @@ push_table_simple($data, 'field_snmpv3_row1');
$data = [];
$data[0] = __('Privacy method');
$data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
$data[1] = html_print_select(
[
'DES' => __('DES'),
'AES' => __('AES'),
],
'snmp3_privacy_method',
$snmp3_privacy_method,
'',
'',
'',
true,
false,
false,
'',
$disabledBecauseInPolicy
);
$data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
$data[3] = html_print_input_password(
'snmp3_privacy_pass',

View File

@ -97,7 +97,7 @@ if (is_ajax()) {
if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) {
if (($i > 5) && ($command['id'] === 3)) {
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
($i - 1)
@ -118,7 +118,7 @@ if (is_ajax()) {
}
} else {
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
if (($i > 5) && ($command['id'] == 3)) {
if (($i > 5) && ($command['id'] === 3)) {
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
$fdesc = sprintf(__('Field %s'), ($i - 1));
} else {

View File

@ -759,6 +759,31 @@ if (enterprise_installed() === true) {
);
}
$days_week = [
0 => __('Sunday'),
1 => __('Monday'),
2 => __('Tuesday'),
3 => __('Wednesday'),
4 => __('Thursday'),
5 => __('Friday'),
6 => __('Saturday'),
];
$table_styles->data[$row][] = html_print_label_input_block(
__('Datepicker first day of week'),
html_print_select(
$days_week,
'datepicker_first_day',
$config['datepicker_first_day'],
'',
'',
false,
true,
false,
false
)
);
$row++;
// Title Header.

View File

@ -2312,7 +2312,7 @@ $(document).ready (function () {
// The row provided has a predefined class. We delete it.
$('#table_macros-field' + i)
.removeAttr('class');
if(old_value && i != 4){
if(old_value){
$("[name=field" + i + "_value]").val(old_value).trigger('change');
}
$('#table_macros-field').show();

View File

@ -912,7 +912,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.NetScan (legacy)');
$data[6] .= __('Discovery.NetScan');
} else {
// APP or external script recon task.
$data[6] = html_print_image(
@ -920,7 +920,7 @@ class DiscoveryTaskList extends HTML
true,
['class' => 'main_menu_icon invert_filter']
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name.' (legacy)';
$data[6] .= $recon_script_name;
}
break;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -58,7 +58,14 @@ if ($save_log_filter) {
$values = [];
$values['id_name'] = get_parameter('id_name');
$values['text'] = get_parameter('text', '');
$values['period'] = get_parameter('period', '');
$values['custom_date'] = get_parameter('custom_date');
$values['date'] = get_parameter('date');
$values['date_text'] = get_parameter('date_text');
$values['date_units'] = get_parameter('date_units');
$values['date_init'] = get_parameter('date_init');
$values['time_init'] = get_parameter('time_init');
$values['date_end'] = get_parameter('date_end');
$values['time_end'] = get_parameter('time_end');
$values['ip'] = get_parameter('ip', '');
$values['type'] = get_parameter('type', -1);
$values['user'] = get_parameter('user', -1);
@ -91,7 +98,14 @@ if ($update_log_filter) {
$values = [];
$id = get_parameter('id');
$values['text'] = get_parameter('text', '');
$values['period'] = get_parameter('period', '');
$values['custom_date'] = get_parameter('custom_date');
$values['date'] = get_parameter('date');
$values['date_text'] = get_parameter('date_text');
$values['date_units'] = get_parameter('date_units');
$values['date_init'] = get_parameter('date_init');
$values['time_init'] = get_parameter('time_init');
$values['date_end'] = get_parameter('date_end');
$values['time_end'] = get_parameter('time_end');
$values['ip'] = get_parameter('ip', '');
$values['type'] = get_parameter('type', -1);
$values['user'] = get_parameter('user', -1);
@ -211,18 +225,42 @@ function load_filter_values() {
$.each(data,function(i,value){
if (i == 'text'){
$("#text-filter_text").val(value);
}
if (i == 'period'){
$("#filter_period").val(value).change();
}
if (i == 'ip'){
} else if (i == 'ip'){
$("#text-filter_ip").val(value);
}
if (i == 'type'){
} else if (i == 'type'){
$("#filter_type").val(value).change();
}
if (i == 'user'){
} else if (i == 'user'){
$("#filter_user").val(value).change();
} else if (i == 'custom_date'){
$('#hidden-custom_date').val(value).change();
if ($('#hidden-custom_date').val()==='0'){
$('#date_default').show();
$('#date_range').hide();
$('#date_extend').hide();
$('#date').val('".SECONDS_1DAY."').trigger('change');
} else if ($('#hidden-custom_date').val()==='1'){
$('#date_range').show();
$('#date_default').hide();
$('#date_extend').hide();
} else {
$('#date_range').hide();
$('#date_default').hide();
$('#date_extend').show();
}
} else if (i == 'date'){
$('#date').val(value).change();
} else if (i == 'date_end'){
$('#text-date_end').val(value);
} else if (i == 'date_init'){
$('#text-date_init').val(value);
} else if (i == 'date_text'){
$('#text-date_text').val(value);
} else if (i == 'date_units'){
$('#date_units').val(value).change();
} else if (i == 'time_end'){
$('#text-time_end').val(value);
} else if (i == 'time_init'){
$('#text-time_init').val(value);
}
});
}
@ -408,7 +446,14 @@ function save_new_filter() {
"save_log_filter" : 1,
"id_name" : $("#text-id_name").val(),
"text" : $("#text-filter_text").val(),
"period" : $("#filter_period :selected").val(),
"custom_date": $('#hidden-custom_date').val(),
"date": $('#date option:selected').val(),
"date_text": $('#text-date_text').val(),
"date_units": $('#date_units option:selected').val(),
"date_init": $('#text-date_init').val(),
"time_init": $('#text-time_init').val(),
"date_end": $('#text-date_end').val(),
"time_end": $('#text-time_end').val(),
"ip" : $('#text-filter_ip').val(),
"type" : $('#filter_type :selected').val(),
"user" : $('#filter_user :selected').val(),
@ -444,7 +489,14 @@ function save_update_filter() {
"update_log_filter" : 1,
"id" : $("#overwrite_filter :selected").val(),
"text" : $("#text-filter_text").val(),
"period" : $("#filter_period :selected").val(),
"custom_date": $('#hidden-custom_date').val(),
"date": $('#date option:selected').val(),
"date_text": $('#text-date_text').val(),
"date_units": $('#date_units option:selected').val(),
"date_init": $('#text-date_init').val(),
"time_init": $('#text-time_init').val(),
"date_end": $('#text-date_end').val(),
"time_end": $('#text-time_end').val(),
"ip" : $('#text-filter_ip').val(),
"type" : $('#filter_type :selected').val(),
"user" : $('#filter_user :selected').val(),

View File

@ -1486,27 +1486,53 @@ if (check_login()) {
metaconsole_connect($server);
}
if ($params['histogram'] === true) {
$params['id_agent_module'] = $params['agent_module_id'];
$params['dinamic_proc'] = 1;
if ($params['enable_projected_period'] === '1') {
$params_graphic = [
'period' => $params['period'],
'date' => strtotime(date('Y-m-d H:i:s')),
'only_image' => false,
'homeurl' => ui_get_full_url(false, false, false, false).'/',
'ttl' => false,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
'return_img_base_64' => true,
];
$params_combined = [
'projection' => $params['period_projected'],
];
$return['chart'] = graphic_combined_module(
[$params['agent_module_id']],
$params_graphic,
$params_combined
);
$output .= '<div class="stat_win_histogram">';
if ($params['compare'] === 'separated') {
$output .= $return['chart'];
$output .= '</div>';
} else {
if ($params['histogram'] === true) {
$params['id_agent_module'] = $params['agent_module_id'];
$params['dinamic_proc'] = 1;
$output .= '<div class="stat_win_histogram">';
if ($params['compare'] === 'separated') {
$graph = \reporting_module_histogram_graph(
['datetime' => ($params['begin_date'] - $params['period'])],
$params
);
$output .= $graph['chart'];
}
$graph = \reporting_module_histogram_graph(
['datetime' => ($params['begin_date'] - $params['period'])],
['datetime' => $params['begin_date']],
$params
);
$output .= $graph['chart'];
$output .= '</div>';
} else {
$output .= grafico_modulo_sparse($params);
}
$graph = \reporting_module_histogram_graph(
['datetime' => $params['begin_date']],
$params
);
$output .= $graph['chart'];
$output .= '</div>';
} else {
$output .= grafico_modulo_sparse($params);
}
if (is_metaconsole() === true && empty($server_id) === false) {

View File

@ -201,23 +201,8 @@ class AuditLog extends HTML
'name' => 'filter_text',
],
[
'label' => __('Max. hours old'),
'type' => 'select',
'class' => 'w20px',
'select2_enable' => true,
'sort' => false,
'selected' => 168,
'fields' => [
24 => __('1 day'),
168 => __('7 days'),
360 => __('15 days'),
744 => __('1 month'),
2160 => __('3 months'),
4320 => __('6 months'),
8760 => __('1 Year'),
],
'id' => 'filter_period',
'name' => 'filter_period',
'label' => __('Date'),
'type' => 'date_range',
],
[
'label' => __('IP'),
@ -312,10 +297,35 @@ class AuditLog extends HTML
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $this->filterIp);
}
if (empty($this->filterPeriod) === false) {
$filter .= sprintf(' AND fecha >= DATE_ADD(NOW(), INTERVAL -%d HOUR)', $this->filterPeriod);
// Calculate range dates.
$custom_date = $filters['custom_date'];
if ($custom_date === '1') {
$date_from = ($filters['date_init'].' '.$filters['time_init']);
$date_to = ($filters['date_end'].' '.$filters['time_end']);
} else if ($custom_date === '2') {
$period = ($filters['date_text'] * $filters['date_units']);
$date_to = date('Y-m-d H:i:s');
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $period));
} else if (in_array($filters['date'], ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($filters['date'] === 'this_week') {
$date_from = date('Y-m-d 00:00:00', strtotime('last monday'));
$date_to = date('Y-m-d 23:59:59', strtotime($date_from.' +6 days'));
} else if ($filters['date'] === 'this_month') {
$date_from = date('Y-m-d 23:59:59', strtotime('first day of this month'));
$date_to = date('Y-m-d 00:00:00', strtotime('last day of this month'));
} else if ($filters['date'] === 'past_month') {
$date_from = date('Y-m-d 00:00:00', strtotime('first day of previous month'));
$date_to = date('Y-m-d 23:59:59', strtotime('last day of previous month'));
} else if ($filters['date'] === 'past_week') {
$date_from = date('Y-m-d 00:00:00', strtotime('monday', strtotime('last week')));
$date_to = date('Y-m-d 23:59:59', strtotime('sunday', strtotime('last week')));
}
} else {
$date_to = date('Y-m-d H:i:s');
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $filters['date']));
}
$filter .= sprintf(' AND fecha BETWEEN "%s" AND "%s"', $date_from, $date_to);
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
if ($length !== '-1') {

View File

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

View File

@ -1168,6 +1168,10 @@ function config_update_config()
$error_update[] = __('Custom title header');
}
if (config_update_value('datepicker_first_day', (string) get_parameter('datepicker_first_day'), true) === false) {
$error_update[] = __('Datepicker first day');
}
if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) {
$error_update[] = __('Custom subtitle header');
}
@ -2751,6 +2755,10 @@ function config_process_config()
config_update_value('custom_title_header', __('Pandora FMS'));
}
if (!isset($config['datepicker_first_day'])) {
config_update_value('datepicker_first_day', '0');
}
if (!isset($config['custom_subtitle_header'])) {
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
}

View File

@ -7228,6 +7228,298 @@ function html_print_code_picker(
}
function html_print_select_date_range(
$name,
$return,
$selected=SECONDS_1DAY,
$date_init='',
$time_init='',
$date_end='',
$time_end='',
$date_text=SECONDS_1DAY,
$class='w100p'
) {
global $config;
if ($selected === 'custom') {
$display_extend = '';
$display_range = 'style="display:none"';
$display_default = 'style="display:none"';
$custom_date = 2;
} else if ($selected === 'chose_range') {
$display_range = '';
$display_default = 'style="display:none"';
$display_extend = 'style="display:none"';
$custom_date = 1;
} else {
$display_default = '';
$display_range = 'style="display:none"';
$display_extend = 'style="display:none"';
$custom_date = 0;
}
if ($date_end === '') {
$date_end = date('Y/m/d');
}
if ($date_init === '') {
$date_init = date('Y/m/d', strtotime($date_end.' -1 days'));
}
if ($time_init === '') {
$time_init = date('H:i:s');
}
if ($time_end === '') {
$time_end = date('H:i:s');
}
$fields[SECONDS_1DAY] = __('Last 24hr');
$fields['this_week'] = __('This week');
$fields['this_month'] = __('This month');
$fields['past_week'] = __('Past week');
$fields['past_month'] = __('Past month');
$fields[SECONDS_1WEEK] = __('Last 7 days');
$fields[SECONDS_15DAYS] = __('Last 15 days');
$fields[SECONDS_1MONTH] = __('Last 30 days');
$fields['custom'] = __('Custom');
$fields['chose_range'] = __('Chose start/end date period');
$output = html_print_input_hidden('custom_date', $custom_date, true);
$output .= '<div id="'.$name.'_default" class="wauto inline_flex" '.$display_default.'>';
$output .= html_print_select(
$fields,
$name,
$selected,
'',
'',
0,
true,
false,
false,
$class
);
$output .= '</div>';
$output .= '<div id="'.$name.'_range" class="inline_flex" '.$display_range.'>';
$table = new stdClass();
$table->class = 'table-adv-filter';
$table->data[0][0] .= '<div><div><div><span class="font-title-font">'.__('From').':</span></div>';
$table->data[0][0] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
$table->data[0][0] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
$table->data[0][0] .= '</div>';
$table->data[0][0] .= '<div><div><span class="font-title-font">'.__('to').':</span></div>';
$table->data[0][0] .= html_print_input_text('date_end', $date_end, '', 12, 10, true).' ';
$table->data[0][0] .= '<div id="'.$name.'_manual" class="w100p inline_line">';
$table->data[0][0] .= html_print_input_text('time_end', $time_end, '', 10, 7, true).' ';
$table->data[0][0] .= ' <a href="javascript:">'.html_print_image(
'images/logs@svg.svg',
true,
[
'id' => 'back_default',
'class' => ' main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;',
]
).'</a>';
$table->data[0][0] .= '</div></div>';
$output .= html_print_table($table, true);
$output .= '</div>';
$units = [
1 => __('seconds'),
SECONDS_1MINUTE => __('minutes'),
SECONDS_1HOUR => __('hours'),
SECONDS_1DAY => __('days'),
SECONDS_1WEEK => __('weeks'),
SECONDS_1MONTH => __('months'),
SECONDS_1YEAR => __('years'),
];
$output .= '<div id="'.$name.'_extend" class="w100p inline_flex" '.$display_extend.'>';
$output .= html_print_input_text($name.'_text', $date_text, '', false, 255, true);
$output .= html_print_select(
$units,
$name.'_units',
'1',
'',
'',
0,
true,
false,
false,
'',
false,
' margin-left: 5px; width: 140px;',
false,
false,
false,
'',
false,
false,
false,
false,
false
);
$output .= ' <a href="javascript:">'.html_print_image(
'images/logs@svg.svg',
true,
[
'id' => 'back_default_extend',
'class' => $name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;',
]
).'</a>';
$output .= '</div>';
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
$output .= "<script type='text/javascript'>
$(document).ready (function () {
$('#".$name."').change(function(){
if ($(this).val() === 'chose_range') {
$('#".$name."_range').show();
$('#".$name."_default').hide();
$('#".$name."_extend').hide();
$('#hidden-custom_date').val('1');
} else if ($(this).val() === 'custom') {
$('#".$name."_range').hide();
$('#".$name."_default').hide();
$('#".$name."_extend').show();
$('#hidden-custom_date').val('2');
}
});
$('#back_default, #back_default_extend').click(function(){
display_default();
});
// To get position must to be showed, hide elements return 0 on offset function.
$('#".$name."_range').show();
$('#".$name."_default').hide();
$('#".$name."_extend').hide();
position_top_init = $('#text-date_init').offset().top + $('#text-date_init').outerHeight();
position_top_end = $('#text-date_end').offset().top + $('#text-date_end').outerHeight();
$('#".$name."_range').hide();
$('#".$name."_extend').hide();
$('#".$name."_default').show();
});
var position_top_init = 0;
var position_top_end = 0;
function display_default(){
$('#".$name."_default').show();
$('#".$name."_range').hide();
$('#".$name."_extend').hide();
$('#".$name."').val('".SECONDS_1DAY."').trigger('change');
$('#hidden-custom_date').val('0');
}
$('#text-date').datepicker({
dateFormat: '".DATE_FORMAT_JS."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown'
});
$('[id^=text-time_init]').timepicker({
showSecond: true,
timeFormat: '".TIME_FORMAT_JS."',
timeOnlyTitle: '".__('Choose time')."',
timeText: '".__('Time')."',
hourText: '".__('Hour')."',
minuteText: '".__('Minute')."',
secondText: '".__('Second')."',
currentText: '".__('Now')."',
closeText: '".__('Close')."'
});
$('[id^=text-date_init]').datepicker ({
dateFormat: '".DATE_FORMAT_JS."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
firstDay: ".$config['datepicker_first_day'].",
beforeShowDay: function (date) {
show_datepicker = 'date_init';
var date_now = date.getTime();
var date_ini_split = $('[id^=text-date_init]').val().split('/');
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
var date_end_split = $('[id^=text-date_end]').val().split('/');
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
if (date_now > date_ini && date_now < date_end) {
return [true, 'ui-date-range-in', 'prueba'];
} else if (date_now == date_ini || date_now == date_end){
return [true, 'ui-datepicker-current-day', ''];
}
return [true, '', ''];
}
});
$('[id^=text-date_end]').datepicker ({
dateFormat: '".DATE_FORMAT_JS."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
firstDay: ".$config['datepicker_first_day'].",
beforeShowDay: function (date) {
show_datepicker = 'date_end';
var date_now = date.getTime();
var date_ini_split = $('[id^=text-date_init]').val().split('/');
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
var date_end_split = $('[id^=text-date_end]').val().split('/');
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
if (date_now > date_ini && date_now < date_end) {
return [true, 'ui-date-range-in', 'prueba'];
} else if (date_now == date_ini || date_now == date_end){
return [true, 'ui-datepicker-current-day', ''];
}
return [true, '', ''];
}
});
$('[id^=text-time_end]').timepicker({
showSecond: true,
timeFormat: '".TIME_FORMAT_JS."',
timeOnlyTitle: '".__('Choose time')."',
timeText: '".__('Time')."',
hourText: '".__('Hour')."',
minuteText: '".__('Minute')."',
secondText: '".__('Second')."',
currentText: '".__('Now')."',
closeText: '".__('Close')."'
});
$(window).scroll(function(e){
if ($('#date option:selected').val() == 'chose_range'){
if ($('#ui-datepicker-div').html() !== '') {
if ($(this).scrollTop() > 0){
var css_datepicker = $('#ui-datepicker-div').attr('style').replace('absolute','fixed');
if (!css_datepicker.includes('px !important')) {
if (show_datepicker == 'date_end'){
css_datepicker += '; top: '+position_top_end+'px !important';
} else {
css_datepicker += '; top: '+position_top_init+'px !important';
}
}
$('#ui-datepicker-div').attr('style', css_datepicker);
}
}
}
});
</script>";
if ($return === true) {
return $output;
} else {
echo $output;
}
}
function html_print_wizard_diagnosis(
$title,
$id_button,
@ -7266,4 +7558,5 @@ function html_print_wizard_diagnosis(
} else {
echo $output;
}
}

View File

@ -31,6 +31,7 @@ function inventory_get_data(
$agents_ids,
$inventory_module_name,
$utimestamp,
$period,
$inventory_search_string='',
$export_csv=false,
$return_mode=false,
@ -97,7 +98,7 @@ function inventory_get_data(
// Prepare pagination.
$url = sprintf(
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&order_by_agent=%s&submit_filter=%d',
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&period=%s&order_by_agent=%s&submit_filter=%d',
$pagination_url_parameters['inventory_id_agent'],
$pagination_url_parameters['inventory_agent'],
$pagination_url_parameters['inventory_id_group'],
@ -105,6 +106,7 @@ function inventory_get_data(
$inventory_module_name,
$inventory_search_string,
$utimestamp,
$period,
$order_by_agent,
1
);
@ -328,7 +330,7 @@ function inventory_get_data(
$timestamp = db_get_value_sql(
"SELECT timestamp
FROM tagente_datos_inventory
WHERE utimestamp = $utimestamp"
WHERE utimestamp BETWEEN '".($utimestamp - $period)."' AND '".$utimestamp."'"
);
} else {
$timestamp = db_get_value_sql(
@ -892,6 +894,14 @@ function get_data_basic_info_sql($params, $count=false)
);
}
if ($params['utimestamp'] > 0 && $count === false) {
$where .= sprintf(
' AND utimestamp BETWEEN %d AND %d',
($params['utimestamp'] - $params['period']),
$params['utimestamp']
);
}
if ($params['order'] > 0) {
$str_split = explode(' ', $params['order']);
switch ($str_split[0]) {

View File

@ -143,6 +143,10 @@ function menu_print_menu(&$menu)
if (empty($new_msg) === false) {
$sec2 = 'operation/messages/message_edit&new_msg='.$new_msg;
}
} else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite'
|| $sec2 === 'enterprise/godmode/servers/manage_credential_boxes'
) {
$sec2 = 'enterprise/godmode/servers/list_satellite';
} else {
$sec2 = (string) get_parameter('sec2');
}

View File

@ -4022,7 +4022,11 @@ function ui_print_datatable(array $parameters)
$filter .= '<ul class="datatable_filter content filter_table no_border">';
foreach ($parameters['form']['inputs'] as $input) {
$filter .= html_print_input(($input + ['return' => true]), 'li');
if ($input['type'] === 'date_range') {
$filter .= '<li><label>'.$input['label'].'</label>'.html_print_select_date_range('date', true).'</li>';
} else {
$filter .= html_print_input(($input + ['return' => true]), 'li');
}
}
$filter .= '</ul>';

View File

@ -943,17 +943,25 @@ function pandoraFlotSlicebar(
// Format functions
function xFormatter(v) {
// var ct = new Date();
var ct = new timezoneJS.Date();
ct.setTimezone(phpTimezone);
var ct;
if (typeof timezoneJS === "undefined") {
ct = new Date();
} else {
ct = new timezoneJS.Date();
ct.setTimezone(phpTimezone);
}
var currentTime = ct.getTime();
var diffDates = (currentTime - 1000 * datelimit) / 1000;
// var d = new Date(1000 * (v + datelimit));
var d = new timezoneJS.Date(1000 * (v + datelimit));
d.setTimezone(phpTimezone);
var d;
if (typeof timezoneJS === "undefined") {
d = new Date(1000 * (v + datelimit));
} else {
d = new timezoneJS.Date(1000 * (v + datelimit));
d.setTimezone(phpTimezone);
}
var monthNames = [
"Jan",

File diff suppressed because one or more lines are too long

View File

@ -1613,3 +1613,12 @@ function type_change() {
break;
}
}
// Show/Hide period for projection on agent module graph.
function show_projection_period() {
if ($("#projection_switch").is(":checked")) {
$("#div_projection_period").show();
} else {
$("#div_projection_period").hide();
}
}

View File

@ -416,6 +416,10 @@ class Widget
$className .= '\WuxWidget';
break;
case 'inventory':
$className .= '\InventoryWidget';
break;
case 'os_quick_report':
$className .= '\OsQuickReportWidget';
break;

File diff suppressed because it is too large Load Diff

View File

@ -269,6 +269,14 @@ class SingleGraphWidget extends Widget
$values['showLegend'] = $decoder['showLegend'];
}
if (isset($decoder['projection_switch']) === true) {
$values['projection_switch'] = $decoder['projection_switch'];
}
if (isset($decoder['period_projection']) === true) {
$values['period_projection'] = $decoder['period_projection'];
}
return $values;
}
@ -357,6 +365,33 @@ class SingleGraphWidget extends Widget
],
];
// Projection.
$inputs[] = [
'label' => __('Projection Graph'),
'arguments' => [
'name' => 'projection_switch',
'id' => 'projection_switch',
'type' => 'switch',
'value' => $values['projection_switch'],
'onclick' => 'show_projection_period()',
],
];
// Period Projection.
$display_projection = ($values['projection_switch'] === true) ? '' : 'display:none';
$inputs[] = [
'label' => __('Period Projection'),
'id' => 'div_projection_period',
'style' => $display_projection,
'arguments' => [
'name' => 'period_projection',
'type' => 'interval',
'value' => $values['period_projection'],
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];
return $inputs;
}
@ -376,6 +411,8 @@ class SingleGraphWidget extends Widget
$values['moduleId'] = \get_parameter('moduleId', 0);
$values['period'] = \get_parameter('period', 0);
$values['showLegend'] = \get_parameter_switch('showLegend');
$values['projection_switch'] = (boolean) get_parameter_switch('projection_switch');
$values['period_projection'] = \get_parameter('period_projection', 0);
return $values;
}
@ -405,23 +442,46 @@ class SingleGraphWidget extends Widget
$trickHight = 40;
}
$params = [
'agent_module_id' => $this->values['moduleId'],
'width' => '100%',
'height' => ((int) $size['height'] - $trickHight),
'period' => $this->values['period'],
'title' => $module_name,
'unit' => $units_name,
'homeurl' => $config['homeurl'],
'backgroundColor' => 'transparent',
'show_legend' => $this->values['showLegend'],
'show_title' => $module_name,
'menu' => false,
'dashboard' => true,
];
$output = '<div class="container-center widget-mrgn-0px">';
$output .= \grafico_modulo_sparse($params);
if ($this->values['projection_switch'] === true) {
$params_graphic = [
'period' => $this->values['period'],
'date' => strtotime(date('Y-m-d H:i:s')),
'only_image' => false,
'homeurl' => ui_get_full_url(false, false, false, false).'/',
'height' => ((int) $size['height'] - $trickHight),
'landscape' => $content['landscape'],
'return_img_base_64' => true,
];
$params_combined = [
'projection' => $this->values['period_projection'],
];
$return['chart'] = graphic_combined_module(
[$this->values['moduleId']],
$params_graphic,
$params_combined
);
$output .= $return['chart'];
} else {
$params = [
'agent_module_id' => $this->values['moduleId'],
'width' => '100%',
'height' => ((int) $size['height'] - $trickHight),
'period' => $this->values['period'],
'title' => $module_name,
'unit' => $units_name,
'homeurl' => $config['homeurl'],
'backgroundColor' => 'transparent',
'show_legend' => $this->values['showLegend'],
'show_title' => $module_name,
'menu' => false,
'dashboard' => true,
];
$output .= \grafico_modulo_sparse($params);
}
$output .= '</div>';
return $output;
}

File diff suppressed because one or more lines are too long

View File

@ -107,24 +107,51 @@
height: 30px;
width: 90px;
}
.ui-widget-header .ui-icon {
background-image: url(../images/ui-icons_444444_256x240.png);
.ui-datepicker-prev {
margin-top: 5px;
background: url(../../../images/arrow_left_green.png) no-repeat 0 0 !important;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(../images/ui-icons_444444_256x240.png);
.ui-datepicker-next {
margin-top: 5px;
background: url(../../../images/arrow_right_green.png) no-repeat 0 0 !important;
}
.ui-widget-content {
background: #fff;
}
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
margin-top: 3px;
border-bottom: 0;
background: transparent;
font-weight: normal;
color: #555555;
border-radius: 50%;
text-align: center;
border: 2px solid #ccc;
}
.ui-datepicker td,
a.ui-state-default,
.ui-datepicker td a {
width: 30px !important;
height: 30px !important;
}
a.ui-state-default:hover {
background-color: #82b92e;
}
a.ui-state-default > span {
text-align: center;
margin-top: 2px;
}
a.ui-state-default > span:hover {
font-weight: bold !important;
}
.ui-datepicker-current-day > a {
background-color: #82b92e !important;
font-weight: bold !important;
border: 2px solid #000 !important;
}
.ui-corner-all,
.ui-corner-top,
@ -153,13 +180,44 @@
#ui-datepicker-div {
border-color: #b1b1b1;
background: #ffffff;
border-radius: 15px;
overflow: hidden;
position: absolute;
width: 350px !important;
border: 2px solid var(--primary-color);
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: 0.2em 0;
border-radius: 15px 15px 0px 0px;
}
.ui-datepicker-title,
.ui-datepicker-month,
.ui-datepicker-year {
height: 30px;
}
.ui-datepicker-month,
.ui-datepicker-year {
width: 100px !important;
}
.ui-datepicker-month {
margin-left: -10px !important;
margin-right: 25px !important;
}
.ui-widget-header {
background: #b1b1b1;
background: white;
color: #ffffff;
}
.ui-datepicker-calendar th {
background-color: #3f3f3f;
background-color: #fff;
padding-left: 15px;
text-align: initial;
}
.ui-datepicker-calendar th span {
color: #000;
}
.ui-widget-header {
height: 20px !important;
}
.ui-dialog .ui-widget-header {
margin: 3px 3px 0px 3px;
@ -175,7 +233,10 @@
margin: 0px 15px 0px 15px;
}
.ui-timepicker-div .ui-datepicker-title {
color: white;
color: black;
}
.ui-timepicker-div dl {
margin-top: 0px !important;
}
.ui-datepicker-buttonpane button {
border-color: #b1b1b1;
@ -200,7 +261,6 @@
border: 0px;
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
@ -233,35 +293,6 @@ a.ui-button:active,
border: none;
}
.ui-state-hover:before,
.ui-widget-content .ui-state-hover:before,
.ui-widget-header .ui-state-hover:before {
content: "";
position: absolute;
left: 25%;
bottom: -10%;
height: 1px;
width: 50%;
border-bottom: 4px solid #82b92e;
}
.ui-priority-secondary:hover {
content: "";
position: absolute;
bottom: -5px;
width: 100%;
border-bottom: 5px solid #82b92e;
}
.ui-priority-primary:hover {
content: "";
position: absolute;
right: 5px;
bottom: -5px;
width: 100%;
border-bottom: 5px solid #82b92e;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
@ -314,3 +345,21 @@ input[type="submit"].ui-button-dialog {
height: 30px;
width: 90px;
}
.ui-priority-primary,
.ui-priority-secondary {
background-color: #fff !important;
color: var(--primary-color) !important;
border: 2px solid var(--primary-color) !important;
box-shadow: none !important;
}
.ui-timepicker-div > dl dt,
.ui-timepicker-div > dl dd {
font-weight: bold !important;
}
.ui-timepicker-div > dl dt,
.ui_tpicker_time {
margin-left: 10px !important;
}

View File

@ -12562,3 +12562,7 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
flex-wrap: nowrap;
justify-content: flex-start !important;
}
.ui-date-range-in > a {
background-color: #81b92e3b !important;
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.773.3';
$build = '230905';
$build = '230907';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -197,6 +197,8 @@ ui_print_message_dialog(
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
$histogram = (bool) get_parameter('histogram', 0);
$enable_projected_period = get_parameter('enable_projected_period', 0);
$period_projected = get_parameter('period_projected', 300);
// FORM TABLE.
$table = html_get_predefined_table('transparent', 2);
@ -406,12 +408,35 @@ ui_print_message_dialog(
true
);
$table->data[6][3] = html_print_checkbox_switch(
'fullscale',
'fullscalee',
1,
(bool) $fullscale,
true,
false
);
$table->data[7][0] = __('Projection graph');
$table->data[7][0] .= ui_print_help_tip(
__('Projection graph take as begin date the current time'),
true
);
$table->data[7][1] = html_print_checkbox_switch(
'enable_projected_period',
1,
(bool) $enable_projected_period,
true
);
$table->data[7][2] = __('Projection period');
$table->data[7][3] = '<div class="small-input-select2">'.html_print_extended_select_for_time(
'period_projected',
$period_projected,
'',
'',
0,
7,
true
).'</div>';
} else {
$table->data[0][0] = __('Begin date');
$table->data[0][1] = html_print_input_text(
@ -514,27 +539,29 @@ ui_print_message_dialog(
);
$params = [
'agent_module_id' => $id,
'period' => $period,
'show_events' => $draw_events,
'title' => $label,
'unit_name' => $unit,
'show_alerts' => $draw_alerts,
'date' => $date,
'unit' => $unit,
'baseline' => $baseline,
'homeurl' => $urlImage,
'adapt_key' => 'adapter_'.$graph_type,
'compare' => $time_compare,
'show_unknown' => $unknown_graph,
'percentil' => (($show_percentil) ? $config['percentil'] : null),
'type_graph' => $config['type_module_charts'],
'fullscale' => $fullscale,
'zoom' => $zoom,
'height' => 300,
'type_mode_graph' => $type_mode_graph,
'histogram' => $histogram,
'begin_date' => strtotime($start_date.' '.$start_time),
'agent_module_id' => $id,
'period' => $period,
'show_events' => $draw_events,
'title' => $label,
'unit_name' => $unit,
'show_alerts' => $draw_alerts,
'date' => $date,
'unit' => $unit,
'baseline' => $baseline,
'homeurl' => $urlImage,
'adapt_key' => 'adapter_'.$graph_type,
'compare' => $time_compare,
'show_unknown' => $unknown_graph,
'percentil' => (($show_percentil) ? $config['percentil'] : null),
'type_graph' => $config['type_module_charts'],
'fullscale' => $fullscale,
'zoom' => $zoom,
'height' => 300,
'type_mode_graph' => $type_mode_graph,
'histogram' => $histogram,
'begin_date' => strtotime($start_date.' '.$start_time),
'enable_projected_period' => $enable_projected_period,
'period_projected' => $period_projected,
];
// Graph.

View File

@ -69,6 +69,8 @@ if (is_ajax()) {
$id_group = (int) get_parameter('id_group');
$pendingdelete = (bool) get_parameter('pendingdelete');
$get_node_agent = (bool) get_parameter('get_node_agent', false);
$get_agent_inventory_modules = (bool) get_parameter('get_agent_inventory_modules', false);
$get_agent_inventory_dates = (bool) get_parameter('get_agent_inventory_dates', false);
$refresh_contact = get_parameter('refresh_contact', 0);
@ -1328,6 +1330,102 @@ if (is_ajax()) {
}
}
if ($get_agent_inventory_modules) {
$inventory_id_agent = get_parameter('id_agent');
$id_node = (int) get_parameter('id_node');
$sql = 'SELECT DISTINCT(`name`)
FROM tmodule_inventory, tagent_module_inventory
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
if ($inventory_id_agent > 0) {
$sql .= ' AND id_agente = '.$inventory_id_agent;
}
$fields = [];
// Get results from all nodes if id_node equals to 0.
if ($id_node === 0 && is_metaconsole() === true) {
$result = [];
$nodes_connection = metaconsole_get_connections();
foreach ($nodes_connection as $key => $server) {
$id_node = $server['id'];
try {
if (is_metaconsole() === true) {
$node = new Node($id_node);
$node->connect();
}
$node_result = db_get_all_rows_sql($sql);
if ($node_result === false) {
continue;
}
$result = array_merge(
$result,
$node_result
);
if (is_metaconsole() === true) {
$node->disconnect();
}
} catch (Exception $e) {
if ($node !== null) {
$node->disconnect();
}
return;
}
}
} else {
try {
if (is_metaconsole() === true) {
$node = new Node($id_node);
$node->connect();
}
$result = db_get_all_rows_sql($sql);
if (is_metaconsole() === true) {
$node->disconnect();
}
} catch (Exception $e) {
if ($node !== null) {
$node->disconnect();
}
return;
}
}
if ($result === false) {
$result = [];
}
echo json_encode($result);
return;
}
if ($get_agent_inventory_dates) {
$inventory_module = get_parameter('module', 0);
$inventory_id_agent = (int) get_parameter('id_agent', 0);
$inventory_id_group = (int) get_parameter('id_group', 0);
$dates = inventory_get_dates(
$inventory_module,
$inventory_id_agent,
$inventory_id_group
);
echo json_encode($dates);
return;
}
return;
}

View File

@ -32,6 +32,55 @@ use PandoraFMS\Enterprise\Metaconsole\Node;
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_inventory.php';
// Get different date to search the report.
$utimestamp = (int) get_parameter('date_end', 0);
$datetime_end = strtotime($utimestamp.' '.$time_end);
// Calculate new inteval for all reports.
$custom_date = get_parameter('custom_date', 0);
$date = get_parameter('date', SECONDS_1DAY);
$date_text = get_parameter('date_text', SECONDS_1DAY);
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
if ($custom_date === '1') {
if ($datetime_init >= $datetime_end) {
$datetime_init = $date_init_less;
}
$period = ($datetime_end - $datetime_init);
} else if ($custom_date === '2') {
$date_units = get_parameter('date_units');
$utimestamp = date('Y/m/d H:i:s');
$date_start = date('Y/m/d H:i:s', (strtotime($utimestamp) - ($date_text * $date_units)));
$period = (strtotime($utimestamp) - strtotime($date_start));
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$monday = date('Y/m/d', strtotime('last monday'));
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
$period = (strtotime($sunday) - strtotime($monday));
$date_init = $monday;
$utimestamp = $sunday;
} else if ($date === 'this_month') {
$utimestamp = date('Y/m/d', strtotime('last day of this month'));
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
$period = (strtotime($utimestamp) - strtotime($first_of_month));
} else if ($date === 'past_month') {
$utimestamp = date('Y/m/d', strtotime('last day of previous month'));
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
$period = (strtotime($utimestamp) - strtotime($first_of_month));
} else if ($date === 'past_week') {
$utimestamp = date('Y-m-d', strtotime('sunday', strtotime('last week')));
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
$period = (strtotime($utimestamp) - strtotime($first_of_week));
}
} else {
$utimestamp = date('Y/m/d H:i:s');
$date_start = date('Y/m/d H:i:s', (strtotime($utimestamp) - $date));
$period = (strtotime($utimestamp) - strtotime($date_start));
}
if (is_ajax() === true) {
$get_csv_url = (bool) get_parameter('get_csv_url');
$get_data_basic_info = (bool) get_parameter('get_data_basic_info');
@ -43,7 +92,6 @@ if (is_ajax() === true) {
// 0 is All groups
$inventory_search_string = (string) get_parameter('search_string');
$export = (string) get_parameter('export');
$utimestamp = (int) get_parameter('utimestamp', 0);
$inventory_agent = (string) get_parameter('agent', '');
$order_by_agent = (boolean) get_parameter('order_by_agent', 0);
@ -98,6 +146,7 @@ if (is_ajax() === true) {
$agents_ids,
$inventory_module,
$utimestamp,
$period,
$inventory_search_string,
$export,
false,
@ -122,12 +171,14 @@ if (is_ajax() === true) {
$id_group = (int) get_parameter('id_group', 0);
$params = [
'search' => $filter['value'],
'start' => $start,
'length' => $length,
'order' => $order,
'id_agent' => $id_agent,
'id_group' => $id_group,
'search' => $filter['value'],
'start' => $start,
'length' => $length,
'order' => $order,
'id_agent' => $id_agent,
'id_group' => $id_group,
'utimestamp' => strtotime($utimestamp),
'period' => $period,
];
$data = get_data_basic_info_sql($params);
@ -677,26 +728,17 @@ $table->data[1][1] = html_print_label_input_block(
// Date filter. In Metaconsole has not reason for show.
if (is_metaconsole() === false) {
$dates = inventory_get_dates(
$inventory_module,
$inventory_id_agent,
$inventory_id_group
);
$table->data[1][2] = html_print_label_input_block(
__('Date'),
html_print_select(
$dates,
$table->data[1][2] .= html_print_label_input_block(
__('Date').':<br>',
html_print_select_date_range(
'utimestamp',
$utimestamp,
'',
__('Last'),
0,
true,
false,
false,
'',
false,
'width:100%;'
get_parameter('utimestamp', SECONDS_1DAY),
$date_init,
$time_init,
date('Y/m/d'),
date('H:i:s'),
$date_text
)
);
}
@ -1303,6 +1345,9 @@ if ($inventory_module !== 'basic') {
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');
ui_require_jquery_file('bgiframe');
/*
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');*/
?>
<script type="text/javascript">
@ -1341,6 +1386,51 @@ ui_require_jquery_file('bgiframe');
div.firstChild.src = src;
});
});
/*
$("#text-date").datepicker({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
changeMonth: true,
changeYear: true,
showAnim: "slideDown"
});
$('[id^=text-time_init]').timepicker({
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>'
});
$('[id^=text-date_init]').datepicker ({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
changeMonth: true,
changeYear: true,
showAnim: "slideDown"
});
$('[id^=text-date_end]').datepicker ({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
changeMonth: true,
changeYear: true,
showAnim: "slideDown"
});
$('[id^=text-time_end]').timepicker({
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>'
});*/
});
/* ]]> */
</script>

View File

@ -109,20 +109,39 @@ $interval_length = get_parameter('interval_length', NETFLOW_RES_MEDD);
$address_resolution = (int) get_parameter('address_resolution', ($config['netflow_get_ip_hostname'] ?? ''));
$filter_selected = (int) get_parameter('filter_selected', 0);
// Read time values.
$date = get_parameter_post('date', date(DATE_FORMAT, get_system_time()));
$time = get_parameter_post('time', date(TIME_FORMAT, get_system_time()));
$end_date = strtotime($date.' '.$time);
$is_period = (bool) get_parameter('is_period', false);
$period = (int) get_parameter('period', SECONDS_1DAY);
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($end_date - $period)));
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($end_date - $period)));
$start_date = ($is_period) ? ($end_date - $period) : strtotime($date_lower.' '.$time_lower);
if (!$is_period) {
$period = ($end_date - $start_date);
// Calculate range dates.
$custom_date = get_parameter('custom_date', '0');
$date = get_parameter('date', SECONDS_1DAY);
if ($custom_date === '1') {
$date_init = get_parameter('date_init');
$time_init = get_parameter('time_init');
$date_end = get_parameter('date_end');
$time_end = get_parameter('time_end');
$date_from = strtotime($date_init.' '.$time_init);
$date_to = strtotime($date_end.' '.$time_end);
} else if ($custom_date === '2') {
$date_text = get_parameter('date_text');
$date_units = get_parameter('date_units');
$period = ($date_text * $date_units);
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = (strtotime($date_to) - $period);
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$date_from = strtotime('last monday');
$date_to = strtotime($date_from.' +6 days');
} else if ($date === 'this_month') {
$date_from = strtotime('first day of this month');
$date_to = strtotime('last day of this month');
} else if ($date === 'past_month') {
$date_from = strtotime('first day of previous month');
$date_to = strtotime('last day of previous month');
} else if ($date === 'past_week') {
$date_from = strtotime('monday', strtotime('last week'));
$date_to = strtotime('sunday', strtotime('last week'));
}
} else {
$time_lower = date(TIME_FORMAT, $start_date);
$date_lower = date(DATE_FORMAT, $start_date);
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = ($date_to - $date);
}
// Read buttons.
@ -459,82 +478,11 @@ if (empty($nodeListInput) === false) {
}
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
[ 'div_id' => 'period_container' ]
);
$filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
__('Date'),
html_print_select_date_range('date', true)
);
$filterTable->data[0][1] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date',
$date,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time,
false,
10,
8,
true
),
],
true
)
);
$filterTable->data[0][2] = html_print_label_input_block(
__('Resolution'),
html_print_select(
netflow_resolution_select_params(),
@ -552,15 +500,37 @@ $filterTable->data[0][2] = html_print_label_input_block(
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period(event)'
$filterTable->data[0][2] = html_print_label_input_block(
__('Max values'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$max_values,
'max_aggregates',
$max_aggregates,
'',
'',
0,
true
).html_print_anchor(
[
'id' => 'max_values',
'href' => '#',
'onClick' => 'edit_max_value()',
'content' => html_print_image(
'images/edit.svg',
true,
[
'id' => 'pencil',
'class' => 'main_menu_icon invert_filter',
]
),
],
true
),
],
true
)
);
@ -594,39 +564,7 @@ $filterTable->data[1][] = html_print_label_input_block(
)
);
$filterTable->data[2][] = html_print_label_input_block(
__('Max values'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$max_values,
'max_aggregates',
$max_aggregates,
'',
'',
0,
true
).html_print_anchor(
[
'id' => 'max_values',
'href' => '#',
'onClick' => 'edit_max_value()',
'content' => html_print_image(
'images/edit.svg',
true,
[
'id' => 'pencil',
'class' => 'main_menu_icon invert_filter',
]
),
],
true
),
],
true
)
);
$filterTable->colspan[3][0] = 3;
$filterTable->data[3][0] = html_print_label_input_block(
@ -703,8 +641,8 @@ if (empty($draw) === false) {
[
'class' => $netflowContainerClass,
'content' => netflow_draw_item(
$start_date,
$end_date,
$date_from,
$date_to,
$interval_length,
$chart_type,
$filter,

View File

@ -57,20 +57,48 @@ if (is_ajax() === true) {
// Include JS timepicker.
ui_include_time_picker();
// Query params and other initializations.
$filter_id = (int) get_parameter('filter_id', 0);
$time_greater = get_parameter('time_greater', date(TIME_FORMAT));
$date_greater = get_parameter('date_greater', date(DATE_FORMAT));
$utimestamp_greater = strtotime($date_greater.' '.$time_greater);
$is_period = (bool) get_parameter('is_period', false);
$period = (int) get_parameter('period', SECONDS_1HOUR);
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($utimestamp_greater - $period)));
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($utimestamp_greater - $period)));
$utimestamp_lower = ($is_period) ? ($utimestamp_greater - $period) : strtotime($date_lower.' '.$time_lower);
if (!$is_period) {
$period = ($utimestamp_greater - $utimestamp_lower);
// Calculate range dates.
$custom_date = get_parameter('custom_date', '0');
$date = get_parameter('date', SECONDS_1DAY);
if ($custom_date === '1') {
$date_init = get_parameter('date_init');
$time_init = get_parameter('time_init');
$date_end = get_parameter('date_end');
$time_end = get_parameter('time_end');
$date_from = strtotime($date_init.' '.$time_init);
$date_to = strtotime($date_end.' '.$time_end);
} else if ($custom_date === '2') {
$date_text = get_parameter('date_text');
$date_units = get_parameter('date_units');
$period = ($date_text * $date_units);
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = (strtotime($date_to) - $period);
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$date_from = strtotime('last monday');
$date_to = strtotime($date_from.' +6 days');
} else if ($date === 'this_month') {
$date_from = strtotime('first day of this month');
$date_to = strtotime('last day of this month');
} else if ($date === 'past_month') {
$date_from = strtotime('first day of previous month');
$date_to = strtotime('last day of previous month');
} else if ($date === 'past_week') {
$date_from = strtotime('monday', strtotime('last week'));
$date_to = strtotime('sunday', strtotime('last week'));
}
} else {
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = ($date_to - $date);
}
$filter_id = (int) get_parameter('filter_id', 0);
// Query params and other initializations.
$utimestamp_greater = $date_to;
$utimestamp_lower = $date_from;
$top = (int) get_parameter('top', 10);
$main_value = ((bool) get_parameter('remove_filter', 0)) ? '' : get_parameter('main_value', '');
if (is_numeric($main_value) && !in_array($action, ['udp', 'tcp'])) {
@ -89,44 +117,6 @@ if (!in_array($order_by, ['bytes', 'pkts', 'flows'])) {
$order_by = 'bytes';
}
$save = get_parameter('save_button', '');
$update = get_parameter('update_button', '');
// Save user defined filter.
if ($save != '' && check_acl($config['id_user'], 0, 'AW')) {
// Save filter args.
$data['filter_name'] = get_parameter('filter_name');
$data['top'] = $top;
$data['action'] = $action;
$data['advanced_filter'] = $advanced_filter;
$filter_id = db_process_sql_insert('tnetwork_explorer_filter', $data);
if ($filter_id === false) {
$filter_id = 0;
ui_print_error_message(__('Error creating filter'));
} else {
ui_print_success_message(__('Filter created successfully'));
}
} else if ($update != '' && check_acl($config['id_user'], 0, 'AW')) {
// Update current filter.
// Do not update the filter name and group.
$data['top'] = $top;
$data['action'] = $action;
$data['advanced_filter'] = $advanced_filter;
$result = db_process_sql_update(
'tnetwork_explorer_filter',
$data,
['id' => $filter_id]
);
ui_print_result_message(
$result,
__('Filter updated successfully'),
__('Error updating filter')
);
}
// Build the table.
$filterTable = new stdClass();
$filterTable->id = '';
@ -136,95 +126,7 @@ $filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->size[2] = '33%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
[ 'div_id' => 'period_container' ]
);
$filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
);
$filterTable->data[0][1] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'content' => html_print_input_text(
'date',
$date_greater,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time_greater,
false,
10,
8,
true
),
],
true
)
);
$filterTable->data[0][2] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period()'
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Results to show'),
html_print_select(
[
@ -246,56 +148,9 @@ $filterTable->data[1][] = html_print_label_input_block(
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Data to show'),
html_print_select(
network_get_report_actions(),
'action',
$action,
'',
'',
0,
true
)
);
$advanced_toggle = new stdClass();
$advanced_toggle->class = 'filter-table-adv';
$advanced_toggle->size = [];
$advanced_toggle->size[0] = '50%';
$advanced_toggle->size[1] = '50%';
$advanced_toggle->width = '100%';
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
$user_groups[0] = 0;
// Add all groups.
$sql = 'SELECT * FROM tnetwork_explorer_filter';
$advanced_toggle->data[0][0] = html_print_label_input_block(
__('Load Filter'),
html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true, false, true, false, 'width:100%;')
);
$advanced_toggle->data[0][1] = html_print_label_input_block(
__('Filter name'),
html_print_input_text('filter_name', '', false, 40, 45, true, false, false, '', 'w100p')
);
$advanced_toggle->colspan[1][0] = 2;
$advanced_toggle->data[1][0] = html_print_label_input_block(
__('Filter').ui_print_help_icon('pcap_filter', true),
html_print_textarea('advanced_filter', 4, 10, $advanced_filter, 'style="width:100%"', true)
);
$filterTable->colspan[2][0] = 3;
$filterTable->data[2][0] = html_print_label_input_block(
'',
ui_toggle(
html_print_table($advanced_toggle, true),
__('Advanced'),
'',
'',
true,
true,
'',
'white-box-content',
'box-flat white_table_graph'
)
$filterTable->data[0][1] = html_print_label_input_block(
__('Start date'),
html_print_select_date_range('date', true)
);
$filterInputTable = '<form method="POST">';
@ -386,8 +241,6 @@ $data = netflow_get_top_summary(
$hidden_main_link = [
'time_greater' => $time_greater,
'date_greater' => $date_greater,
'is_period' => $is_period,
'period' => $period,
'time_lower' => $time_lower,
'date_lower' => $date_lower,
'top' => $top,

View File

@ -84,19 +84,43 @@ ui_include_time_picker();
// Query params and other initializations.
$action = get_parameter('action', 'talkers');
$time_greater = get_parameter('time_greater', date(TIME_FORMAT));
$date_greater = get_parameter('date_greater', date(DATE_FORMAT));
$utimestamp_greater = strtotime($date_greater.' '.$time_greater);
$is_period = (bool) get_parameter('is_period', false);
$period = (int) get_parameter('period', SECONDS_1HOUR);
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($utimestamp_greater - $period)));
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($utimestamp_greater - $period)));
$advanced_filter = get_parameter('advanced_filter', '');
$utimestamp_lower = ($is_period) ? ($utimestamp_greater - $period) : strtotime($date_lower.' '.$time_lower);
if (!$is_period) {
$period = ($utimestamp_greater - $utimestamp_lower);
// Calculate range dates.
$custom_date = get_parameter('custom_date', '0');
$date = get_parameter('date', SECONDS_1DAY);
if ($custom_date === '1') {
$date_init = get_parameter('date_init');
$time_init = get_parameter('time_init');
$date_end = get_parameter('date_end');
$time_end = get_parameter('time_end');
$date_from = strtotime($date_init.' '.$time_init);
$date_to = strtotime($date_end.' '.$time_end);
} else if ($custom_date === '2') {
$date_text = get_parameter('date_text');
$date_units = get_parameter('date_units');
$period = ($date_text * $date_units);
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = (strtotime($date_to) - $period);
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$date_from = strtotime('last monday');
$date_to = strtotime($date_from.' +6 days');
} else if ($date === 'this_month') {
$date_from = strtotime('first day of this month');
$date_to = strtotime('last day of this month');
} else if ($date === 'past_month') {
$date_from = strtotime('first day of previous month');
$date_to = strtotime('last day of previous month');
} else if ($date === 'past_week') {
$date_from = strtotime('monday', strtotime('last week'));
$date_to = strtotime('sunday', strtotime('last week'));
}
} else {
$date_to = strtotime(date('Y-m-d H:i:s'));
$date_from = ($date_to - $date);
}
$advanced_filter = get_parameter('advanced_filter', '');
$top = (int) get_parameter('top', 10);
$order_by = get_parameter('order_by', 'bytes');
@ -186,93 +210,11 @@ $filterTable->size[2] = '33%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
[ 'div_id' => 'period_container' ]
);
$filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
__('Date'),
html_print_select_date_range('date', true)
);
$filterTable->data[0][1] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'content' => html_print_input_text(
'date',
$date_greater,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time_greater,
false,
10,
8,
true
),
],
true
)
);
$filterTable->data[0][2] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period()'
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Results to show'),
html_print_select(
[
@ -294,7 +236,7 @@ $filterTable->data[1][] = html_print_label_input_block(
)
);
$filterTable->data[1][] = html_print_label_input_block(
$filterTable->data[0][2] = html_print_label_input_block(
__('Data to show'),
html_print_select(
network_get_report_actions(),
@ -373,8 +315,8 @@ $has_data = false;
if ((bool) get_parameter('update_netflow') === true) {
$map_data = netflow_build_map_data(
$utimestamp_lower,
$utimestamp_greater,
$date_from,
$date_to,
$top,
($action === 'talkers') ? 'srcip' : 'dstip',
$advanced_filter

View File

@ -114,16 +114,53 @@ if ($view_graph) {
}
}
// Get different date to search the report.
$date = (string) get_parameter('date', date(DATE_FORMAT));
$time = (string) get_parameter('time', date(TIME_FORMAT));
$unixdate = strtotime($date.' '.$time);
// Calculate range dates.
$custom_date = get_parameter('custom_date', 0);
$date = get_parameter('date', SECONDS_1DAY);
$date_text = get_parameter('date_text', SECONDS_1DAY);
if ($custom_date === '1') {
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
$datetime_init = strtotime($date_init.' '.$time_init);
$date_end = (string) get_parameter('date_end', date(DATE_FORMAT));
$time_end = (string) get_parameter('time_end', date(TIME_FORMAT));
$datetime_end = strtotime($date_end.' '.$time_end);
$period = (int) get_parameter('period');
if (! $period) {
$period = $graph['period'];
if ($datetime_init >= $datetime_end) {
$datetime_init = $date_init_less;
}
$unixdate = $datetime_end;
$period = ($unixdate - $datetime_init);
} else if ($custom_date === '2') {
$unixdate = strtotime('now');
$date_units = get_parameter('date_units');
$date_start = date('Y/m/d H:i:s', ($unixdate - ($date_text * $date_units)));
$period = ($unixdate - strtotime($date_start));
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$monday = date('Y/m/d 00:00:00', strtotime('Monday this week'));
$sunday = date('Y/m/d 23:59:59', strtotime($monday.' +6 days'));
$period = (strtotime($sunday) - strtotime($monday));
$unixdate = strtotime($sunday);
} else if ($date === 'this_month') {
$unixdate = strtotime('last day of this month');
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
$period = ($unixdate - strtotime($first_of_month));
} else if ($date === 'past_month') {
$unixdate = strtotime('last day of previous month');
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
$period = ($unixdate - strtotime($first_of_month));
} else if ($date === 'past_week') {
$unixdate = strtotime('sunday', strtotime('last week'));
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
$period = ($unixdate - strtotime($first_of_week));
}
} else {
$period = $period;
$unixdate = strtotime('now');
$date_start = date('Y/m/d H:i:s', ($unixdate - $date));
$period = ($unixdate - strtotime($date_start));
}
$events = $graph['events'];
@ -315,9 +352,9 @@ if ($view_graph) {
$searchForm = '<form method="POST" action="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">';
$searchForm .= "<table class='filter-table-adv w100p' cellpadding='4' cellspacing='4'>";
$searchForm .= '<tr>';
$searchForm .= '<td class="w30p">';
$searchForm .= html_print_label_input_block(
/*
$searchForm .= '<td class="w30p">';
$searchForm .= html_print_label_input_block(
__('Date'),
html_print_input_text(
'date',
@ -327,9 +364,9 @@ if ($view_graph) {
10,
true
)
);
$searchForm .= '</td><td class="datos w30p">';
$searchForm .= html_print_label_input_block(
);
$searchForm .= '</td><td class="datos w30p">';
$searchForm .= html_print_label_input_block(
__('Time'),
html_print_input_text(
'time',
@ -339,33 +376,16 @@ if ($view_graph) {
7,
true
)
);
$searchForm .= '</td>';
$searchForm .= "<td class='datos w30p'>";
$searchForm .= html_print_label_input_block(
);
$searchForm .= '</td>';
$searchForm .= "<td class='datos w30p'>";
$searchForm .= html_print_label_input_block(
__('Time range'),
html_print_extended_select_for_time(
'period',
(string) $period,
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
0,
10,
true,
'width:100%',
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
)
);
$searchForm .= '</td>';
$searchForm .= '</tr><tr>';
html_print_extended_select_for_time('period', (string) $period, '', '', 0, 10, true, 'width:100%')
);
$searchForm .= '</td>';*/
$searchForm .= '<td class="w25p">'.html_print_label_input_block(__('Date'), html_print_select_date_range('date', true)).'</td>';
$searchForm .= "<td class='datos w30p'>";
$stackeds = [];
$stackeds[0] = __('Graph defined');
@ -559,14 +579,6 @@ if ($view_graph) {
</script>
<?php
$datetime = strtotime($date.' '.$time);
$report['datetime'] = $datetime;
if ($datetime === false || $datetime == -1) {
ui_print_error_message(__('Invalid date selected'));
return;
}
return;
}

View File

@ -43,28 +43,59 @@ if (!reporting_user_can_see_report($id_report)) {
exit;
}
// Get different date to search the report.
$date = (string) get_parameter('date', date(DATE_FORMAT));
$time = (string) get_parameter('time', date(TIME_FORMAT));
$datetime = strtotime($date.' '.$time);
// Calculations in order to modify init date of the report
// Calculations in order to modify init date of the report.
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
$datetime_init = strtotime($date_init.' '.$time_init);
$enable_init_date = get_parameter('enable_init_date', 0);
$pure = (int) get_parameter('pure', 0);
$period = null;
// Calculate new inteval for all reports
if ($enable_init_date) {
if ($datetime_init >= $datetime) {
// Get different date to search the report.
$date_end = (string) get_parameter('date_end', date(DATE_FORMAT));
$time_end = (string) get_parameter('time_end', date(TIME_FORMAT));
$datetime_end = strtotime($date_end.' '.$time_end);
// Calculate new inteval for all reports.
$custom_date = get_parameter('custom_date', 0);
$date = get_parameter('date', SECONDS_1DAY);
$date_text = get_parameter('date_text', SECONDS_1DAY);
if ($custom_date === '1') {
if ($datetime_init >= $datetime_end) {
$datetime_init = $date_init_less;
}
$period = ($datetime - $datetime_init);
$period = ($datetime_end - $datetime_init);
} else if ($custom_date === '2') {
$date_units = get_parameter('date_units');
$date_end = date('Y/m/d H:i:s');
$date_start = date('Y/m/d H:i:s', (strtotime($date_end) - ($date_text * $date_units)));
$period = (strtotime($date_end) - strtotime($date_start));
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
if ($date === 'this_week') {
$monday = date('Y/m/d', strtotime('last monday'));
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
$period = (strtotime($sunday) - strtotime($monday));
$date_init = $monday;
$date_end = $sunday;
} else if ($date === 'this_month') {
$date_end = date('Y/m/d', strtotime('last day of this month'));
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
$period = (strtotime($date_end) - strtotime($first_of_month));
} else if ($date === 'past_month') {
$date_end = date('Y/m/d', strtotime('last day of previous month'));
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
$period = (strtotime($date_end) - strtotime($first_of_month));
} else if ($date === 'past_week') {
$date_end = date('Y-m-d', strtotime('sunday', strtotime('last week')));
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
$period = (strtotime($date_end) - strtotime($first_of_week));
}
} else {
$date_end = date('Y/m/d H:i:s');
$date_start = date('Y/m/d H:i:s', (strtotime($date_end) - $date));
$period = (strtotime($date_end) - strtotime($date_start));
}
// Shchedule report email.
@ -242,7 +273,7 @@ $table2->styleTable = 'border:none';
if (defined('METACONSOLE')) {
$table2->width = '100%';
$table2->class = 'databox filters';
$table2->class = 'databox filters filter-table-adv';
$table2->head[0] = __('View Report');
$table2->head_colspan[0] = 5;
@ -264,14 +295,10 @@ if ($html_menu_export === ENTERPRISE_NOT_HOOK) {
}
$table2->data[0][2] = '<div><span class="font-title-font">'.__('Set initial date').'</span><br>'.html_print_checkbox_switch('enable_init_date', 1, $enable_init_date, true).'</div><br>';
$table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_from"><div><span class="font-title-font">'.__('From').':</span></div>';
$table2->data[0][2] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
$table2->data[0][2] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
$table2->data[0][2] .= '</div><div style="display:'.$display_item.'" id="string_items"><span class="font-title-font">'.__('Items period before').':</span></div>';
$table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_to"><span class="font-title-font">'.__('to').':</span></div>';
$table2->data[0][2] .= html_print_input_text('date', $date, '', 12, 10, true).' ';
$table2->data[0][2] .= html_print_input_text('time', $time, '', 10, 7, true).' ';
$table2->data[0][2] = html_print_label_input_block(
__('Date').':<br>',
html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text)
);
$table2->data[0][3] = $html_menu_export;
@ -313,7 +340,7 @@ ui_toggle(
);
// ------------------------ END FORM ------------------------------------
if ($enable_init_date) {
if ($datetime_init > $datetime) {
if ($datetime_init > $datetime_end) {
ui_print_error_message(
__('Invalid date selected. Initial date must be before end date.')
);
@ -323,7 +350,7 @@ if ($enable_init_date) {
$report = reporting_make_reporting_data(
null,
$id_report,
$date,
$date_end,
$time,
$period,
'dinamic'
@ -367,28 +394,6 @@ $(document).ready (function () {
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
$("#text-date").datepicker({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
changeMonth: true,
changeYear: true,
showAnim: "slideDown"});
$('[id^=text-time_init]').timepicker({
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>'});
$('[id^=text-date_init]').datepicker ({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
changeMonth: true,
changeYear: true,
showAnim: "slideDown"});
/* Show/hide begin date reports controls */
$("#checkbox-enable_init_date").click(function() {
@ -408,8 +413,4 @@ $(document).ready (function () {
</script>
<?php
if ($datetime === false || $datetime == -1) {
ui_print_error_message(__('Invalid date selected'));
return;
}

View File

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

View File

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

View File

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

View File

@ -4280,10 +4280,17 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter` (
`id_filter` INT NOT NULL AUTO_INCREMENT,
`id_name` TEXT NULL,
`text` TEXT NULL,
`period` TEXT NULL,
`ip` TEXT NULL,
`type` TEXT NULL,
`user` TEXT NULL,
`custom_date` INT NULL,
`date` VARCHAR(45) NULL,
`date_text` VARCHAR(45) NULL,
`date_units` VARCHAR(45) NULL,
`date_init` VARCHAR(45) NULL,
`time_init` VARCHAR(45) NULL,
`date_end` VARCHAR(45) NULL,
`time_end` VARCHAR(45) NULL,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -4335,14 +4342,14 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter_log_viewer` (
`order` VARCHAR(45) NULL,
`search` VARCHAR(255) NULL,
`group_id` INT NULL,
`date_range` TINYINT NULL,
`start_date_defined` VARCHAR(45) NULL,
`start_date_time` VARCHAR(45) NULL,
`start_date_date` VARCHAR(45) NULL,
`start_date_date_range` VARCHAR(45) NULL,
`start_date_time_range` VARCHAR(45) NULL,
`end_date_date_range` VARCHAR(45) NULL,
`end_date_time_range` VARCHAR(45) NULL,
`custom_date` INT NULL,
`date` VARCHAR(45) NULL,
`date_text` VARCHAR(45) NULL,
`date_units` VARCHAR(45) NULL,
`date_init` VARCHAR(45) NULL,
`time_init` VARCHAR(45) NULL,
`date_end` VARCHAR(45) NULL,
`time_end` VARCHAR(45) NULL,
`agent` VARCHAR(255) NULL,
`source` VARCHAR(255) NULL,
`display_mode` INT NULL,

View File

@ -1097,7 +1097,7 @@ INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `o
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (14,'Citrix_Sessions','module_begin\r\nmodule_name Citrix_Sessions\r\nmodule_description Opened active sessions on server\r\nmodule_type generic_data\r\nmodule_exec query session | grep Active | wc -l\r\nmodule_end ','Opened active sessions on server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (15,'Users_Connected','module_begin\r\nmodule_name Users_Connected\r\nmodule_description Users connected to this server\r\nmodule_type generic_data\r\nmodule_exec quser | grep Active | wc -l\r\nmodule_interval 2\r\nmodule_end\r\n ','Users connected to this server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (16,'Busy&#x20;XML&#x20;Threads','module_begin\r\nmodule_name Busy XML Threads\r\nmodule_description Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers\r\nmodule_type generic_data\r\nmodule_exec Typeperf &#039;&#92;&#92;MAQUINA&#92;Citrix Metaframe Presentation Server&#92;Number of busy XML threads&#039; -sc 1\r\nmodule_end\r\n','Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (17,'CPU&#x20;Load','module_begin&#x0d;&#x0a;module_name&#x20;CPU&#x20;Load&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_wmiquery&#x20;SELECT&#x20;LoadPercentage&#x20;FROM&#x20;Win32_Processor&#x0d;&#x0a;module_wmicolumn&#x20;LoadPercentage&#x0d;&#x0a;module_description&#x20;CPU&#x20;Load&#x20;&#40;%&#41;&#x0d;&#x0a;module_min_warning&#x20;80&#x0d;&#x0a;module_max_warning&#x20;90&#x0d;&#x0a;module_min_critical&#x20;91&#x0d;&#x0a;module_max_critical&#x20;100&#x0d;&#x0a;module_end','CPU&#x20;Load&#x20;&#40;using&#x20;WMI&#41;',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (17,'CPU&#x20;Load','module_begin&#x0d;&#x0a;module_name&#x20;CPU&#x20;Load&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_wmiquery&#x20;SELECT&#x20;LoadPercentage&#x20;FROM&#x20;Win32_Processor&#x0d;&#x0a;module_wmicolumn&#x20;LoadPercentage&#x0d;&#x0a;module_description&#x20;CPU&#x20;Load&#x20;&#40;%&#41;&#x0d;&#x0a;module_min_warning&#x20;80&#x0d;&#x0a;module_max_warning&#x20;90&#x0d;&#x0a;module_min_critical&#x20;91&#x0d;&#x0a;module_max_critical&#x20;0&#x0d;&#x0a;module_end','CPU&#x20;Load&#x20;&#40;using&#x20;WMI&#41;',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (18,'FreeMemory','#&#x20;Free&#x20;Memory&#x0d;&#x0a;module_begin&#x0d;&#x0a;module_name&#x20;FreeMemory&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_freepercentmemory&#x0d;&#x0a;module_description&#x20;Free&#x20;memory&#x20;&#40;%&#41;.&#x0d;&#x0a;module_min_warning&#x20;21&#x0d;&#x0a;module_max_warning&#x20;30&#x0d;&#x0a;module_min_critical&#x20;0&#x0d;&#x0a;module_max_critical&#x20;20&#x0d;&#x0a;module_end','Free&#x20;memory&#x20;&#40;%&#41;.',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (19,'Microsoft&#x20;Antivirus','module_begin&#x0d;&#x0a;module_name&#x20;Microsoft&#x20;Antivirus&#x0d;&#x0a;module_type&#x20;generic_proc&#x0d;&#x0a;module_service&#x20;MsMpSvc&#x0d;&#x0a;module_description&#x20;Check&#x20;if&#x20;microsoft&#x20;antivirus/malware&#x20;service&#x20;is&#x20;running&#x0d;&#x0a;module_end','Check&#x20;if&#x20;microsoft&#x20;antivirus/malware&#x20;service&#x20;is&#x20;running',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (21,'Microsoft&#x20;Firewall','module_begin&#x0d;&#x0a;module_name&#x20;Microsoft&#x20;Firewall&#x0d;&#x0a;module_type&#x20;generic_proc&#x0d;&#x0a;module_service&#x20;MpsSvc&#x0d;&#x0a;module_description&#x20;Microsoft&#x20;windows&#x20;firewall&#x20;status.&#x0d;&#x0a;module_end','Microsoft&#x20;windows&#x20;firewall&#x20;status.',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
@ -1116,7 +1116,7 @@ INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `o
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (34,'disk_root_free','module_begin&#x0d;&#x0a;module_name&#x20;disk_root_free&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-kh&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;100-$5&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition&#x0d;&#x0a;module_end','Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (35,'memfree','module_begin&#x0d;&#x0a;module_name&#x20;memfree&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;vmstat&#x20;-H&#x20;1&#x20;2&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$5}&#039;&#x0d;&#x0a;module_description&#x20;Unused&#x20;RAM&#x20;memory&#x0d;&#x0a;module_end&#x0d;&#x0a;','Free&#x20;memory&#x20;on&#x20;system',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (36,'sshDaemon','module_begin&#x0d;&#x0a;module_name&#x20;sshDaemon&#x0d;&#x0a;module_type&#x20;generic_proc&#x0d;&#x0a;module_exec&#x20;ps&#x20;-Af&#x20;|&#x20;grep&#x20;sshd&#x20;|&#x20;grep&#x20;-v&#x20;&quot;grep&quot;&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;sed&#x20;&quot;s/&#x20;//g&quot;&#x0d;&#x0a;module_end&#x0d;&#x0a;','Check&#x20;if&#x20;SSH&#x20;daemon&#x20;is&#x20;running',4,'',47,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (37,'cpu_user','module_begin&#x0d;&#x0a;module_name&#x20;cpu_user&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_interval&#x20;1&#x0d;&#x0a;module_exec&#x20;sar&#x20;1&#x20;2&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$2&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;User&#x20;CPU&#x20;Usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_min_warning&#x20;70&#x0d;&#x0a;module_max_warning&#x20;90&#x0d;&#x0a;module_min_critical&#x20;91&#x0d;&#x0a;module_max_critical&#x20;100&#x0d;&#x0a;module_end','User&#x20;CPU&#x20;Usage&#x20;&#40;%&#41;',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (37,'cpu_user','module_begin&#x0d;&#x0a;module_name&#x20;cpu_user&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_interval&#x20;1&#x0d;&#x0a;module_exec&#x20;sar&#x20;1&#x20;2&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$2&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;User&#x20;CPU&#x20;Usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_min_warning&#x20;70&#x0d;&#x0a;module_max_warning&#x20;90&#x0d;&#x0a;module_min_critical&#x20;91&#x0d;&#x0a;module_max_critical&#x20;0&#x0d;&#x0a;module_end','User&#x20;CPU&#x20;Usage&#x20;&#40;%&#41;',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (38,'Load&#x20;Average','module_begin&#x0d;&#x0a;module_name&#x20;Load&#x20;Average&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;uptime&#x20;|&#x20;sed&#x20;&#039;s/.*load&#x20;averages:&#x20;//&#039;|awk&#x20;&#039;{print&#x20;$1}&#039;&#x0d;&#x0a;module_description&#x20;Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;minute&#41;&#x0d;&#x0a;module_end&#x0d;&#x0a;','Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;minute&#41;',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (39,'Cache&#x20;mem&#x20;free','module_begin&#x0d;&#x0a;module_name&#x20;Cache&#x20;mem&#x20;free&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;vm_stat&#x20;|&#x20;grep&#x20;&#039;Pages&#x20;free&#039;|&#x20;awk&#x20;&#039;{print&#x20;$3/256}&#039;&#x0d;&#x0a;module_description&#x20;Free&#x20;cache&#x20;memory&#x20;in&#x20;MB&#x0d;&#x0a;module_min_warning&#x20;500&#x0d;&#x0a;module_max_warning&#x20;600&#x0d;&#x0a;module_min_critical&#x20;100&#x0d;&#x0a;module_max_critical&#x20;499&#x0d;&#x0a;module_end&#x0d;&#x0a;','Free&#x20;cache&#x20;memory&#x20;in&#x20;MB',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (40,'Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition','module_begin&#x0d;&#x0a;module_name&#x20;disk_root_free&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-kh&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;100-$5&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition&#x0d;&#x0a;module_min_warning&#x20;70&#x0d;&#x0a;module_max_warning&#x20;90&#x0d;&#x0a;module_min_critical&#x20;91&#x0d;&#x0a;module_max_critical&#x20;100&#x0d;&#x0a;module_end','Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
@ -1230,7 +1230,7 @@ INSERT INTO `tpolicies` VALUES (6,'Basic&#x20;Remote&#x20;Checks','Basic&#x20;Re
INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;ReceivedBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;SentBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_min_warning&#x20;79.00&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'CPU&#x20;usage&#x20;&#40;%&#41;','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_min_warning&#x20;79.00&#x0a;module_max_warning&#x20;90.00;module_min_critical&#x20;91.00&#x0a;module_max_critical&#x20;00.00;&#x0amodule_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'CPU&#x20;usage&#x20;&#40;%&#41;','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;tasklist&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;gawk&#x20;&quot;{print&#x20;$1}&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;&#40;&#40;get-date&#41;&#x20;-&#x20;&#40;gcim&#x20;Win32_OperatingSystem&#41;.LastBootUpTime&#x20;|&#x20;Select&#x20;-ExpandProperty&#x20;Ticks&#41;&#x20;/&#x20;100000&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin&#x0a;module_name&#x20;WMI&#x20;Service&#x0a;module_type&#x20;generic_proc&#x0a;module_service&#x20;winmgmt&#x0a;module_end&#x0a;&#x0a;',2,'WMI&#x20;Service&#x20;enabled','WMI&#x20;Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230907
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 230905
%define release 230907
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 230905
%define release 230907
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.773.3 Build 230905";
my $version = "7.0NG.773.3 Build 230907";
# Pandora server configuration
my %conf;

View File

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