[Question / Help] Webhook or similar behaviour on configuration change

Unimus support forum
Post Reply
networknix
Posts: 5
Joined: Tue Mar 12, 2024 9:45 am

Tue Mar 12, 2024 10:43 am

Hi,

We've been happily using Unimus for a while now. We've setup the automatic e-mail on config change, but we would like to automate this further. We have an in-house system used for ticketing, sprint planning, hours registration and configuration management.

We would like to automate this in such a way that everytime Unimus detects a config change -> a ticket gets made with the latest config file and the diffs in the description of the ticket. So that a manager can give approval, check the change and some other for now unrelated reasons.

A webhook or something similar would be perfect for this, but as far as I can see from the forum and documentation that's not possible. Any tips to use the current API in such a way to facilitate this functionality? Or something else I'm missing?

Many thanks,
erik.k
Posts: 15
Joined: Wed Feb 07, 2024 8:16 am

Tue Mar 12, 2024 1:19 pm

Hi,

unfortunately, Unimus is currently not able to fulfill such a task in full measure but as you already mentioned, we are also aware about possible solution which could be achieved by introduction of webhook. That's why we already put such a requirement in our backlog. I will keep you updated about our next approach related to this feature.
networknix
Posts: 5
Joined: Tue Mar 12, 2024 9:45 am

Tue Mar 12, 2024 1:31 pm

erik.k wrote:
Tue Mar 12, 2024 1:19 pm
Hi,

unfortunately, Unimus is currently not able to fulfill such a task in full measure but as you already mentioned, we are also aware about possible solution which could be achieved by introduction of webhook. That's why we already put such a requirement in our backlog. I will keep you updated about our next approach related to this feature.
Hi, thank you for the quick answer. Due to how my project is structured, I don't have enough time to wait for Q4 or later. Apart from a webhook as the ideal solution, do you have any idea or tips for a different way? I was thinking of daily polling all the devices from the Unimus API (diff), checking if the config changed and then manually pulling the configuration and information if so. Not flawless, but something at least. But I'm trying to gather inspiration here. Any idea? Thanks.
User avatar
Tomas
Posts: 1221
Joined: Sat Jun 25, 2016 12:33 pm

Tue Mar 12, 2024 10:55 pm

networknix wrote:
Tue Mar 12, 2024 1:31 pm

Hi, thank you for the quick answer. Due to how my project is structured, I don't have enough time to wait for Q4 or later. Apart from a webhook as the ideal solution, do you have any idea or tips for a different way? I was thinking of daily polling all the devices from the Unimus API (diff), checking if the config changed and then manually pulling the configuration and information if so. Not flawless, but something at least. But I'm trying to gather inspiration here. Any idea? Thanks.
You can definitely work around this using the API. You can check the latest backup of the device on schedule with the API (the "Backups - get device latest backup" endpoint), and save the backup's ID. If the current backup ID is not equal to the ID that was retrieved during a previous check, a change on the device occurred.

Once you identify a change has occurred, you can create a ticket in your internal system. You can also use the "Diff - get diff" API endpoints to get a diff between the old and the new backup IDs. This way, you can attach the actual diff of the change to your internal ticket.

Reference: https://wiki.unimus.net/display/UNPUB/F ... umentation
networknix
Posts: 5
Joined: Tue Mar 12, 2024 9:45 am

Wed Mar 27, 2024 12:21 pm

Tomas wrote:
Tue Mar 12, 2024 10:55 pm
networknix wrote:
Tue Mar 12, 2024 1:31 pm

Hi, thank you for the quick answer. Due to how my project is structured, I don't have enough time to wait for Q4 or later. Apart from a webhook as the ideal solution, do you have any idea or tips for a different way? I was thinking of daily polling all the devices from the Unimus API (diff), checking if the config changed and then manually pulling the configuration and information if so. Not flawless, but something at least. But I'm trying to gather inspiration here. Any idea? Thanks.
You can definitely work around this using the API. You can check the latest backup of the device on schedule with the API (the "Backups - get device latest backup" endpoint), and save the backup's ID. If the current backup ID is not equal to the ID that was retrieved during a previous check, a change on the device occurred.

Once you identify a change has occurred, you can create a ticket in your internal system. You can also use the "Diff - get diff" API endpoints to get a diff between the old and the new backup IDs. This way, you can attach the actual diff of the change to your internal ticket.

Reference: https://wiki.unimus.net/display/UNPUB/F ... umentation
Hi, thanks for the help! That was indeed my intention and I've mostly implemented the functionality within our platform of choice. At the moment I'm having trouble though with trying to filter out the Diffs json response from the two seperate backup IDs to get something useful. Do you happen to have any tips or examples of this? The best case scenario would be to have something that displays it the same way as in the Unimus webgui, just without the colors as plaintext. Also accounting for dynamic information that gets ignored in Unimus. Nothing fancy is otherwise needed, many thanks for the answer.
networknix
Posts: 5
Joined: Tue Mar 12, 2024 9:45 am

Fri Apr 12, 2024 9:18 am

An alternative to the question I asked above: Is there also a possibility to construct an URL to the Unimus webgui that automatically opens a device configuration with a diff of two back-ups? I'm suspecting not, because of the Javascript and indescriptive URL, but it would also be a fine alternative to deconstructing the API diff json object ourselves. Hence the question. Many thanks.
Post Reply