Users Guide
Sample script for Perl using DellExec, DellCli, and DellConfig
#! /usr/pkg/bin/perl
#importing DellSSUtils
require "/usr/pkg/scripts/DellSSUtils/DellSmartUtils.pl";
#Assigning Value to the vairable which is used as an argument to the
#dell library functions
$cli = "show version";
$script = "/usr/pkg/scripts/sample_scripts/sum.py";
$args = "1 2 3";
$ExtraArgs = "10";
@list = ("interface vlan $ARGV[0]", "no shutdown", "ip address $ARGV[0].$ARGV[0].$ARGV[0].
$ARGV[0]/24", "exit");
open (MYFILE, '>>/f10/flash/dellcliop.txt');
print MYFILE DellCli($cli);
print MYFILE "\n";
print MYFILE DellExec($script, $args);
print MYFILE "\n";
print DellCliConfig(@list);
Sample script for Perl using DellExec, DellCli, and DellConfig (S3100 Series)
#! /f10/flash/pkg/usr/pkg/bin/perl
#importing DellSSUtils
require "/f10/flash/pkg/usr/pkg/scripts/DellSSUtils/DellSmartUtils.pl";
#Assigning Value to the vairable which is used as an argument to the
#dell library functions
$cli = "show version";
$script = "/f10/flash/pkg/usr/pkg/scripts/sample_scripts/sum.py";
$args = "1 2 3";
$ExtraArgs = "10";
@list = ("interface vlan $ARGV[0]", "no shutdown", "ip address $ARGV[0].$ARGV[0].$ARGV[0].
$ARGV[0]/24", "exit");
open (MYFILE, '>>/f10/flash/dellcliop.txt');
print MYFILE DellCli($cli);
print MYFILE "\n";
print MYFILE DellExec($script, $args);
print MYFILE "\n";
print DellCliConfig(@list);
Sample script for Python using DellExec, DellCli, and DellConfig
#! /usr/pkg/bin/python
import time
import sys
sys.path.append('/usr/pkg/scripts/DellSSUtils/')
import DellSmartUtils
for input1 in sys.argv[1:]:
print DellSmartUtils.DellCliConfig(["%s" %str("interface vlan %s" %str(input1)
) , "no shutdown"])
arg_val=""
for b in sys.argv[1:] :
arg_val=arg_val+" %s" %(b)
print DellSmartUtils.DellExec("loopback.zsh" , arg_val)
f = DellSmartUtils.DellCli("show version")
fh = open("/f10/flash/Dellcli.txt", "w")
fh.writelines(f)
fh.close()
Sample script for Python using DellExec, DellCli, and DellConfig (S3100 Series)
#! /f10/flash/pkg/usr/pkg/bin/python
import time
import sys
sys.path.append('/f10/flash/pkg/usr/pkg/scripts/DellSSUtils/')
import DellSmartUtils
78
Smart Scripting