diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh
index 0b22878285..90c4bf6519 100755
--- a/extras/pandora_update_version.sh
+++ b/extras/pandora_update_version.sh
@@ -16,7 +16,7 @@ else
fi
VERSION=$2
if [ $# == 2 ]; then
- BUILD=`date +%g%m%d`
+ BUILD=`date +%y%m%d`
else
BUILD=$3
fi
diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf
index ad9f9f3c3d..969c6c3edc 100644
--- a/pandora_agents/pc/AIX/pandora_agent.conf
+++ b/pandora_agents/pc/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, AIX version
+# Version 7.0NG.730, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf
index 8de6468c19..968b8b2273 100644
--- a/pandora_agents/pc/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, FreeBSD Version
+# Version 7.0NG.730, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf
index 0c7582879b..1bb7afe932 100644
--- a/pandora_agents/pc/HP-UX/pandora_agent.conf
+++ b/pandora_agents/pc/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, HP-UX Version
+# Version 7.0NG.730, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf
index 17b4e3ec67..1032e972c3 100644
--- a/pandora_agents/pc/Linux/pandora_agent.conf
+++ b/pandora_agents/pc/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, GNU/Linux
+# Version 7.0NG.730, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf
index 15f274095a..27d6bc2499 100644
--- a/pandora_agents/pc/NT4/pandora_agent.conf
+++ b/pandora_agents/pc/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, GNU/Linux
+# Version 7.0NG.730, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf
index b4e901951d..86860f55e6 100644
--- a/pandora_agents/pc/SunOS/pandora_agent.conf
+++ b/pandora_agents/pc/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, Solaris Version
+# Version 7.0NG.730, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf
index bbf52b6bc1..5e5d0580e6 100644
--- a/pandora_agents/pc/Win32/pandora_agent.conf
+++ b/pandora_agents/pc/Win32/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
-# Version 7.0NG.729
+# Version 7.0NG.730
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf
index 72375ecebe..1b3ba629b7 100644
--- a/pandora_agents/shellscript/aix/pandora_agent.conf
+++ b/pandora_agents/shellscript/aix/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.729, AIX version
+# Version 7.0NG.730, AIX version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
index 6d08062786..4ed22c0a3e 100644
--- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
+++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.729
+# Version 7.0NG.730
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena
diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
index 9b452127ca..22faee00e8 100644
--- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf
+++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.729, HPUX Version
+# Version 7.0NG.730, HPUX Version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf
index c8ebc2b25f..a784ce4fc0 100644
--- a/pandora_agents/shellscript/linux/pandora_agent.conf
+++ b/pandora_agents/shellscript/linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729
+# Version 7.0NG.730
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
index d0044b7398..456802c06a 100644
--- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf
+++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729
+# Version 7.0NG.730
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf
index 53b696ba06..44e244c74e 100644
--- a/pandora_agents/shellscript/openWRT/pandora_agent.conf
+++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729
+# Version 7.0NG.730
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf
index c592279323..fdb61b9888 100644
--- a/pandora_agents/shellscript/solaris/pandora_agent.conf
+++ b/pandora_agents/shellscript/solaris/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.729, Solaris version
+# Version 7.0NG.730, Solaris version
# General Parameters
# ==================
diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf
index 64671fae84..54451441dd 100644
--- a/pandora_agents/unix/AIX/pandora_agent.conf
+++ b/pandora_agents/unix/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, AIX version
+# Version 7.0NG.730, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 91d97ac889..758ee6811a 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-agent-unix
-Version: 7.0NG.729-181211
+Version: 7.0NG.730-190116
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index aee81acb54..4e5706c7cf 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.729-181211"
+pandora_version="7.0NG.730-190116"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf
index 160a20b253..2c4ea59daa 100644
--- a/pandora_agents/unix/Darwin/pandora_agent.conf
+++ b/pandora_agents/unix/Darwin/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, GNU/Linux
+# Version 7.0NG.730, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf
index e97a1675fb..3feebad741 100644
--- a/pandora_agents/unix/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, FreeBSD Version
+# Version 7.0NG.730, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf
index 366928ea65..b0f9dd590e 100644
--- a/pandora_agents/unix/HP-UX/pandora_agent.conf
+++ b/pandora_agents/unix/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, HP-UX Version
+# Version 7.0NG.730, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf
index e6a3200726..2679f78617 100644
--- a/pandora_agents/unix/Linux/pandora_agent.conf
+++ b/pandora_agents/unix/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, GNU/Linux
+# Version 7.0NG.730, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf
index c3f4b791f1..8d3736b35f 100644
--- a/pandora_agents/unix/NT4/pandora_agent.conf
+++ b/pandora_agents/unix/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, GNU/Linux
+# Version 7.0NG.730, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf
index 8efe821f74..e0eea4b59e 100644
--- a/pandora_agents/unix/NetBSD/pandora_agent.conf
+++ b/pandora_agents/unix/NetBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, NetBSD Version
+# Version 7.0NG.730, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf
index b32f162d4b..30ac06a0ca 100644
--- a/pandora_agents/unix/SunOS/pandora_agent.conf
+++ b/pandora_agents/unix/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.729, Solaris Version
+# Version 7.0NG.730, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index e6070a42d7..9646cee020 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
-use constant AGENT_VERSION => '7.0NG.729';
-use constant AGENT_BUILD => '181211';
+use constant AGENT_VERSION => '7.0NG.730';
+use constant AGENT_BUILD => '190116';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@@ -516,11 +516,18 @@ sub parse_conf_modules($) {
log_message ('setup', "Invalid regular expression in intensive condition: $line");
}
}
- } elsif ($line =~ /^\s*module_crontab\s+(((\*|(\d+(-\d+){0,1}))\s*){5}).*$/) {
+ } elsif ($line =~ /^\s*module_crontab\s+(.*)$/) {
my $cron_text = $1;
chomp ($cron_text);
+ $cron_text =~ s/\s+$//;
+ # Get module name if is already read.
+ my $module_name_message = "";
+ $module_name_message = " (module $module->{'name'})" if defined($module->{'name'});
if (cron_check_syntax($cron_text)) {
$module->{'cron'} = $cron_text;
+ log_message('debug', "Cron '$module->{'cron'}' configured $module_name_message.");
+ } else {
+ log_message('setup', "Incorrect cron syntax '$cron_text'. This module$module_name_message will be executed always.");
}
} elsif ($line =~ /^\s*module_end\s*$/) {
@@ -2397,6 +2404,7 @@ sub check_module_cron {
$interval
);
+ my $is_first = ($module->{'cron_utimestamp'} == 0) ? 1 : 0;
$module->{'cron_utimestamp'} = $now + $time_to_next_execution;
$module->{'cron_interval'} = $time_to_next_execution;
@@ -2405,7 +2413,7 @@ sub check_module_cron {
}
# On first execution checking if cron is valid is required
- return 1 unless ($module->{'cron_utimestamp'} == 0);
+ return 1 unless ($is_first);
# Check if current timestamp is a valid cron date
my $next_execution = cron_next_execution_date(
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index d4a375c7e7..bd1b569af4 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.729
-%define release 181211
+%define version 7.0NG.730
+%define release 190116
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 745cf21973..1156c6297a 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.729
-%define release 181211
+%define version 7.0NG.730
+%define release 190116
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 1632cf5448..b4c3b66bab 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
-PI_VERSION="7.0NG.729"
-PI_BUILD="181211"
+PI_VERSION="7.0NG.730"
+PI_BUILD="190116"
OS_NAME=`uname -s`
FORCE=0
diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf
index 9ba6eff68d..795842f5f5 100644
--- a/pandora_agents/win32/bin/pandora_agent.conf
+++ b/pandora_agents/win32/bin/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
-# Version 7.0NG.729
+# Version 7.0NG.730
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 652c522463..3c639031de 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
-{Pandora FMS Windows Agent v7.0NG.729}
+{Pandora FMS Windows Agent v7.0NG.730}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{181211}
+{190116}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 5cbaba25c9..87cec0dbac 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.729(Build 181211)")
+#define PANDORA_VERSION ("7.0NG.730(Build 190116)")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index b4d4b3b4f4..91df373d23 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
- VALUE "ProductVersion", "(7.0NG.729(Build 181211))"
+ VALUE "ProductVersion", "(7.0NG.730(Build 190116))"
VALUE "FileVersion", "1.0.0.0"
END
END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 9900f8db7e..d7e1669bf6 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-console
-Version: 7.0NG.729-181211
+Version: 7.0NG.730-190116
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 8ffb10a322..af3a24ea27 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.729-181211"
+pandora_version="7.0NG.730-190116"
package_pear=0
package_pandora=1
diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php
index 97ffe031a9..c7d21fff1a 100644
--- a/pandora_console/ajax.php
+++ b/pandora_console/ajax.php
@@ -14,6 +14,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
+// Enable profiler for testing
+if (!defined("__PAN_XHPROF__")) define ("__PAN_XHPROF__", 0);
+
+if (__PAN_XHPROF__ === 1) {
+ if (function_exists('tideways_xhprof_enable')) {
+ tideways_xhprof_enable();
+ }
+}
+
if ((! file_exists("include/config.php")) || (! is_readable("include/config.php"))) {
exit;
}
@@ -88,4 +97,8 @@ if (file_exists ($page)) {
else {
echo '
Sorry! I can\'t find the page '.$page.'!';
}
+
+if (__PAN_XHPROF__ === 1) {
+ pandora_xhprof_display_result("ajax", "console");
+}
?>
diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index b7eca3b3e9..18ba051b60 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -61,17 +61,27 @@ function mainModuleGroups() {
$info = groupview_plain_groups($info);
$counter = count($info);
$offset = get_parameter('offset', 0);
- $groups_view = $is_not_paginated
- ? $info
- : array_slice($info, $offset, $config['block_size']);
- $agents_counters = array_reduce($groups_view, function($carry, $item){
- $carry[$item['id']] = $item;
- return $carry;
- }, array());
+ $agent_group_search = get_parameter('agent_group_search', '');
+ $module_group_search = get_parameter('module_group_search', '');
- $ids_array = array_keys($agents_counters);
+ $info = array_filter($info, function($v, $k) use ($agent_group_search) {
+ return preg_match("/$agent_group_search/i", $v['name']);
+ }, ARRAY_FILTER_USE_BOTH);
- $ids_group = implode(',', $ids_array);
+ if (!empty($info)) {
+ $groups_view = $is_not_paginated
+ ? $info
+ : array_slice($info, $offset, $config['block_size']);
+ $agents_counters = array_reduce($groups_view, function($carry, $item){
+ $carry[$item['id']] = $item;
+ return $carry;
+ }, array());
+
+ $ids_array = array_keys($agents_counters);
+
+ $ids_group = implode(',', $ids_array);
+ } else
+ $ids_group = -1;
$condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT);
$condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT);
@@ -90,6 +100,12 @@ function mainModuleGroups() {
$array_module_group[$value['id_mg']] = $value['name'];
}
$array_module_group[0] = 'Nothing';
+
+
+ $array_module_group = array_filter($array_module_group, function($v, $k) use ($module_group_search) {
+ return preg_match("/$module_group_search/i", $v);
+ }, ARRAY_FILTER_USE_BOTH);
+
foreach ($agents_counters as $key => $value) {
$array_for_defect[$key]['gm'] = $array_module_group;
$array_for_defect[$key]['data']['name'] = $value['name'];
@@ -167,7 +183,26 @@ $sql =
ui_print_page_header (__("Combined table of agent group and module group"), "images/module_group.png", false, "", false, '');
- if(count($array_for_defect) > 0){
+ echo "