From 09d64809c1d889923e302a77b62ef41ff9e38f7d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 6 Sep 2016 16:24:40 -0300 Subject: [PATCH] Bug 17261: Add memcached configuration info to about.pl This patch adds a row in the About > System information tab, showing the current configuration for memcached. To test: - Apply this patch, have memcached configured for the current instance (this is the default in kohadevbox) - Make sure you have the memcached server running: $ sudo service memcached start - Open the about page in the browser => SUCCESS: You get something like: Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running - Stop the memcached server: $ sudo service memcached stop - Reload the about page => SUCCESS: You get something like Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running - Set both MEMCACHED_* variables in the apache config for intranet the empty string: $ sudo vim /etc/apache2/sites-enabled/kohadev.conf .. SetEnv MEMCACHED_SERVERS "" #"127.0.0.1:11211" SetEnv MEMCACHED_NAMESPACE "" #"koha_kohadev" .. - Restart apache: $ sudo service apache2 restart - Reload the about page => SUCCESS: You get something like: Memcached: Servers: undefined| Namespace: undefined | Status: unknown - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- about.pl | 12 ++++++++++++ koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 8 ++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 13 +++++++++++++ 3 files changed, 33 insertions(+) diff --git a/about.pl b/about.pl index ca8ff9f..0fdceb2 100755 --- a/about.pl +++ b/about.pl @@ -70,6 +70,18 @@ if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { ); } +# Memcached configuration + +my $memcached_servers = $ENV{ MEMCACHED_SERVERS }; +my $memcached_namespace = $ENV{ MEMCACHED_NAMESPACE }; +my $memcached_running = C4::Context->ismemcached; + +$template->param( + memcached_servers => $ENV{ MEMCACHED_SERVERS }, + memcached_namespace => $ENV{ MEMCACHED_NAMESPACE }, + memcached_running => C4::Context->ismemcached +); + # Additional system information for warnings my $warnStatisticsFieldsError; diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index de0e492..d84a7bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -807,6 +807,14 @@ fieldset.rows .inputnote { color: #cc0000; } +.status_ok { + background-color: lightgreen; +} + +.status_warn { + background-color: red; +} + /* Font Awesome icon */ .error i { color: #CC0000; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index f004c75..f2b5e26 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -51,6 +51,19 @@ [% IF (is_psgi) %] PSGI: [% psgi_server |html %] [% END %] + Memcached: + Servers: [% IF memcached_servers %][% memcached_servers | html %] + [% ELSE %]undefined[% END %]| + Namespace: [% IF memcached_namespace %][% memcached_namespace | html %] + [% ELSE %]undefined[% END %] | + Status: [% IF memcached_servers %] + [% IF memcached_running %]running + [% ELSE %]not running[% END %] + [% ELSE %] + unknown + [% END %] + + Zebra version: [% zebraVersion |html %] [% IF (errZebraConnection == 10000) %] Error Zebra server seems not to be available. Is it started? -- 2.7.4