diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6ce3b2c9a4..a92a79704f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231006 +Version: 7.0NG.773.3-231009 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 68ec6eb001..620851f5ec 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.773.3-231006" +pandora_version="7.0NG.773.3-231009" 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 44f909aee8..46a654561f 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -239,8 +239,34 @@ module_exec df -kh / | tail -1 | awk '{ print 100-$5 }' module_max 100 module_min 0 module_description Free disk Percentage of root partition -module_min_warning 70 -module_max_warning 90 -module_min_critical 91 -module_max_critical 100 +module_min_warning 10 +module_max_warning 20 +module_min_critical 0 +module_max_critical 10 module_end + +# Sample modules to check connectivity from your mac +#module_begin +#module_name Packet_loss +#module_type generic_data +#module_exec ping 8.8.8.8 -c 5 | grep "packet loss" | cut -d " " -f 7 | grep -o "[0-9\.]*" +#module_end + +#module_begin +#module_name Internet_Latency +#module_type generic_data +#module_exec ping -c 1 8.8.8.8 | grep "time"| cut -f 4 -d "=" | grep -o "[0-9\.]*" +#module_end + +#module_begin +#module_name Internet_check +#module_type generic_proc +#module_exec ping 8.8.8.8 -c 2 | grep "2 packets received" | wc -l +#module_end + +# Check a running process +#module_begin +#module_name Cyberduck +#module_type generic_proc +#module_exec ps aux | grep cyberduck | grep -v grep | wc -l +#module_end diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 5a28dfdf69..2d47136f63 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231006'; +use constant AGENT_BUILD => '231009'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index cd41f8fc05..08b764f51b 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231006 +%define release 231009 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index bf54a938bd..e4d91ef456 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231006 +%define release 231009 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index ff436e7d7f..efa33579b4 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231006 +%define release 231009 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 3da5c53058..c94bb52d1e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231006" +PI_BUILD="231009" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 092beddc92..64665b90d3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231006} +{231009} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8cf437a801..fe6c911fe9 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.773.3 Build 231006") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231009") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 24d2ecdaa3..13e4caccbe 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -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 231006))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231009))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7590ffa286..eac67470fa 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231006 +Version: 7.0NG.773.3-231009 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 94ec30602b..1f2a64f9a3 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.773.3-231006" +pandora_version="7.0NG.773.3-231009" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index c54687fc48..24a465a948 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC231006'; +$build_version = 'PC231009'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index ce15b4b626..39f1642fa0 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -149,6 +149,26 @@ function reporting_get_name($id_report) } +/** + * Frees memory in case of fatal error. + * + * @param mixed $memory Object that reserves memory. + * + * @return void + */ +function shutdown($memory) +{ + // Unsetting $memory does not free up memory. + // I also tried unsetting a global variable which did not free up the memory. + unset($memory->reserve); + + $error = error_get_last(); + if (isset($error['type']) === true && $error['type'] === 1) { + echo __('You have no memory for this operation, increase the memory limit.'); + } +} + + function reporting_make_reporting_data( $report, $id_report, @@ -170,6 +190,11 @@ function reporting_make_reporting_data( enterprise_include_once('include/functions_metaconsole.php'); + $memory = new stdClass(); + // Reserve 3 mega bytes. + $memory->reserve = str_repeat('*', (1024 * 1024)); + register_shutdown_function('shutdown', $memory); + $return = []; if (!empty($report)) { $contents = io_safe_output($report['contents']); diff --git a/pandora_console/install.php b/pandora_console/install.php index b6c141f048..b874e818fc 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@