ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.68k stars 909 forks source link

Contribution: Synology Nas model #3133

Open marmack95 opened 2 months ago

marmack95 commented 2 months ago

Hello, i wrote a model for Synology Nas (tested on DSM6.x/7.x). I think it could be compatible with Synology network device : i don't have this type of device.

I encounter 2 problems:

  1. I don't find how to remove prompt (myuser@mydevice:~#) from the final file (it appears only on few lines)
    # 
    #  ### Hardware ###
    # 
    # hostname      : mydevice
    # root@mydevice:~# model         : RS2414rp+
    # root@mydevice:~# serial number : xxx
    # root@mydevice:~# machine-id    : xxx
    # root@mydevice:~# root@mydevice:~# model name  : Intel(R) Atom(TM) CPU D2701   @ 2.13GHz
    # root@mydevice:~# ram           : 4.0 Go
    # root@mydevice:~# disk model 1  : xxx
    # disk model 2  : xxx

    but i would like to have:

    # 
    #  ### Hardware ###
    # 
    # hostname      : mydevice
    # model         : RS2414rp+
    # serial number : xxx
    # machine-id    : xxx
    # model name    : Intel(R) Atom(TM) CPU D2701   @ 2.13GHz
    # ram           : 4.0 Go
    # disk model 1  : xxx
    # disk model 2  : xxx
  2. As some device, all parameters could not be retrieve by command line, so i used manufacter command to create a backup. But as I don't understand how to use Oxidized FTP/SCP copy, so i ask to device to do it to a server.

Variables i used in my model (you need it, if 'enable' is set to 'true'), if someone wants to use it:

vars:
  enable: true
  bkppath_local: /volume1/local_backup
  bkpsvr: server_ip
  bkppath_ftp: folder
  bkpusr: username
  bkppwd: password
  oxcopy: false

I use Oxidized 0.30.1-14-g2bfd3f2 (docker version).

synology.txt

marmack95 commented 2 months ago

This version fix prompt, and uncommented data.

Update: add new var "selfcopy: true" to enable (or not) config copy to ftp from device. synology.txt