Brocade FC configupload

Document created by Hidenori Akatoki on Aug 22, 2016Last modified by Hidenori Akatoki on Aug 22, 2016
Version 6Show Document
  • View in full screen mode

Overview

 

Use this Service Template to execute 'configupload' command on Brocade FC switches; typically configupload is used to backup the switch configuration to a remote server.

'configupload' is executed via ssh rather than ftp when using this service template.

 

Using configupload over ssh is not particularly easy to do with traditional scripts since the command does not appear to support passing of the remote server password when executed with argument '-p ssh'.

 

Service TemplateDescription
Brocade FC configuploadBackup Brocade FC switch configuration using configupload.

 

Download

Created by HAD V8.2.1-00

VersionFile (With Link)DescriptionVendor IDHAD versionCreated date
01.00.15DownloadBackup Brocade FC switch configuration using configupload.HDSV8.2.1-00Dec 9, 2015

 

 

How to use

 

Requirements:

Upload server running ssh server.

ssh user with home directory - configupload file will land in this users home directory though it would be simple to modify the template to specify a custom upload directory.

 

 

Detailed Information

 

configupload filename:

Configuration upload filename is defined as follows: switchname_DayMonthYear_HourMinSecond.txt. Modify the javascript in order to implement your own filename schema.

 

example of exectued command:

configupload -p scp 10.67.242.36,root,BRCD6510_59_09112015_183549.txt

 

 

 

Javascript Plug-in:

(function(serviceProperties, pluginProperties, arg0, arg1, arg2)
{
var obj = new Object();
print("[Debug] Function begin.");
obj.mem1 = arg0;
var d = new Date();
var hours = d.getHours();
var minutes = d.getMinutes();
var seconds = d.getSeconds();
var day = d.getDate();
var month = d.getMonth();
var year = d.getFullYear();
if (day < 10) { day = "" + "0" + day }
if (month < 10) { month = "" + "0" + month }
if (seconds < 10) { seconds = "" + "0" + seconds }
var datestring = '' + day + month + year + "_" + hours + minutes + seconds;
if (arg0 == "" ) {
  pluginProperties["notify"] = 999;
  pluginProperties["out0"] = "Not enough arguments";
} else {
  var t = typeof arg0;
  var lines = arg0.split(/[\r\n]+/g);
  var switchname = lines[1];
  var uploadFileName = switchname + "_" + datestring + ".txt";
  pluginProperties["out0"] = arg0;
  pluginProperties["out1"] = uploadFileName;
  obj.status = "success";
}
print("[Debug] Function end.");
return obj;
})

Outcomes