diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7013fdec54..cf664c3c2e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.772-230727 +Version: 7.0NG.772-230731 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 f8500d0a6a..fcd0f7713a 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.772-230727" +pandora_version="7.0NG.772-230731" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 23c6555256..efb5a851ac 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.772'; -use constant AGENT_BUILD => '230727'; +use constant AGENT_BUILD => '230731'; # 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 f665c4ae0c..367ce727cd 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.772 -%define release 230727 +%define release 230731 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 new file mode 100644 index 0000000000..226c73426b --- /dev/null +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -0,0 +1,168 @@ +# +#Pandora FMS Linux Agent +# +%global __os_install_post %{nil} +%define name pandorafms_agent_linux_bin +%define source_name pandorafms_agent_linux +%define version 7.0NG.772 +%define release 230725 + +Summary: Pandora FMS Linux agent, binary version +Name: %{name} +Version: %{version} +Release: %{release} +License: GPL +Vendor: ArticaST +Source0: %{source_name}-%{version}.tar.gz +URL: http://pandorafms.org +Group: System/Monitoring +Packager: Sancho Lerena +Prefix: /usr/share +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +BuildArch: noarch +Requires(pre): shadow-utils +Requires(post): chkconfig /bin/ln +Requires(preun): chkconfig /bin/rm /usr/sbin/userdel +Requires: coreutils unzip +Requires: util-linux procps grep +Requires: /sbin/ip /bin/awk +Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) +# Required by plugins +#Requires: sh-utils sed passwd net-tools rpm +AutoReq: 0 +Provides: %{name}-%{version} + +%description +Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software. + +%prep +rm -rf $RPM_BUILD_ROOT + +%setup -q -n unix + +%build + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +mkdir -p $RPM_BUILD_ROOT/usr/bin/ +mkdir -p $RPM_BUILD_ROOT/usr/sbin/ +mkdir -p $RPM_BUILD_ROOT/etc/pandora/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ +mkdir -p $RPM_BUILD_ROOT/var/log/pandora/ +mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ +cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ + +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew + +install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent + +if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then + rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec +fi + +%clean +rm -Rf $RPM_BUILD_ROOT + +%pre +getent passwd pandora >/dev/null || \ + /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora +exit 0 +chown pandora:root /var/log/pandora + +%post +if [ ! -d /etc/pandora ] ; then + mkdir -p /etc/pandora +fi + +if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then + cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf +fi + +if [ ! -f /etc/pandora/pandora_agent.conf ] ; then + ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf +else + [[ ! -f /etc/pandora/pandora_agent.conf.rpmnew ]] && ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew +fi + +if [ ! -e /etc/pandora/plugins ]; then + ln -s /usr/share/pandora_agent/plugins /etc/pandora +fi + +if [ ! -e /etc/pandora/collections ]; then + mkdir -p /usr/share/pandora_agent/collections + ln -s /usr/share/pandora_agent/collections /etc/pandora +fi + +if [ ! -e /etc/pandora/commands ]; then + mkdir -p /usr/share/pandora_agent/commands + ln -s /usr/share/pandora_agent/commands /etc/pandora +fi + +mkdir -p /var/spool/pandora/data_out +if [ ! -d /var/log/pandora ]; then + mkdir -p /var/log/pandora +fi + +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 + +# Upgrading +if [ "$1" = "1" ]; then + exit 0 +fi + +/sbin/chkconfig --del pandora_agent_daemon +/etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || : + +# Remove symbolic links +pushd /etc/pandora +for f in pandora_agent.conf plugins collections +do + [ -L $f ] && rm -f $f +done +exit 0 + +%files +%defattr(750,root,root) +/usr/bin/pandora_agent + +%defattr(755,pandora,root) +%{prefix}/pandora_agent + +%defattr(755,root,root) +/usr/bin/pandora_agent_exec +/usr/bin/tentacle_client +/etc/rc.d/init.d/pandora_agent_daemon + +%defattr(644,root,root) +/usr/share/man/man1/pandora_agent.1.gz +/usr/share/man/man1/tentacle_client.1.gz +%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4b18f27d76..82db72ff9a 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.772 -%define release 230727 +%define release 230731 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 fef5956bf4..9b5c149c66 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230727" +PI_BUILD="230731" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4f843bd95f..df59837034 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230727} +{230731} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5cd8134ac4..209bcae1d4 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.772 Build 230727") +#define PANDORA_VERSION ("7.0NG.772 Build 230731") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 378a849c43..1d5a5afd7c 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.772(Build 230727))" + VALUE "ProductVersion", "(7.0NG.772(Build 230731))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f2018f1954..2edba2be84 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230727 +Version: 7.0NG.772-230731 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 c50c6b47ce..88f61b7499 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.772-230727" +pandora_version="7.0NG.772-230731" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index c1a14a31f5..cbe7858e9e 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -300,7 +300,7 @@ if (enterprise_installed() === true) { // Parent agents. $paramsParentAgent = []; $paramsParentAgent['return'] = true; -$paramsParentAgent['show_helptip'] = false; +$paramsParentAgent['show_helptip'] = true; $paramsParentAgent['input_name'] = 'id_parent'; $paramsParentAgent['print_hidden_input_idagent'] = true; $paramsParentAgent['hidden_input_idagent_name'] = 'id_agent_parent'; @@ -646,7 +646,7 @@ if (enterprise_installed() === true) { // Parent agent. $tableAdvancedAgent->data['parent_agent'][] = html_print_label_input_block( - __('Parent'), + __('Agent parent'), ui_print_agent_autocomplete_input($paramsParentAgent) ); @@ -1205,15 +1205,30 @@ ui_require_jquery_file('bgiframe'); $("#cascade_protection_module").attr("disabled", 'disabled'); } - $("#checkbox-cascade_protection").change(function () { - var checked = $("#checkbox-cascade_protection").is(":checked"); - - if (checked) { + $("#text-id_parent").change(function(){ + const parent = $("#text-id_parent").val(); + if (parent != '') { + $("#checkbox-cascade_protection").prop('checked', true); $("#cascade_protection_module").removeAttr("disabled"); } else { $("#cascade_protection_module").val(0); $("#cascade_protection_module").attr("disabled", 'disabled'); + $("#text-id_parent").removeAttr("required"); + $("#cascade_protection_module").empty(); + $("#checkbox-cascade_protection").prop('checked', false); + } + }); + + $("#checkbox-cascade_protection").change(function () { + var checked = $("#checkbox-cascade_protection").is(":checked"); if (checked) { + $("#cascade_protection_module").removeAttr("disabled"); + $("#text-id_parent").attr("required", "required"); + } + else { + $("#cascade_protection_module").val(0); + $("#cascade_protection_module").attr("disabled", 'disabled'); + $("#text-id_parent").removeAttr("required"); } }); diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index bf56eb2e43..51cd554a66 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -559,6 +559,18 @@ if (enterprise_installed()) { ); } +$table->data[7][1] = html_print_label_input_block( + __('Max. days before disabled agents are deleted'), + html_print_input_text( + 'delete_disabled_agents', + $config['delete_disabled_agents'], + '', + false, + 0, + true + ) +); + $table_other = new stdClass(); $table_other->width = '100%'; $table_other->class = 'filter-table-adv'; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6a14082ea7..e95ec7ae0f 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 = 'PC230727'; +$build_version = 'PC230731'; $pandora_version = 'v7.0NG.772'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9ba72c9d28..afc0b41017 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -978,6 +978,10 @@ function config_update_config() } } + if (config_update_value('delete_disabled_agents', get_parameter('delete_disabled_agents'), true) === false) { + $error_update[] = __('Max. days before disabled agents are deleted'); + } + if (config_update_value('delete_old_messages', get_parameter('delete_old_messages'), true) === false) { $error_update[] = __('Max. days before delete old messages'); } @@ -2235,6 +2239,10 @@ function config_process_config() } } + if (!isset($config['delete_disabled_agents'])) { + config_update_value('delete_disabled_agents', 0); + } + if (!isset($config['delete_old_messages'])) { config_update_value('delete_old_messages', 21); } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index eb033bfec6..7b191d599a 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -88,8 +88,16 @@ function ui_bbcode_to_html($text, $allowed_tags=['[url]']) * * @return string Truncated text. */ -function ui_print_truncate_text($text, $numChars=GENERIC_SIZE_TEXT, $showTextInAToopTip=true, $return=true, $showTextInTitle=true, $suffix='…', $style=false) -{ +function ui_print_truncate_text( + $text, + $numChars=GENERIC_SIZE_TEXT, + $showTextInAToopTip=true, + $return=true, + $showTextInTitle=true, + $suffix='…', + $style=false, + $forced_title=false +) { global $config; if (is_string($numChars)) { @@ -190,6 +198,10 @@ function ui_print_truncate_text($text, $numChars=GENERIC_SIZE_TEXT, $showTextInA } } + if ($forced_title === true) { + $truncateText = ' img[data-title="No data"] { + margin-top: 5%; + margin-left: 20%; +} + .footer-self-monitoring { margin: 30px; font-style: italic; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 018cd7a0a6..b725e6260e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -31,6 +31,8 @@ --primary-color: #14524f; --secondary-color: #ffffff; --input-border: #c0ccdc; + --border-color: #eee; + --text-color: #333; } /* diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 652d777f72..a37b5ad4dc 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -20,6 +20,13 @@ Description: The default Pandora FMS theme layout // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +:root { + /* --primary-color: #14524f; */ + --secondary-color: #222; + --text-color: #fff; + /* --input-border: #c0ccdc; */ + --border-color: #484848; +} /* General styles */ body, diff --git a/pandora_console/install.php b/pandora_console/install.php index 0114a4f222..f4513d0bb4 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
$id_group_map, ], ); - hd('Entraaaa', true); - hd($exist, true); + if ($exist !== false) { $result_txt = ui_print_error_message(__('Another network map already exists with this name and group.')); } else { diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 0eb1bc152a..cedb2d6af3 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -486,19 +486,52 @@ if (is_ajax() === true) { } } + if (strlen($tmp->server_name) >= 10) { + $tmp->server_name = ui_print_truncate_text( + $tmp->server_name, + 10, + false, + true, + false, + '…', + true, + true, + ); + } + $tmp->evento = str_replace('"', '', io_safe_output($tmp->evento)); - if (strlen($tmp->evento) >= 255) { + $event_text = $tmp->evento; + if (strlen($tmp->evento) >= 40) { $tmp->evento = ui_print_truncate_text( $tmp->evento, - 255, - $tmp->evento, + 40, + false, + true, + false, + '…', + true, true, - false ); } if (empty($tmp->module_name) === false) { $tmp->module_name = io_safe_output($tmp->module_name); + if (strlen($tmp->module_name) >= 20) { + $tmp->module_name = ui_print_truncate_text( + $tmp->module_name, + 20, + false, + true, + false, + '…', + true, + true, + ); + } + } + + if (empty($tmp->comments) === false) { + $tmp->comments = ui_print_comments($tmp->comments, 20); } // Show last event. @@ -524,6 +557,32 @@ if (is_ajax() === true) { } $tmp->agent_name = io_safe_output($tmp->agent_name); + if (strlen($tmp->agent_name) >= 10) { + $tmp->agent_name = ui_print_truncate_text( + $tmp->agent_name, + 10, + false, + true, + false, + '…', + true, + true, + ); + } + + $tmp->id_extra = io_safe_output($tmp->id_extra); + if (strlen($tmp->id_extra) >= 10) { + $tmp->id_extra = ui_print_truncate_text( + $tmp->id_extra, + 10, + false, + true, + false, + '…', + true, + true, + ); + } $tmp->ack_utimestamp_raw = $tmp->ack_utimestamp; @@ -546,7 +605,7 @@ if (is_ajax() === true) { $total_sec = strtotime($tmp->timestamp); $total_sec += $dif; - $last_contact = date($config['date_format'], $total_sec); + $last_contact = date($confb64ig['date_format'], $total_sec); $last_contact_value = ui_print_timestamp($last_contact, true); } else { $title = date($config['date_format'], strtotime($tmp->timestamp)); @@ -572,8 +631,23 @@ if (is_ajax() === true) { } $tmp->instructions = events_get_instructions($item); + if (strlen($tmp->instructions) >= 20) { + $tmp->instructions = ui_print_truncate_text( + $tmp->instructions, + 20, + false, + true, + false, + '…', + true, + true, + ); + } + $aux_event = $tmp->evento; + $tmp->evento = $event_text; $tmp->b64 = base64_encode(json_encode($tmp)); + $tmp->evento = $aux_event; $tmp->user_comment = ui_print_comments( event_get_last_comment( @@ -827,6 +901,19 @@ if (is_ajax() === true) { $tmp->owner_user = get_user_fullname($tmp->owner_user).' ('.$tmp->owner_user.')'; } + if (strlen($tmp->owner_user) >= 10) { + $tmp->owner_user = ui_print_truncate_text( + $tmp->owner_user, + 10, + false, + true, + false, + '…', + true, + true, + ); + } + // Group name. if (empty($tmp->id_grupo) === true) { $tmp->id_grupo = __('All'); @@ -834,8 +921,33 @@ if (is_ajax() === true) { $tmp->id_grupo = $tmp->group_name; } + if (strlen($tmp->id_grupo) >= 10) { + $tmp->id_grupo = ui_print_truncate_text( + $tmp->id_grupo, + 10, + false, + true, + false, + '…', + true, + true, + ); + } + // Module name. $tmp->id_agentmodule = $tmp->module_name; + if (strlen($tmp->id_agentmodule) >= 10) { + $tmp->id_agentmodule = ui_print_truncate_text( + $tmp->id_agentmodule, + 10, + false, + true, + false, + '…', + true, + true, + ); + } // Options. // Show more. @@ -1066,6 +1178,18 @@ if (is_ajax() === true) { } $tmp->custom_data = $custom_data_str; + if (strlen($tmp->custom_data) >= 20) { + $tmp->custom_data = ui_print_truncate_text( + $tmp->custom_data, + 20, + false, + true, + false, + '…', + true, + true, + ); + } } $carry[] = $tmp; @@ -2400,7 +2524,7 @@ try { if (in_array('instructions', $fields) > 0) { $fields[array_search('instructions', $fields)] = [ 'text' => 'instructions', - 'class' => 'column-instructions', + 'class' => 'column-instructions mw60px', ]; } @@ -2417,6 +2541,16 @@ try { $fields[$comment_id] = ['text' => 'user_comment']; } + + foreach ($fields as $key => $field) { + if (is_array($field) === false) { + $fields[$key] = [ + 'text' => $field, + 'class' => 'mw100px', + ]; + } + } + // Always add options column. $fields = array_merge( $fields, @@ -2442,6 +2576,7 @@ try { } } + // mw60px // Open current filter quick reference. $active_filters_div = '
'; diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index d60cfd3308..8ae8698e3f 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.772 -%define release 230727 +%define release 230731 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index ad0fa12ce0..fda8acf24b 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.772 -%define release 230727 +%define release 230731 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 1e62dd19a7..b90c8cc19b 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.772 -%define release 230727 +%define release 230731 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index fb99535be3..cc9c9f79ce 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.772-230727 +Version: 7.0NG.772-230731 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 7181f2c079..4bc84d987a 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.772-230727" +pandora_version="7.0NG.772-230731" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index d69e7584a2..4e045bcbc2 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -46,7 +46,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.772"; -my $pandora_build = "230727"; +my $pandora_build = "230731"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 1b9e5ccd2b..083950ffb5 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.772"; -my $pandora_build = "230727"; +my $pandora_build = "230731"; 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 42feff643c..f7c4d9a701 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230727 +%define release 230731 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 90d7942c8c..61da1897fc 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230727 +%define release 230731 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6318b63f81..455a383bdd 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230727" +PI_BUILD="230731" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3566716ee6..2984ff944d 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.772 Build 230727"; +my $version = "7.0NG.772 Build 230731"; # Pandora server configuration my %conf; @@ -135,7 +135,16 @@ sub pandora_purgedb ($$$) { } } } - + + # Delete manually disabled agents after some period + if (defined ($conf->{'_delete_disabled_agents'}) && $conf->{'_delete_disabled_agents'} > 0) { + log_message('PURGE', "Deleting old disabled agents (More than " . $conf->{'_delete_disabled_agents'} . " days)."); + db_do ($dbh, "DELETE FROM tagente + WHERE UNIX_TIMESTAMP(ultimo_contacto) + ? < UNIX_TIMESTAMP(NOW()) + AND disabled = 1 + AND modo != 2", $conf->{'_delete_disabled_agents'} * 8600); + } + # Delete old data if ($conf->{'_days_purge'} > 0) { @@ -685,6 +694,7 @@ sub pandora_load_config_pdb ($) { $conf->{'_days_delete_not_initialized'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'days_delete_not_initialized'"); $conf->{'_delete_notinit'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_notinit'"); $conf->{'_inventory_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'inventory_purge'"); + $conf->{'_delete_disabled_agents'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_disabled_agents'"); $conf->{'_delete_old_messages'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_old_messages'"); $conf->{'_enterprise_installed'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'enterprise_installed'"); $conf->{'_metaconsole'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole'"); diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 201d9953d5..b2801c6b44 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.772 Build 230727"; +my $version = "7.0NG.772 Build 230731"; # save program name for logging my $progname = basename($0);