glpi_app_grafana icon indicating copy to clipboard operation
glpi_app_grafana copied to clipboard

Problem in query GLPI

Open andrecampelo opened this issue 5 years ago • 3 comments

Hello dear ddurieux

I am doing the GLPI and Grafana integration, I came across the following problem.

image

or datasourcing is connected

Query responds with error on line 125

Object xhrStatus:"complete" request:Object method:"GET" url:"api/datasources/proxy/4/search/ticket?is_deleted=0&as_map=0&criteria[0][field]=12&criteria[0][searchtype]=equals&criteria[0][value]=notold&search=Search&itemtype=Ticket&start=0&forcedisplay[0]=0&giveItems=true&forcedisplay[1]=1&forcedisplay[4]=4&forcedisplay[3]=3&forcedisplay[80]=80&forcedisplay[15]=15&forcedisplay[7]=7" response:"
Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\glpi\inc\api.class.php on line 125
"

follows the line that shows copied error of the patch that was published

  // retrieve ip of client
  $this->iptxt = Toolbox::getRemoteIpAddress();
  •   $spl = explode(',', $this->iptxt);
    
  •     if (count($spl) > l) {    
    
  •    $this->iptxt = $spl[0];
    
  • }
     $this->ipnum = (strstr($this->iptxt, ':')===false ? ip2long($this->iptxt) : '');
    

#line 125 = + if (count($spl) > l) {

help me!!

thanks

andrecampelo avatar Apr 02 '19 15:04 andrecampelo

Hello,

seems you have problem with GLPI. DO you have official version or custom patched version?

ddurieux avatar Apr 02 '19 15:04 ddurieux

Original version.

GLPI 9.2.3 Copyright (C) 2015-2018 Teclib' and contributors - Copyright (C) 2003-2015 INDEPNET Development Team FusionInventory 9.2+2.0 - Copyleft © 2010-2017 by FusionInventory Team

andrecampelo avatar Apr 02 '19 15:04 andrecampelo

Hello

As you mentioned, I decided to upgrade the version of glpi using default settings. I did not succeed. error persists!

some help?

andrecampelo avatar Apr 04 '19 18:04 andrecampelo