You are not logged in.
Pages: 1
Hey all! I created a LibreNMS to GLPI integration using the API call. If an alert happens within Libre it will call the api to create a ticket. All works well however I statically put the session_token into the query since I don't know of another way. Will the session token expire?
Offline
Session tokens will expire and shouldn't be used over a long period of time. You should instead call the /initSession endpoint to get a session token using a user token + app token whenever it needs to use the API.
Also, how are you connecting LibreNMS to GLPI? Does it just run a script when certain thresholds are met, or is there something inside LibreNMS itself like webhooks or API integration?
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thanks for the reply! So I am using the LibreNMS API integration but that doesn't seem to be working. I don't think I can call the initSession during the same API call to create a ticket. My config in LibreNMS can be found at this image link https:// ibb.co/ctPGtc4 If I put a static session token into the session-token variable it will work until the token expires of course.
Last edited by nickkecooper (2024-02-29 20:35:02)
Offline
I don't think you can use the API transport at all. It seems annoying that it only supports basic authentication and doesn't let you specify another URL for authentication. Unfortunately, that means it also won't work at all with the new API (the current one will still exist) coming in the next main version of GLPI which uses OAuth exclusively and doesn't use sessions between requests. At this point, the only solution seems to be to create a custom transport (which requires PHP coding as far as I can tell).
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thanks for the information. I know PHP pretty well I may take a stab at making my own transport. I guess I could also do email and have GLPI look at an inbox for ticket creation.
Offline
I created a Transport in LibreNMS and it looks to be working! If anyone wants it I'd be glad to share the LibreNMS code.
Offline
I created a Transport in LibreNMS and it looks to be working! If anyone wants it I'd be glad to share the LibreNMS code.
Can you please show here or send me script? It would be cool if ticket were created
Offline
I created a Transport in LibreNMS and it looks to be working! If anyone wants it I'd be glad to share the LibreNMS code.
good evening could you send the code to me too? id like to test it!
Thank you in advance!
Offline
nickkecooper wrote:I created a Transport in LibreNMS and it looks to be working! If anyone wants it I'd be glad to share the LibreNMS code.
good evening could you send the code to me too? id like to test it!
Thank you in advance!
Could you share the code or point to the correct repositori to contribute ?
Offline
I created a Transport in LibreNMS and it looks to be working! If anyone wants it I'd be glad to share the LibreNMS code.
Same here
Thanks
Offline
Pages: 1