redddcyclone / glpi-agentmonitor

GLPI-Agent monitoring utility for Windows (systray icon)
GNU General Public License v2.0
9 stars 5 forks source link

Open Ticket with Related Computer Item #16

Closed Henrique-Batista closed 1 year ago

Henrique-Batista commented 1 year ago

Thank you so much for this tool. Is it possible that, when clicking on New Ticket in the Monitor, it already comes as a related item to the computer that the GLPI agent is present on? It would be a great integration

redddcyclone commented 1 year ago

Hi @Henrique-Batista

First of all, thanks for the suggestion.

Sadly, I don't think it's possible to do it automatically, at least not in the way the Monitor currently opens the ticket page. The part that adds an item to the ticket is Ajax-based and can't be called from the Monitor after the new ticket page is loaded by the browser. And without using GLPI's API to retrieve the computer's ID, we can't even know which computer should be linked to the ticket.

Maybe this would be possible by creating a simple "New ticket" dialog in the Monitor itself, and using GLPI's API to retrieve the computer's ID and then open the new ticket through the API with the related item directly from the Monitor.

I could add this feature in the future, but currently it is not in my plans as it would be very complex as of now. I don't discard the possibility though.

g-bougard commented 1 year ago

Just putting my 2 cents, I don't know what is required by GLPI API, but if it can help, you still can find the glpi-agent deviceid from the local computer as it is stored in C:\Program Files\GLPI-Agent\var\GLPI-Agent.dump file. But this is in a perl specific format. I can provide you a one-liner to extract it using the perl binary provided by GLPI-Agent so you can start it and catch the deviceid as output.