ddurieux / glpi_app_grafana Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
Problem
Configuring glpi_app_grafan with basic auth does not work.
There is in fact 2 problems:
I found seral places where code calls this.url + "/initSession"
and each time it build query with user_token
header field.
It should test wich fields it needs and allow use of Autorization: basic
with a base64 hash of user: passwd
fields as stated in the GLPI's APIREST documentation.
In our environment, using App-Token and User-Token does not work because we authenticate GLPI users with CAS. Maybe it is a bug in GLPI implementation, I don't know.
We use plugin glpi_app_grafana v1.3.0
Thank you
Guys, good morning. First congratulations for the project.
I would like to know if the plugin is GLPI 9.1.3 compliant, I am trying to set up the datasource and am getting the following error:
"Unknown error
GLPI API Error Response: There is no active API client that matches its IP address in the configuration (187.44.177.126, 187.44.177.126) "
The same API is currently in production for other integrations.
Boa tarde estou com problemas
consigo fazer a parte do API no GLPI tudo certo
meu unico problema ta sendo o Apache onde configuro as tag que mostra aqui
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE"
Header set Access-Control-Allow-Credentials true
Header set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, App-Token, Session-Token"
se eu adiciono elas no apache da erro no glpi 404 e nao consigo acessar ai tenho que remover ele para glpi voltar ao normal
Hi David! I vave a problem setting up a Singlestat panel so that it shows me the exact same number of items found in glpi. Here's an example:
https://my.glpi.address/glpi/front/computer.php?is_deleted=0&criteria[0][field]=5150&criteria[0][searchtype]=morethan&_select_criteria[0][value]=-4DAY&criteria[0][value]=-4DAY&search=Szukaj&itemtype=Computer&start=0&_glpi_csrf_token=292d836fc52c10bc8d1a418730329b84
This search returns the number 1108. Then I paste the link to a grafana query field, check count elements checkbox, in third tab (Options) I change Stats to Current, which gives me result of 1 item. When I chenge Stats to Total it returns 1090. I couldn't find any explenation on how to use this plugin properly to get the same results as in glpi.
Thanks for Your help.
Hello,
I'm using a dashboard based on your exemple but some user information are not properly displayed in the table " Last Ticket".
for exemple "Tehnicien" column display:
LE TIEC ERWAN
I don't have issue with the column "demandeur"
I'm using grafana 5.3.2 with glpi plugin 1.3.0
glpi server version is 9.3.2
No work, and no imported template grafana.
Hello david.
I have a problem with the configuration of glpi app.
i try to access to my glpi but i have serious problem?
My Glpi is configured with SSO authentification, my users are auto authetified with my DC.
so when i try to test my config i have a message to authenticate!
but it doesn't accept my login/password for glpi (my windows domain\user and password).
If i try browser access and not server(default) i have a message with cross!
Can you help me?
Server GLPI Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-170-generic x86_64) 192.168.9.11
GLPI 9.4.4
Server Grafana (V6.5.1) CentOS8 192.168.9.14
When have mouse on the graph, the values inthe tooltip are not right
Hello,
is there a way to get TotalCount value instead of count value in a panel ?
For instance, on the default Dashboard, I would like to retrieve the Total number of Computers.
Count elements is limited by the windowing system (400 by default) used to limit the number of answers returned during a equest.
If you read the query Inspector, it's possible to see totalcount, but I'm not able to retrieve the info in my panel.
Thanks
When I try to get total ticket number from the last 2 hours I receive this error. All the other queries in the dashboard are ok!
Usually, with some Grafana panel, it is allowed to declare several queries in the same panel. As an example, it is possible to declare query A, query B and query C, and only the Query C values are displayed.
It does not look possible in a single stat panel to declare several queries and only display the result of only one of them
Hi, I have such problem
GLPI API Error Response: session_token is missing or empty; view documentation in your browser in http://help.hub.mydomain.local/apirest.php/#ERROR_SESSION_TOKEN_MISSING
GLPI ver. 9.2.4
Currently it is possible to use some fields from the request result as columns in the Grafana table panel.
Some remarks:
allow more than 6 columns. Perharps 12 columns, same as the panels spanning ...
allow to "unselect" a query result field from a column ... currently it is not possilble
display the fields of the Glpi metacriteria. For a request joining Computers and Software, the Software fields are not visible
using the ID field in a column raises an error :/
using the "Nombre de tickets" field in a column raises an error :/
Feels a bit that Server and Browser are switched:
When selecting a server as access I've got the following error:
GLPI API Error Response: Es gibt keinen aktiven API-Client, der mit Ihrer IP-Adresse in der Konfiguration übereinstimmt. (Client-IP, Client-IP)
As I'm understanding, when using server no direct request from client to glpi will be made!?
When using Browser:
Cross-Origin Request Blocked: add right headers in your apache/nginx like 'App-Token' and 'Session-Token'
GLPI 9.2.3
Plugin 1.1.0
Grafana 5.1.2
Hello,
With the "Dynamic split this query by a query per each values of the field" options is it possible to make a chart like the image below?
I'm doing certain query and counting the value of rows, but I would also like to separate them by group.
Here's how it works in Grafana:
With the "Dynamic split this query by a query per each values of the field":
Hello Ddurieux,
I have a problem, i don't have API token (app token, user token) in my GLPI version 0.90.5.
There is not API in == > Configuration >
I will be very grateful for your help
In case we want to get tickets opened since 1 month but want display it by day hour (7h, 8h, 9h, 10h...) we need to add an option to modify the data received from GLPI and modify them by hour
I just started using this app, so i may forgot to set something, but when i create a table with metrics of tickets i noticed that title come as a <a></a>
tag (which made me happy, 'cause i could just set "Sanitize HTML" and the link would work), but then i noticed that the "domain" for some reason was appearing as "datasources" just like below
Is it a bug/issue or i just set something wrong?
Since version 1.2.0 of the plugin, all my GLPI panels returns the same error:
Cannot read property 'number' of undefined
With the full stack trace
TypeError: Cannot read property 'number' of undefined
at Array.eval (https://graphes.domain.net/public/plugins/ddurieux-glpi-app/datasource/datasource.js:121:60)
at eval (https://graphes.domain.net/public/plugins/ddurieux-glpi-app/datasource/datasource.js:60:62)
at u (https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:68722)
at https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:69127
at h.$digest (https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:74824)
at h.$apply (https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:76638)
at https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:72697
at i (https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:21870)
at https://graphes.domain.net/public/build/vendor.337c125610d33424db4a.js:87:23332
Everything was fine with 1.1.0 (and everything is working again as soon as I downgrade back to 1.1.0)
One thing interesting is that, if I edit the applet, and wait a few seconds without changing anything, then the applet starts working. Even if I go back to the dashboard. It works until à reload the page
Running on CentOS 7, Grafana 5.2.0
Hi !
I try to configure the DataSource but i alway get this error :
I checked the older issue #26 but it's still not working
My Configuration :
GLPI (9.3)
Grafana (5.2.1)
My GLPI server is on a VPS (OVH) configured in HTTPS.
I enabled the headers_module in the virtual host and in the apache conf
Thank.
Merci
Hi,
I am configuring grafana to query the information about the tickets and it is not able to query them. The datasource connect but there are not results in the dashboard.
I checked Apache logs in GLPI server and we find this message:
192.168.100.23 - - [03/May/2019:12:59:57 +0200] "GET /glpi/apirest.php/search/ticket?is_deleted=0&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=&search=Rechercher&itemtype=Ticket&start=0&criteria[1][link]=AND&criteria[1][field]=0&criteria[1][searchtype]=morethan&_select_criteria[1][value]=0&_criteria[1][value]=1556866797&criteria[1][value]=2019-05-03%2006:59:57&criteria[2][link]=AND&criteria[2][field]=0&criteria[2][searchtype]=lessthan&_select_criteria[2][value]=0&_criteria[2][value]=1556888397&criteria[2][value]=2019-05-03%2012:59:57&forcedisplay[0]=0 HTTP/1.1" 302 - "-" "Grafana/6.1.6"
Also, if we try the query with curl, it has the same message.
Dears,
I have this problem.
I use GLPI with Cas authentication and LDAP authentication, When I remove cas authentication connection work on Grafana., then it's working without Cas, show this message "Data source is working"
On glpi, I discovered this parameter "noCAS=1", if I access glpi doesn't show Cas authentication:
Example:
http://Server-GLPI/glpi/index.php?noCAS=1
I tried add this parameter on my configuration, but doesn't work. Look on picture:
On url option I tried add too:
https://cas.authentication.br/cas/login?service=http://dus.myserver.br/glpi/front/login.php
Show this error with if add this cas authentication:
"Cross-Origin Request Blocked: add right headers in your apache/nginx like 'App-Token' and 'Session-Token"
My config of apache glpi:
Can someone help me?
t=2017-10-23T10:15:07+0200 lvl=info msg="Request Completed" logger=context userId=35 orgId=5 uname=[email protected] method=GET path=/glpi/apirest.php/initSession status=400 remote_addr="192.168.186.23, 127.0.0.1" time_ms=40 size=142 referer=https://grafana.company.com/datasources/edit/8
In grafana setup dialog, i get this :
GLPI API Error Response: No active client matching your IP address (192.168.186.23, 127.0.0.1, 127.0.0.1)
I tried setting api access without ip restriction or with 127.0.0.1 - 192.168.186.23, even though grafana IP is 172.17.2.29 on my network.
Is this normal to pass two ip's as remote_addr ? Should i somehow rewrite it in apache on glpi side?
I am running Grafana 4.5.2 and GLPI 9.1.6.
When some fields contain integer values:
Panel data error:
TypeError: data[3][idx][kkey][eval(...).number].replace is not a function
Stack trace:
execute/GlpiAppDatasource</GlpiAppDatasource.prototype.promiseMergeTargetResult/<@http://localhost:3000/public/plugins/ddurieux-glpi-app/datasource/datasource.js:255:59
u@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:68722
c/<@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:69127
$digest@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:74824
$apply@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:76636
M/a<@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:72695
i@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:21868
mt/c.defer/n<@http://localhost:3000/public/build/vendor.2305a8e1d478628b1297.js:43:23332
metrics_panel_ctrl.ts:171:6
Is there a way to use variables to reference a query to calculate a field.
Here it is what I want to do:
I Have a query returning the total number of problems. Query A
I Have a second query returning the total number of solved problems. Query B
I want to show the percentage of problems solved, using Query B e Query A to calculate it.
Is there a way to do that?
Hi folks,
I have tried to enable cors on a apache without success.
I tried in .htaccess, in glpi.conf or 000-default.conf.
Wich is the correct marker to incapsulate
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE" Header set Access-Control-Allow-Credentials true Header set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, App-Token, Session-Token"
and in wich file?
I got this:
Access to XMLHttpRequest at 'https://glpi###############initSession' (redirected from 'http://#####/api/datasources/proxy/6/initSession') from origin 'http://#######' has been blocked by CORS policy: Request header field x-ds-authorization is not allowed by Access-Control-Allow-Headers in preflight response.
When a panel queries for information to Glpi it looks like it is requesting an important number of elements. As of it, on huge tables, the query is very long to update the panel.
It looks like it is getting 400 elements at once ?
Because the data source is using a dedicated user account in Glpi, perharps it should only request the maximum page count of the user ?
Hello dear ddurieux
I am doing the GLPI and Grafana integration, I came across the following problem.
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
$ grunt
Running "clean:0" (clean) task
>> 1 path cleaned.
Running "copy:src_to_dist" (copy) task
Created 5 directories, copied 14 files
Running "copy:moment_timezone" (copy) task
Copied 8 files
Running "copy:pluginDef" (copy) task
Copied 1 file
Running "babel:dist" (babel) task
Running "ts:build" (ts) task
Compiling...
Using tsc v2.7.1
dist/datasource/query_ctrl.ts(1,21): error TS6053: File '/usr/local/share/grafana/public/app/headers/common.d.ts' not found.
dist/datasource/query_ctrl.ts(3,8): error TS1192: Module '"dist/datasource/datasource"' has no default export.
dist/datasource/datasource.ts(1,21): error TS6053: File '/usr/local/share/grafana/public/app/headers/common.d.ts' not found.
>> 1 syntax error 2 non-emit-preventing type warnings
>> Error: tsc return code: 2
Warning: Task "ts:build" failed. Use --force to continue.
Aborted due to warnings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.