2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Modify usage for config switch scripts

This commit is contained in:
Casandra Qiu 2016-12-15 10:20:34 -05:00
parent c7eb8b8025
commit 9939be28db
3 changed files with 28 additions and 36 deletions

View File

@ -158,7 +158,7 @@ sub config_ip {
# don't need to set if ip addresses are same
if ($dip eq $static_ip) {
print "static ip $static_ip and discovery ip $dip is same, will not process command for $switch\n";
$cmd = "chdef $csw otherinterfaces=";
$cmd = "chdef $switch otherinterfaces=";
$rc= xCAT::Utils->runcmd($cmd, 0);
next;
}
@ -545,15 +545,16 @@ sub config_desc {
sub usage
{
print "Usage:
configBNT [-?│-h│--help]
configBNT [--switches switchnames] [--all]
configBNT [--switches switchnames] [--ip]
configBNT [--switches switchnames] [--name ]
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT [--switches switchnames] [--port port] [--vlan vlan]
configBNT -h│--help
configBNT --switches switchnames --ip
configBNT --switches switchnames --name
configBNT --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT --switches switchnames --port port --vlan vlan
To set the ip address, hostname and config snmp:
configBNT --switches switchnames --all
To set the description for a port on the switch:
configBNT --switches switchnames --port port --desc \"description\"
\n";
}

View File

@ -329,12 +329,16 @@ sub run_rspconfig {
sub usage
{
print "Usage:
configMellanox [-?│-h│--help]
configMellanox [--switches switchnames] [--all]
configMellanox [--switches switchnames] [--ip]
configMellanox [--switches switchnames] [--name]
configMellanox [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--auth snmp_auth]
configMellanox [--switches switchnames] [--config]
configMellanox -h│--help
configMellanox --switches switchnames --ip
configMellanox --switches switchnames --name
configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth]
To set the ip address, hostname, config snmp and run rspconfig command:
configMellanox --switches switchnames --all
To run rspconfig command:
configMellanox --switches switchnames --config
\n";
}

View File

@ -227,6 +227,7 @@ sub install_license {
print "file = $license_file\n";
if (!(-e $license_file) ) {
print "$license_file is not exist\n";
return;
}
foreach my $switch (@nodes) {
@ -371,21 +372,6 @@ sub config_ntp {
}
sub config_vlan {
if ($::PORT) {
$port = $::PORT;
} else {
&usage;
exit(1);
}
$vlan = $::VLAN;
print "Tagging VLAN=$vlan for $switches port $port\n";
#create vlan, tagged vlan
#$cmd = `xdsh $switches --devicetype EthSwitch::BNT "enable;configure terminal;vlan $vlan;exit;interface port $port;switchport mode trunk;switchport trunk allowed vlan $vlan;write memory;exit;exit"`;
}
#---------------------------------------------------------
=head3 usage
@ -398,13 +384,14 @@ sub config_vlan {
sub usage
{
print "Usage:
configBNT [-?│-h│--help]
configBNT [--switches switchnames] [--all]
configBNT [--switches switchnames] [--ssh]
configBNT [--switches switchnames] [--license filename ]
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT [--switches switchnames] [--ntp]
configBNT [--switches switchnames] [--port port] [--vlan vlan]
configcumulus -h│--help
configcumulus --switches switchnames --ssh
configcumulus --switches switchnames --license filename
configcumulus --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group]
configcumulus --switches switchnames --ntp
To set ssh, install license(license file: /root/license.txt), config snmp and ntp:
configcumulus --switches switchnames --all
\n";
}