You are not logged in.
for debug purpose only :
uncomment echo $ticket_id;
after each " $json = curl_exec($ch);" add "print_r($json); "
then run from console "php zabbix-close-ticket.php 24109"
glpi should return some usefull infos about what is wrong
I did it
At least I get that message now:
{"session_token":"an session_token"}{"totalcount":1,"count":1,"sort":1,"order":"ASC","data":[{"2":202,"1":"PROBLEM:glpi-teste fora do ar! Evento 24109 gerado automaticamente pelo Zabbix & GLPI."}],"content-range":"0-0/1"}202["ERROR_BAD_ARRAY","input parameter must be an array of objects; view documentation in your browser at ]http://my-ip/apirest.php/#ERROR_BAD_ARRAY"]["ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM","resource not found or not an instance of CommonDBTM; view documentation in your browser at ]http://my-ip/apirest.php/#ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM"]
I saw that Every time I run the command in terminal, get a new session_token.
Last edited by mecmav (2019-09-26 14:34:45)
Offline
json_encode($fields) => $fields is allready a $json !
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I saw that Every time I run the command in terminal, get a new session_token.
it's OK. ( init session creates a new token )
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
json_encode($fields) => $fields is allready a $json !
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
should I remove this json_encode($fields) at line 67?
Offline
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields);
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields);
Nice !
The ticket corresponding that event was closed !
But after run receive a message with got this error:
{"session_token":"my-session_token"}{"totalcount":1,"count":1,"sort":1,"order":"ASC","data":[{"2":195,"1":"PROBLEM:glpi-teste fora do ar! Evento 23928 gerado automaticamente pelo Zabbix & GLPI."}],"content-range":"0-0/1"}195{"id":11,"message":"Item Successfully Added: Solution - ID 11"}["ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM","resource not found or not an instance of CommonDBTM; view documentation in your browser at http://my-ip/apirest.php/#ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM"]
Note that I need to insert another event, because that first was closed.
But in GLPI, the ticket was closed succesfully.
That error is showing because are printing $json?
Last edited by mecmav (2019-09-26 15:06:49)
Offline
["ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM","resource not found or not an instance of CommonDBTM; view documentation in your browser at http://my-ip/apirest.php/#ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM"]
this is about killsession.=> killSession with S instead s
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
["ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM","resource not found or not an instance of CommonDBTM; view documentation in your browser at http://my-ip/apirest.php/#ERROR_RESOURCE_NOT_FOUND_NOR_COMMONDBTM"]
this is about killsession.=> killSession with S instead s
Man, I don't have enough words to thank you. Now everything is working as expected. Thank you for your extreme patience and collaboration, I really appreciate your commitment and dedication to trying to solve my problem. If I could rate you, it would be above the highest possible grade. Everything worked !
Now, this topic can be closed, I expect that can help to any others!
Offline