From 294eebd02787e4deaba800f7f5d5085673282eff Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2020 11:17:15 +0200 Subject: [PATCH] Bug 22417: Add rabbitmq status indicator on the about page Signed-off-by: Kyle M Hall --- about.pl | 12 ++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 22 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/about.pl b/about.pl index 56037c8aa5..14f555ecd9 100755 --- a/about.pl +++ b/about.pl @@ -43,6 +43,7 @@ use C4::Installer::PerlModules; use Koha; use Koha::DateUtils qw(dt_from_string output_pref); use Koha::Acquisition::Currencies; +use Koha::BackgroundJob; use Koha::BiblioFrameworks; use Koha::Patron::Categories; use Koha::Patrons; @@ -552,6 +553,17 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers ); } +{ + # BackgroundJob - test connection to message broker + eval { + Koha::BackgroundJob->connect; + }; + if ( $@ ) { + warn $@; + $template->param( warnConnectBroker => $@ ); + } +} + my %versions = C4::Context::get_versions(); $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index cc4ef76dec..7ab369b0e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -113,6 +113,17 @@ [% ELSIF (errZebraConnection) %] Warning Error message from Zebra: [% ( errZebraConnection ) | html %] [% END %] + + Message broker: + + Status: + [% IF warnConnectBroker %] + connection failed + [% ELSE %] + running + [% END %] + + Date and time: [% current_date_and_time | $KohaDates with_hours => 1 %] @@ -184,7 +195,7 @@
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker%] [% IF (warnIsRootUser) %]

Warning regarding current user

You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.

@@ -259,6 +270,15 @@ [% END %] [% END %] + [% IF warnConnectBroker %] +

Impossible to connect to the message broker

+ There is an error when trying to connect to the message broker (RabbitMQ), check the Koha log files. +
+ Maybe it is not installed and configured correctly? +
+ Contact your system administrator. + [% END %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %]

Warnings regarding the system configuration

-- 2.24.1 (Apple Git-126)