Icinga / icingaweb2-module-elasticsearch

This module will not be updated by Icinga anymore. Please don't attempt to use it.

Home Page:https://icinga.com/docs/elasticsearch/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing error: InstanceController.php & EventtypesController.php

Npeto opened this issue · comments

Hello everyone,

I'm trying to connect our icingaweb2 instance with Elasticsearch.
I'm encountering problems when loading module configuration pages on icingaweb2

Expected Behavior

Being able to load the ES Instance configuration and/or Event Types configuration page(s)

Current Behavior

Error message when loading pages

  1. Instance configuration
    Parse error: syntax error, unexpected '[' in /usr/share/icingaweb2/modules/elasticsearch/application/controllers/InstancesController.php on line 23
      $  vi +23 InstancesController.php 
        $this->getTabs()->add(uniqid(), [
            'label'     => $this->translate('Event Types'),
            'url'       => Url::fromPath('elasticsearch/eventtypes')
        ]);
  1. Event Types configuration
    Parse error: syntax error, unexpected '[' in /usr/share/icingaweb2/modules/elasticsearch/application/controllers/EventtypesController.php on line 22
        $ vi +22 EventtypesController.php
        $this->getTabs()->add(uniqid(), [
            'label'     => $this->translate('Instances'),
            'url'       => Url::fromPath('elasticsearch/instances')
        ]);

Steps to Reproduce (for bugs)

  1. Copy module files from master branch into /usr/share/icingaweb2/modules/elastisearch
  2. Enable module
  3. Go into Icingaweb2 web interface
  4. Try to configure ES Instances and/or Event Types
  5. Get parse error

Context

What are you trying to accomplish?

Basic configuration

Your Environment

  • Module version (System - About):
    1.0.0
  • Icinga Web 2 version and modules (System - About):
    2.5.0
  • Icinga 2 version (icinga2 --version):
    version: r2.8.0-1
  • Operating System and version:
    Red Hat Enterprise Linux Server release 6.9 (Santiago)
  • Webserver, PHP versions:
    Apache 2.2.15
    PHP version: 5.3.3

Hope those informations will be sufficients,

Kind regards,

Niels

Can you share the generated config.ini and instances.ini configuration files from /etc/icingaweb2/modules/elasticsearch?

Also, please test again with Icinga Web 2 v2.5.1

@dnsmichi
I don't have the elasticsearch directory into /etc/icingaweb2/modules

For Icinga Web 2 v2.5.1, can't test it quickly since I have no hands on the local repository

Nevermind, I am bit tired today. Clearly this is a PHP exception, and I also know why - your PHP version is EOL, you need at least PHP 5.6 for this module.

Hint: the problem is the [] array notation, this has been introduced with PHP 5.4.