Control By Web (Xytronix) backup

General discussion of anything Unimus
Post Reply
dengle
Posts: 1
Joined: Mon May 18, 2020 4:34 pm

Mon May 18, 2020 4:44 pm

I am trying figure if there is a way to pull a backup from Control By Web (Xytronix) equipment. Everyone one of the CBW boxes have the backup file located at: http://x.x.x.x/settings.txt

Is this something that can be done in version 2.0?

If not, can I request this be added into Unimus?

Thanks,
Douglas Engle
User avatar
Tomas
Posts: 864
Joined: Sat Jun 25, 2016 12:33 pm

Tue May 19, 2020 6:30 pm

Hi,

Do these devices have a CLI from which a backup could be pulled?
If so, we can add a native driver in Unimus for these, and it would work ootb.

If there is no CLI, and a backup is only available through HTTP(S), you can use the new "Backup Push" API endpoint in Unimus.

Here is an example bash script using curl you can use to push to these devices:

Code: Select all

device_ip="1.2.3.4"
settings_file="settings.txt"
backup_file="${device_ip}_${settings_file}"

unimus_address="some.server.address"
unimus_api_token="qwertyuiop"

curl "http://${device_ip}/${settings_file}" -o "${backup_file}"

device_id=$(curl -H "Accept: application/json" -H "Authorization: Bearer ${unimus_api_token}" "http://${unimus_address}:8085/api/v2/devices/findByAddress/${device_ip}" | jq '.data.id')

curl -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer ${unimus_api_token}" -d '{"backup":"$(base64 ${backup_file})","type":"TEXT"}' "http://${unimus_address}:8085/api/v2/devices/${device_id}/backups"

rm ${backup_file}
You will need to create devices in Unimus for these, and set them to "Unmanaged".
This uses this API endpoint to push backups:
https://wiki.unimus.net/display/UNPUB/F ... enewbackup

You will need to install "curl" and "jq" to use this.
Post Reply