Tip: How to Bulk Backup/Edit/Restore Device Settings (or other configuration)



1 comment

  • Avatar
    Cesar Amaya


    For GNU/Linux environment; this small script will read csv. This will read the export of all servers running rediscovery and then you can change them all together.

    code of readcsv.sh :

    shopt -s extglob
    rm -f commands.txt
    while read serial server
        echo "{$server}"
    server="${server##*( )}"
    echo -e 'device.update devicename='$server',rediscoveryEnabled=true,rediscoveryfrequency=1440' >> commands.txt
     done < $1


    1. Get the list of servers

    # ./bveCLI.pl --host <host> --exec "device.list | grep rediscoveryfrequency" --fields devicename --format csv --output file.csv

    example of file:

    # cat file.csv

    # serialnumber, devicename
    "200000", "letsandgo"
    "80018", "Traverse Server"

    2. We execute the script

    # bash readcsv.sh file.csv
    { devicename}
    { "letsandgo"}
    { "Traverse Server"}

    3. Now we can run the new command with the new rediscovery

    # ./bveCLI.pl --host raglan --input commands.txt


    * You have to manually edit the script to change the rediscovery frequency

    * The command 3. will run 1 line error, disregard is by design ( will try to look for deviname=devicename)

Article is closed for comments.