Parser for parsing Mikrotik SwitchOS files to JSON
- Clone this repository
- Get a copy of your Mikrotik SwitchOS configuration. This can be done using the following methods.
-
- Go to the webinterface on the switch.
- Go to the
System
tab. - Click on
Save Backup
. - Save the file on your system.
-
On the commandline enter the following command to download the backup file:
wget --user admin --password <your_password> http://<your_sw_ip>/backup.swb
. -
Using Ansible you could do the following:
- name: "Get backup"
ansible.builtin.get_url:
url: http://<your_sw_ip>/backup.swb
url_username: admin
url_password: <your_password>
validate_certs: False
dest: <your_backup_destination>
- Run the command using:
python3 parse.py backup.swb
- This will generate a file called
backup.swb.json
where your backup in JSON will be stored. - Have fun doing the other stuff you can do with JSON.
If you see anything that can be improved or if something is not working, please open a issue.