Config backup without GUI

Hello

I use a lot epmp1000 devices. There is a problem with the backup configuration of these devices. Make a backup manually via the GUI it takes a lot of time and inelegant.

I have studied the possibility to epmp1000, but I could not figure out how to download a configuration of the device using SNMP or SSH commands.

Do epmp1000 able to load the configuration to a remote server? For example, I want to back up on the script sequentially for all devices.

For Russian employe of Cambium Networks:

Я использую много устройств epmp1000. Возникла проблема резервного копирования конфигураций с этих устройств. Делать резервное копирование вручную через GUI это занимает очень много времени и неизящно.

Я изучал возможности на epmp1000, но мне не удалось выяснить как скачивать с устройства конфигурацию с помощью SNMP или SSH команд.

Умеет ли epmp1000 загружать конфигурацию на удаленный сервер? Например, я хочу выполнять резервное копирование по скрипту последовательно для всех устройств.

Hi there!

From page 5 of ePMP CLI manual:

config show dump - Show running configuration as a list of “config set” commands.

So I believe just dumping the device config with "config show dump" and then sending this dump as a shell script ending with a "config apply; config save" should do the trick?

Regards!

Hello,

You should be able to use SNMP. You can trigger a config export action, which stores a backup copy of the config in the device file system. The exportLink OID stores the file name, which can be downloaded using HTTP. Please look at the following OIDs:

cambiumJSONCfgExport OBJECT-TYPE
SYNTAX Integer32 (0|1)
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"OID to start export process
0 No action
1 Start
Device Allocation: AP, SM"
::= { cambiumCfg 10 }

cambiumJSONCfgExportStatus OBJECT-TYPE
SYNTAX Integer32 (-1..4)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"OID to get the status of the export process:
-1 Error
0 Idle
1 Exporting JSON config
2 Moving config into upload directory
3 Preparing link for uploading
4 Success
Device Allocation: AP, SM"
::= { cambiumCfg 11 }

cambiumJSONCfgExportLink OBJECT-TYPE
SYNTAX DisplayString (SIZE(0..128))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Link to the configuration file on the board
Device Allocation: AP, SM"
::= { cambiumCfg 13 }

Hope it helps

1 Like

Thanks, Luis!

OID '...ExportLink...' return me HTTP link to JSON config file. Now I will try to automate the process of loading config backups on the server. Thanks for your reply!

New to ePMP and been looking for this option. Is there an example showing backup using snmp..? Thanks.

For those that aren't using SNMP but do have access to a PHP/Web server, here's a little something I came up with to download the JSON backups to a local web server. A little unconventional maybe, but it serves it's purpose. This is obviously slightly modified from my original, but with a basic understanding of PHP, it should be useable by pretty much anyone. This is originally was called via jQuery GET request in our admin dashboard, hence the JSON response at the end. 

<?php
$ip = $_GET['ip'];
$ap['name'] = $_GET['ap_name'];

$date = date(‘Y-m-d’);
$url = ‘http://’.$ip.’/cgi-bin/luci’;
$c = curl_init($url);
curl_setopt_array($c, array(
CURLOPT_RETURNTRANSFER => true,
));
curl_setopt($c,CURLOPT_POSTFIELDS, ‘username=admin&password=admin’);
curl_setopt($c, CURLOPT_VERBOSE, 1);
curl_setopt($c, CURLOPT_HEADER, 1);
$result = curl_exec($c);
curl_close($c);
$re = “/Set-Cookie: (.:wink: path.(stok=[a-z0-9]*)/”;
preg_match($re, $result, $matches);
unset($c, $result);
$stok = $matches[2];
$sys = $matches[1];
$url = ‘http://’.$ip.’/cgi-bin/luci/;’.$stok.’/admin/config_export?opts=json’;
$c = curl_init($url);
curl_setopt_array($c, array(
CURLOPT_RETURNTRANSFER => true,
));
curl_setopt($c, CURLOPT_HTTPHEADER, array(
‘Cookie: ‘.$sys.’ usernameType_80=admin; ‘.$stok.’; globalParams_80=%7B%22admin%22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D’
));
$post = ‘debug=0’;
curl_setopt($c,CURLOPT_POSTFIELDS, $post);
$cfg = curl_exec($c);
curl_close($c);
$filename = $ap[‘name’].’-’.$ip.".json";
mkdir("/path/to/your/storage/folder".$date, 0755);
$write = file_put_contents(’/path/to/your/storage/folder/’.$date.’/’.$filename, $cfg);
if(!$write){
$r[‘message’] = “Failed to save the backup for “.$ap[‘name’].”.”;
} else {
$r[‘message’] = $ap[‘name’].’ backup saved successfully!’;
}
print_r(json_encode($r));
}
?>

1 Like