diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 8db984fcac..a8976d5b1d 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.748, AIX version +# Version 7.0NG.749, 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 556ed487a7..db354ce74e 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.748, FreeBSD Version +# Version 7.0NG.749, 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 c1da6574a0..35ab968b83 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.748, HP-UX Version +# Version 7.0NG.749, 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 3151bba156..d01aedfcb6 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.748, GNU/Linux +# Version 7.0NG.749, 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 f1519cae0b..d3d6bbe3ad 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.748, GNU/Linux +# Version 7.0NG.749, 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 c058969154..a1c0730d7d 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.748, Solaris Version +# Version 7.0NG.749, 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 36f45e7821..58f0273c5f 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.748 +# Version 7.0NG.749 # 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 5cf06e1f73..0a03ed9406 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.748, AIX version +# Version 7.0NG.749, 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 2e910275a3..960b5c6571 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.748 +# Version 7.0NG.749 # 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 9f48dbc4a2..06f9dad4e7 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.748, HPUX Version +# Version 7.0NG.749, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 231f062798..c648bdbc26 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.748 +# Version 7.0NG.749 # 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 5e6ccf8344..c8806e32c8 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.748 +# Version 7.0NG.749 # 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 3ea473e72e..c11692b728 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.748 +# Version 7.0NG.749 # 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 a7665291a5..59db4e115a 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.748, Solaris version +# Version 7.0NG.749, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 7b064f83f8..f81cfe787c 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.748, AIX version +# Version 7.0NG.749, 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 97064eec0b..3d527b8cd7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.748-200907 +Version: 7.0NG.749-200914 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 0fdfbcb2a1..596f81cff4 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.748-200907" +pandora_version="7.0NG.749-200914" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null @@ -81,6 +81,9 @@ cp -aRf man/man1/* temp_package/usr/share/man/man1/ # Relocate plugins to the final dir and delete cp temp_package/usr/share/pandora_agent/plugins/* temp_package/etc/pandora/plugins +# Make sure the plugins have execution privileges +chmod 755 temp_package/etc/pandora/plugins/* + echo "Official plugins are placed on /etc/pandora/plugins" > temp_package/usr/share/pandora_agent/plugins/README #Disabled, now the package overwrite the previous files. diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index d210575bcc..f0f43f80e0 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.748, GNU/Linux +# Version 7.0NG.749, 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 50a374dd1e..33b2fe1271 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.748, FreeBSD Version +# Version 7.0NG.749, 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 c5214a85eb..717a1e6e2a 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.748, HP-UX Version +# Version 7.0NG.749, 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 cdd9bec203..36ea7c62de 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.748, GNU/Linux +# Version 7.0NG.749, 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 5999f2211b..fbde635047 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.748, GNU/Linux +# Version 7.0NG.749, 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 33914c658e..fafa8485f6 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.748, NetBSD Version +# Version 7.0NG.749, 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 afbebccdf3..a533c29424 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.748, Solaris Version +# Version 7.0NG.749, 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 4fbc75c527..114b43ec57 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -54,8 +54,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.748'; -use constant AGENT_BUILD => '200907'; +use constant AGENT_VERSION => '7.0NG.749'; +use constant AGENT_BUILD => '200914'; # 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 18b5328603..9bf329687c 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.748 -%define release 200907 +%define version 7.0NG.749 +%define release 200914 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -108,8 +108,27 @@ mkdir -p /var/spool/pandora/data_out if [ ! -d /var/log/pandora ]; then mkdir -p /var/log/pandora fi -/sbin/chkconfig --add pandora_agent_daemon -/sbin/chkconfig pandora_agent_daemon on + +if [ `command -v systemctl` ]; +then + echo "Copying new version of pandora_agent_daemon service" + cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service +# Enable the services on SystemD + systemctl enable pandora_agent_daemon.service +else + /sbin/chkconfig --add pandora_agent_daemon + /sbin/chkconfig pandora_agent_daemon on +fi + +if [ "$1" -gt 1 ] +then + + echo "If Pandora Agent daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + %preun diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 64b8922da2..7ba1cc09cc 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.748 -%define release 200907 +%define version 7.0NG.749 +%define release 200914 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -98,11 +98,27 @@ fi cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent -# Enable the service on SystemD -systemctl enable pandora_agent_daemon.service - mkdir -p /var/spool/pandora/data_out -chkconfig pandora_agent_daemon on + +if [ `command -v systemctl` ]; +then + echo "Copying new version of pandora_agent_daemon service" + cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service +# Enable the services on SystemD + systemctl enable pandora_agent_daemon.service +else + chkconfig pandora_agent_daemon on +fi + +if [ "$1" -gt 1 ] +then + + echo "If Pandora Agent daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + %preun diff --git a/pandora_agents/unix/pandora_agent_daemon.service b/pandora_agents/unix/pandora_agent_daemon.service index 182144d1e7..103ca44167 100644 --- a/pandora_agents/unix/pandora_agent_daemon.service +++ b/pandora_agents/unix/pandora_agent_daemon.service @@ -4,6 +4,8 @@ After=network-online.target [Service] ExecStart=/usr/bin/pandora_agent /etc/pandora +Restart=on-failure +RestartPreventExitStatus=1 [Install] WantedBy=multi-user.target diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 14220bb11f..8ccc59fef6 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.748" -PI_BUILD="200907" +PI_VERSION="7.0NG.749" +PI_BUILD="200914" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/inventory b/pandora_agents/unix/plugins/inventory index b361bb43ac..bca287e7ba 100755 --- a/pandora_agents/unix/plugins/inventory +++ b/pandora_agents/unix/plugins/inventory @@ -460,15 +460,19 @@ close (FILE); $Mode = 'LSHW'; $Separator = '\s+\*\-'; my @hwinfo; +my $lshwpath = $0 =~ s/inventory/lshw/r ; if (is_enabled $AIX) { $Separator = '^\s*$'; @hwinfo=`prtconf 2>/dev/null`; } else { @hwinfo = `lshw 2>/dev/null`; if ($? != 0) { - $Mode = 'HWINFO'; - $Separator = 'Hardware Class:'; - @hwinfo = `hwinfo --cpu --memory --gfxcard --netcard --cdrom --disk 2>/dev/null`; + @hwinfo = `$lshwpath 2>/dev/null`; + if ($? != 0) { + $Mode = 'HWINFO'; + $Separator = 'Hardware Class:'; + @hwinfo = `hwinfo --cpu --memory --gfxcard --netcard --cdrom --disk 2>/dev/null`; + } } } diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index f3037deb21..91aee94a6f 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.748 +# Version 7.0NG.749 # 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 40d8d4e9cc..41166f90a0 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.748} +{Pandora FMS Windows Agent v7.0NG.749} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200907} +{200914} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5c82273491..f413a84c06 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.748(Build 200907)") +#define PANDORA_VERSION ("7.0NG.749(Build 200914)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9d7f24960e..7cf77213e7 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.748(Build 200907))" + VALUE "ProductVersion", "(7.0NG.749(Build 200914))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5bd4793a95..7ed7a10561 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.748-200907 +Version: 7.0NG.749-200914 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 d9a6567d29..12d1ac2942 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.748-200907" +pandora_version="7.0NG.749-200914" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 56f5099350..2d9fa11209 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,8 +20,8 @@ /** * Pandora build version and version */ -$build_version = 'PC200907'; -$pandora_version = 'v7.0NG.748'; +$build_version = 'PC200914'; +$pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/install.php b/pandora_console/install.php index 782cdf70a5..578eefdf31 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -128,8 +128,8 @@
create(\&pandora_process_event_replication, \%Config) if($Config{'__enterprise_enabled'} == 1 && $Config{'event_replication'} == 1); - # Update the agent cache. Do not start with start_server_thread, this thread updates the agent cache and exits. - threads->create(\&enterprise_hook, 'update_agent_cache', [\%Config])->detach() if ($Config{'node_metaconsole'} == 1); - pandora_audit (\%Config, $Config{'rb_product_name'} . ' Server Daemon starting', 'SYSTEM', 'System', $DBH); # Load servers @@ -288,11 +285,21 @@ sub pandora_server_tasks ($) { # Get the console DB connection my $dbh = db_connect ($pa_config->{'dbengine'}, $pa_config->{'dbname'}, $pa_config->{'dbhost'}, $pa_config->{'dbport'}, - $pa_config->{'dbuser'}, $pa_config->{'dbpass'}); + $pa_config->{'dbuser'}, $pa_config->{'dbpass'}); my $counter = 0; + my $first_run = 1; while ($THRRUN == 1) { if (pandora_is_master($pa_config) == 1) { + # TASKS EXECUTED ONCE + # ------------------- + if ($first_run == 1) { + $first_run = 0; + + # Update the agent cache. + enterprise_hook('update_agent_cache', [\%Config]); + } + # TASKS EXECUTED EVERY 5 SECONDS (Low latency tasks) # -------------------------------------------------- if (($counter % 5) == 0) { diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index fbb2a22625..3aa0a219c9 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -1,7 +1,7 @@ ############################################################################# # Pandora FMS Server Parameters # Pandora FMS, the Flexible Monitoring System. -# Version 7.0NG.748 +# Version 7.0NG.749 # Licensed under GPL license v2, # (c) 2003-2017 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 982a4cd715..2dfbfbea3d 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -44,8 +44,8 @@ our @EXPORT = qw( ); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.748"; -my $pandora_build = "200907"; +my $pandora_version = "7.0NG.749"; +my $pandora_build = "200914"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index fcbdfda6cb..3eff8e2384 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1717,9 +1717,9 @@ sub pandora_process_module ($$$$$$$$$;$) { my $last_error = defined ($module->{'last_error'}) ? $module->{'last_error'} : $agent_status->{'last_error'}; my $ff_start_utimestamp = $agent_status->{'ff_start_utimestamp'}; my $mark_for_update = 0; - + # tagente_estado.last_try defaults to NULL, should default to '1970-01-01 00:00:00' - $agent_status->{'last_try'} = '1970-01-01 00:00:00' unless defined ($agent_status->{'last_try'}); + $agent_status->{'last_try'} = '1970-01-01 00:00:00' unless defined ($agent_status->{'last_try'}); $agent_status->{'datos'} = "" unless defined($agent_status->{'datos'}); # Do we have to save module data? @@ -1732,24 +1732,13 @@ sub pandora_process_module ($$$$$$$$$;$) { my $last_try = ($1 == 0) ? 0 : strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900); my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0; - + # Received stale data. Save module data if needed and return. if ($pa_config->{'dataserver_lifo'} == 1 && $utimestamp <= $agent_status->{'utimestamp'}) { logger($pa_config, "Received stale data from agent " . (defined ($agent) ? "'" . $agent->{'nombre'} . "'" : 'ID ' . $module->{'id_agente'}) . ".", 10); - - # Save module data. Async and log4x modules are not compressed. - if ($module_type =~ m/(async)|(log4x)/ || $save == 1) { - - # If previous timestamp data changes, save the last one to avoid errors on SLA or graphs. - if($last_data_value ne $processed_data) { - - my $last_data_timestamp = $agent_status->{'utimestamp'}; - my $last_data_object; - - $last_data_object->{'data'} = $last_data_value; - - save_module_data ($last_data_object, $module, $module_type, $last_data_timestamp, $dbh); - } + + # Save module data. Compression does not work for stale data. + if ($module->{'history_data'} == 1) { save_module_data ($data_object, $module, $module_type, $utimestamp, $dbh); } diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 04d3b3918d..8dbf9b553f 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,8 +32,8 @@ use base 'Exporter'; our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.748"; -my $pandora_build = "200907"; +my $pandora_version = "7.0NG.749"; +my $pandora_build = "200914"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 156fe53754..e9b61737d3 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.748 -%define release 200907 +%define version 7.0NG.749 +%define release 200914 Summary: Pandora FMS Server Name: %{name} @@ -110,20 +110,34 @@ exit 0 %post # Initial installation -if [ "$1" = 1 ]; then - /sbin/chkconfig --add pandora_server - /sbin/chkconfig --add tentacle_serverd - /sbin/chkconfig pandora_server on - /sbin/chkconfig tentacle_serverd on +# Run when not uninstalling +if [ "$1" -ge 1 ] +then + if [ `command -v systemctl` ] + then + echo "Copying new version for tentacle_serverd service" + cp -f /usr/share/pandora_server/util/tentacle_serverd.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/tentacle_serverd.service + # Enable the services on SystemD + systemctl enable tentacle_serverd.service + else + /sbin/chkconfig --add tentacle_serverd + /sbin/chkconfig tentacle_serverd on + fi - echo "Pandora FMS Server configuration is %{_sysconfdir}/pandora/pandora_server.conf" - echo "Pandora FMS Server main directory is %{prefix}/pandora_server/" - echo "The manual can be reached at: man pandora or man pandora_server" - echo "Pandora FMS Documentation is in: http://pandorafms.org" - echo " " + /sbin/chkconfig --add pandora_server + /sbin/chkconfig pandora_server on + + systemctl enable pandora_server.service + + echo "Pandora FMS Server configuration is %{_sysconfdir}/pandora/pandora_server.conf" + echo "Pandora FMS Server main directory is %{prefix}/pandora_server/" + echo "The manual can be reached at: man pandora or man pandora_server" + echo "Pandora FMS Documentation is in: http://pandorafms.org" + echo " " fi -# This will avoid confi files overwritting on UPGRADES. +# This will avoid config files overwritting on UPGRADES. # Main configuration file if [ ! -e "/etc/pandora/pandora_server.conf" ] then @@ -144,6 +158,14 @@ fi echo "Don't forget to start Tentacle Server daemon if you want to receive" echo "data using tentacle" +if [ "$1" -gt 1 ] +then + + echo "If Tentacle Server daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + %preun # Upgrading diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e553d30911..7986d3c5a9 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.748 -%define release 200907 +%define version 7.0NG.749 +%define release 200914 Summary: Pandora FMS Server Name: %{name} @@ -102,11 +102,21 @@ fi exit 0 %post -chkconfig pandora_server on -chkconfig tentacle_serverd on +if [ `command -v systemctl` ]; +then + echo "Copying new version for tentacle_serverd service" + cp -f /usr/share/pandora_server/util/tentacle_serverd.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/tentacle_serverd.service -# Enable the services on SystemD -systemctl enable tentacle_serverd.service +# Enable the service on SystemD + systemctl enable tentacle_serverd.service +else + chkconfig tentacle_serverd on +fi + +chkconfig pandora_server on + +# Enable the service on SystemD systemctl enable pandora_server.service @@ -139,6 +149,14 @@ fi echo "Don't forget to start Tentacle Server daemon if you want to receive" echo "data using tentacle" +if [ "$1" -gt 1 ] +then + + echo "If Tentacle Server daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + exit 0 %preun diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 20cf5bad1c..54e8274fe6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -8,8 +8,8 @@ # This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.748" -PI_BUILD="200907" +PI_VERSION="7.0NG.749" +PI_BUILD="200914" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 98336baeb6..8ced13b9e6 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.748 PS200907"; +my $version = "7.0NG.749 PS200914"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d43aff7b23..0fcfee0812 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.748 PS200907"; +my $version = "7.0NG.749 PS200914"; # save program name for logging my $progname = basename($0); diff --git a/pandora_server/util/tentacle_serverd.service b/pandora_server/util/tentacle_serverd.service index e5c3bfad3e..fb6d2af2e3 100644 --- a/pandora_server/util/tentacle_serverd.service +++ b/pandora_server/util/tentacle_serverd.service @@ -1,11 +1,14 @@ [Unit] Description=Tentacle server daemon After=network-online.target +Requires=network.target [Service] Type=forking ExecStart=/usr/bin/tentacle_server -F /etc/tentacle/tentacle_server.conf User=pandora +Restart=on-failure +RestartPreventExitStatus=1 [Install] WantedBy=multi-user.target