Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

No link icon to Knowledge base #5352

Closed
Mitchou opened this issue Jun 16, 2017 · 6 comments
Closed

No link icon to Knowledge base #5352

Mitchou opened this issue Jun 16, 2017 · 6 comments
Assignees
Labels
status/more-info-needed Waiting for more information

Comments

@Mitchou
Copy link

Mitchou commented Jun 16, 2017


BUG REPORT INFORMATION

Centreon Web version: 2.8.9

Centreon Engine version: 1.7.2

Centreon Broker version: 3.0.7

OS: CentOS release 6.9 (Final)

Additional environment details (AWS, VirtualBox, physical, etc.): Imported .ova file into VMware

Steps to reproduce the issue:

  1. Install Mediawiki from yum
  2. Configure Knowledge base in Centreon
  3. Make an article in Mediawiki from Centreon

When we create an article in Mediawiki from Centreon, we don't have a link icon in server/services list.
Even after the 5 minutes of cron task.

Error in centKnowledgeSynchronizer.php

PHP Fatal error: Uncaught exception 'Exception' with message 'An error occured, please check your Knowledge base configuration' in /usr/share/centreon/www/class/centreon-knowledge/wikiApi.class.php:98
Stack trace:
#0 /usr/share/centreon/www/class/centreon-knowledge/wikiApi.class.php(66): WikiApi->getWikiVersion()
#1 /usr/share/centreon/cron/centKnowledgeSynchronizer.php(38): WikiApi->__construct()
#2 {main}
thrown in /usr/share/centreon/www/class/centreon-knowledge/wikiApi.class.php on line 98

We see our article in Knowledge base configuration with text "Wiki page defined "

Describe the results you expected:
Have a link icon on every alert in server/services list with article created

Additional information you think important (e.g. issue happens only occasionally):
Work few days when I closed my issue, but error came back without solution this time

@Mitchou Mitchou changed the title No link to Knowledge base No link icon to Knowledge base Jun 16, 2017
@Mitchou Mitchou closed this as completed Jun 16, 2017
@Mitchou Mitchou reopened this Jun 23, 2017
@lpinsivy
Copy link
Contributor

lpinsivy commented Aug 2, 2017

Hi,

Which version of mediawiki do you use?

Regards,

@lpinsivy lpinsivy added the status/more-info-needed Waiting for more information label Aug 2, 2017
@Mitchou
Copy link
Author

Mitchou commented Aug 2, 2017

Hi,

MediaWiki 1.21.2 installed from RPM on our centreon-VM

Curl of MediaWiki:
<meta name="generator" content="MediaWiki 1.21.2" />

Linux Version:

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.9 (Final)
Release:        6.9
Codename:       Final

@Mitchou
Copy link
Author

Mitchou commented Aug 2, 2017

Since 2.8.10, I've got this:

[centreon@dsio-supervision ~]$ /usr/bin/php /usr/share/centreon/cron/centKnowledgeSynchronizer.php
An error occured, please check your Knowledge base configuration

@Mitchou
Copy link
Author

Mitchou commented Aug 2, 2017

I wondering if it's the redirection of my Wiki (default web server conf) and your form processing.
When I put this url with curl, it work: curl http://mywikiserver.mydomain.work/wiki/
Look closely to the / at the end

But with this one, is not: curl http://mywikiserver.mydomain.work/wiki

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://mywikiserver.mydomain.work/wiki/">here</a>.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at dsio-supervision.chasih.chc Port 80</address>
</body></html>

In Knowlegde configuration, I've try both URL without sucess.

Here my mediawiki conf:

#    Copyright 2013 Chris Caron <lead2gold@gmail.com>
#
#    This is free software: you can redistribute it and/or modify it under the
#    terms of the GNU General Public License as published by the Free Software
#    Foundation, either version 3 of the License, or (at your option) any later
#    version.
#
#    This file is distributed in the hope that it will be useful, but WITHOUT
#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#    FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
#    more details.
#
#    You should have received a copy of the GNU General Public License along
#    with this file. If not, see http://www.gnu.org/licenses/.
###############################################################################
### Source: http://nuxref.wordpress.org

### MediaWiki Configuration
Alias /wiki /usr/share/mediawiki
<Directory /usr/share/mediawiki>
  Options Indexes FollowSymLinks
  AllowOverride None
  Order allow,deny
  # Uncomment this if you have no restrictions
  Allow from all

  # For restrictive networks, consider using the
  # below and tailoring it to your likings
  #Allow from 127.0.0.1
  #Allow from 192.168.0.

  RewriteEngine On

  # so skins, images and extensions work
  RewriteRule ^(images|skins|extensions)/ - [L]

  # Forces specified index page to go ahead and load
  RewriteRule ^(load|index).php - [L]

  # The following makes it so if our configuration file isn't
  # present we will always catch this rewrite rule (allowing the
  # user to set up mediawiki)
  RewriteCond /usr/share/mediawiki/LocalSettings.php !-f
  RewriteRule ^(.+)  -  [PT]

  # Path Formating
  RewriteRule ^/*$ /wiki/index.php?title=Main_Page [L,QSA]
  RewriteRule ^/*(.+)$ /wiki/index.php?title=$1 [PT,L,QSA]

  ## Support colon (:)
  RewriteRule ^/(.*:.*)$  /wiki/index.php?title=$1 [L]
</Directory>

<Directory "/usr/share/mediawiki/images">
  # Ignore .htaccess files
  AllowOverride None

  # Serve HTML as plaintext, don't execute SHTML
  AddType text/plain .html .htm .shtml .php

  # Don't run arbitrary PHP code.
  php_admin_flag engine off

  RewriteEngine On
  RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]
  RewriteRule . - [forbidden]

   # If you've other scripting languages, disable them too.
</Directory>

@Mitchou
Copy link
Author

Mitchou commented Aug 2, 2017

The error is from my Apache Mediawiki who redirect all my URL to /wiki/index.php
So the URL to the api.php doesn't working
After comment them, all this stuff working.

Thanks for your help

Here the line to comment:

Path Formating
RewriteRule ^/*$ /wiki/index.php?title=Main_Page [L,QSA]
RewriteRule ^/*(.+)$ /wiki/index.php?title=$1 [PT,L,QSA]

@Mitchou Mitchou closed this as completed Aug 2, 2017
@kduret kduret self-assigned this Aug 7, 2017
@kozfelipe
Copy link
Contributor

centreon/centreon#5947

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/more-info-needed Waiting for more information
Projects
None yet
Development

No branches or pull requests

4 participants