Pages

1/25/2012

Script to push config changes to switches and routers.

Perl::Cisco::Script to push config changes to switches and routers.


#reconfig.pl
#
#############
use Net::Telnet;
#
my $list = "./list.txt";
my $cmd = "./cmds.txt";
my $login = "config";
my $password = "XXXXXXXXXX";
open HOSTS, "<", $list or die "$list not found!";
    my @all = ;
close HOSTS;
open CMDS, "<", $cmd or die "$cmd not found!";
    my @todo = ;
close CMDS;
###############
foreach $host (@all) {
$host =~ s/^\s+//;
$host =~ s/\s+$//;
my $outfile = "./$host-log.txt";
open OUT, ">", $outfile or die "Unable to create $outfile!";
print $host;
 if ($host =~ m/#/i) { #skip
  next;
 }
 print OUT "HOST=$host\n";
 $telnet = new Net::Telnet ( 
     Timeout=>15,
  Errmode=> sub{&ConnErr},
  Prompt => '/.*#$/');
 $telnet->open($host);
 $telnet->login($login, $password);
 foreach $task (@todo) {
  if ($task =~ m/#/i) { #skip
   next;
   }
  print OUT " -> $task  <-\t";
  @result = $telnet->cmd(String =>$task, Prompt => '/.*#$/');
  $telnet->waitfor('/#/');
  print OUT @result;
  print OUT "\r\n";
  foreach $line (@result) {
   if (($line =~ m/%/i)or($line =~ m/Translating/i)) { #Woah there!
    print OUT "ERROR:  Terminating\r\n";
    print "ERROR:  Check Log\r\n";
    exit;
   }
  }
  $telnet->waitfor('/#/');
 } #foreach task
print OUT "----------------------------------------\r\n";
#$telnet->waitfor('/#/');
close OUT;
} #foreach host

#END MAIN

################
sub ConnErr {
    print OUT "ERROR:  Connection Failed to $host\r\n";
    print OUT "----------------------------------------\r\n";
    next;
}
################

1/23/2012

Robert Chase: VMware ESXi SSH CLI commands

Robert Chase: VMware ESXi SSH CLI commands
  • vim-cmd vmsvc/getallvms
    • Lists all vm's running on hypervisor and provides vmid
  • vim-cmd vmsvc/power.off vmid
    • Powers off vmid referenced from getallvms command
  • vim-cmd vmsvc/power.on vmid
    • Powers off vmid referenced from getallvms command
  • vim-cmd vmsvc/power.reboot vmid
    • Reboots vmid referenced from getallvms command
  • vim-cmd vmsvc/destroy vmid
    • Deletes the vmdk and vmx files from disk
  • vim-cmd hostsvc/maintenance_mode_enter
    • Puts hypervisor into maintenance mode
  • vim-cmd hostsvc/maintenance_mode_exit
    • Takes hypervisor out of maintenance mode
  • vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx
    • Registers vm in hypervisor inventory
  • vim-cmd vmsvc/unregister vmid
    • Unregisters vm with hypervisor
  • vim-cmd vmsvc/tools.install vmid
    • Starts vmware tools installation for VM
  • vim-cmd hostsvc/net/info
    • Provides information about hypervisor networking
  • chkconfig -l
    • Shows daemons running on hypervisor. Can also be used for configuration.
  • esxtop
    • Same as linux top for vmware
  • vmkerrcode -l
    • List of vmkernel errors
  • esxcfg-info
    • Lists a LOT of information about the esx host
  • esxcfg-nics -l
    • Lists information about NIC's. Can also be used for configuration.
  • esxcfg-vswitch -l
    • Lists information about virtual switching. Can also be used for configuration.
  • dcui
    • Provides console screen to ssh session
  • vsish
    • Vmware interactive shell
  • decodeSel /var/log/ipmi_sel.raw
    • Read System Event Log of server

1/18/2012

Vsphere 5

UCS & VMWare: 
Suppress Management Network Redundancy Warning
PROBLEM
With UCS we have NIC redundancy built in.  So I can make vmnic0 the interface on the management network on the "local" vswitch and put vmnic1 on the distributed vswitch.  The vmware virtual NIC's will map to the UCS vnic1-A and vnic1-B interfaces which failover to each other at the UCS layer. 
But VMWare warns me that the host has no management network redundancy when I add it to the HA cluster.  I could create more vNIC's in UCS but that "wastes" a virtual interface in UCS just to make VMWare shut up about it.
SOLUTION
This warning can be suppressed under advanced options.  Set das.ignoreRedundantNetWarning to true to suppress the warning on hosts not configured in an HA cluster. Then tell it to reconfigure HA.

1/17/2012

Cisco sfp+ fiber modules


Cisco SFP+ Modules Fiber Info


Cisco SFP-10G-SR
The Cisco 10GBASE-SR Module supports a link length of 26m on standard Fiber Distributed Data Interface (FDDI)-grade multimode fiber (MMF). Using 2000MHz*km MMF (OM3), up to 300m link lengths are possible. Using 4700MHz*km MMF (OM4), up to 400m link lengths are possible.

Cisco SFP-10G-LRM
The Cisco 10GBASE-LRM Module supports link lengths of 220m on standard Fiber Distributed Data Interface (FDDI) grade multimode fiber (MMF). To ensure that specifications are met over FDDI-grade, OM1 and OM2 fibers, the transmitter should be coupled through a mode conditioning patch cord. No mode conditioning patch cord is required for applications over OM3 or OM4. For additional information on mode conditioning patch cord requirements please see: http://www.cisco.com/en/US/prod/collateral/modules/ps5455/product_bulletin_c25-530836.html.
The Cisco 10GBASE-LRM Module also supports link lengths of 300m on standard single-mode fiber (SMF, G.652).

Cisco FET-10G
The Cisco FET-10G Fabric Extender Transceiver support link lengths up to 100m on laser-optimized OM3 or OM4 multimode fiber. It is supported on fabric links only from a Nexus 2000 to a Cisco parent switch. Note this product is not orderable individually. For more information refer to Nexus 2000 datasheet: http://www.cisco.com/en/US/prod/collateral/switches/ps9441/ps10110/data_sheet_c78-507093.html.

Cisco SFP-10G-LR
The Cisco 10GBASE-LR Module supports a link length of 10 kilometers on standard single-mode fiber (SMF, G.652).

Cisco SFP-10G-ER
The Cisco 10GBASE-ER Module supports a link length of up to 40 kilometers on standard single-mode fiber (SMF, G.652).

Cisco SFP-10G-ZR
The Cisco 10GBASE-ZR Module supports link lengths of up to about 80 kilometers on standard single-mode fiber (SMF, G.652). This interface is not specified as part of the 10 Gigabit Ethernet standard and is instead built according to Cisco specifications.

Cisco SFP+ Copper - (twinax)
Cisco SFP+ Copper Twinax cables are suitable for very short distances and offer a highly cost-effective way to connect within racks and across adjacent racks. Cisco offers passive Twinax cables in lengths of 1, 3 and 5 meters, and active Twinax cables in lengths of 7 and 10 meters.

Wireless info