KiwiSSH API Endpoint

Some users of KiwiSSH created a feature request regarding the integration with LibreNMS. KiwiSSH is an alternative to Oxidized and aims on configuration backups of (network) devices.

Similiar to the /api/v0/oxidized endpoint, a dedicated /api/v0/kiwissh endpoint would be nice.

KiwiSSH will fetch the devices from LibreNMS and needs the following parameters in the API response:

  • Hostname
  • IP address
  • Group
  • Enabled (bool)

For now I’ve written this workaround to support LibreNMS in KiwiSSH.

I’m the maintainer of KiwiSSH, so I am happy for any ideas, feedback or help. :slight_smile:

Is there any particular benefit of a specific endpoint given that you have it working with the oxidized endpoint? (ie given your workaround is there something missing or not working well) ?

I expect probably not having to explain why it’s Oxidized config / api options being used in documentation.

Might be worth us just adding ?with=groups to the devices endpoint, that probably works for Oxidized as well at that point.

The workaround isn’t quite fancy. The os parameter isn’t needed and well, the endpoint name is oxidized and not kiwissh.

We also don’t need all settings in the “Oxidized Integration” settings.

A own endpoint (and maybe own settings section) would be more clear in terms what to use on how to configure it without running into conflicts with pre-existing Oxidized integrations by the user.

That would be great! /api/v0/devices returns every information we need about a device, just not the configured group yet.

Only problem I see for now: Each device must be in a single group, not in multiple. Thats why it might be handy to have a dedicated KiwiSSH endpoint with group parameter. The user could then have a similiar mapping logic like the “Oxidized Integration” has to define backups groups on their own without interferring with the LibreNMS groups.

Oxidized integration was added before Device group support was introduced hence that has its own group mapping. I’m not sure we’d do the same going forward.

I’ve not looked at your code but can you not just specify something like group: group.0 for the first item in the group array?

Would work but isn’t a nice solution. Lets say my device is in Group-0, Group-A and Group-Backup.

I’ve configure Group-Backup as the backup group in KiwiSSH. group.0 would use Group-0 in this case. What I want to say is that this isn’t consistent.

Indeed. I have considered adding a weighting to groups before so you can surface a priority order.

From my perspective, I’m personally going to hold off adding any integration, especially front end / config viewing until the project is more established.

Understood. Group weighting and the ability to use ?with=groups on the devices endpoint would be great benefit so far.

1 Like

Ideally, v1 API would allow you to query and get the exact data shape you need without a custom endpoint.

1 Like

That would be the best case.