Page 1 of 1

Control By Web (Xytronix) backup

Posted: Mon May 18, 2020 4:44 pm
by dengle
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

Re: Control By Web (Xytronix) backup

Posted: Tue May 19, 2020 6:30 pm
by Tomas
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.