This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------------- | |
# Name: PowerOnUCSBlades.ps1 | |
# Author: Matthew Oswalt | |
# Created: 3/30/2012 | |
# Revision: v0.2 - BETA | |
# Rev. Date: 4/30/2013 | |
# Description: A script that powers on blades in a UCS system. | |
# Can be configured to boot all blades, or | |
# only those associated to service profiles in a | |
# given sub-organization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# InstallBFS.ps1 | |
# | |
# Very brief and informal PowerShell script to configure a Boot-From-SAN policy and attach it to the relevant service profile templates. | |
Import-Module CiscoUcsPs | |
Disconnect-Ucs | |
Connect-Ucs 10.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import json | |
import time | |
def pingOVS(HOST, PORT): | |
#Create socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
#Establish TCP session via IP address and port specified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Name: AutoBFS.ps1 | |
Author: Matthew Oswalt | |
Created: 10/20/2013 | |
Description: Reaches into a Cisco UCS Instance, and iterates through every service profile, creating Netapp initiator groups | |
and 10g boot LUNs for each one, and then putting each service profile's vHBA's WWPNs in the respective initiator groups. | |
Each igroup that is created by this script will be mapped to the respective boot LUN. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------------------------------- | |
# Name: CreateVMK.ps1 | |
# Author: Matthew Oswalt | |
# Created: 11/8/2013 | |
# Description: Creates a VMKernel port on each host connected to a vCenter instance. This will eventually get rolled into the master toolkit, so look there for updates | |
#--------------------------------------------------------------------- | |
#Import PowerCLI Module | |
Add-PSSnapin VMware.VimAutomation.Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin VMware* | |
Function Connect-vShieldServer { | |
<# | |
.SYNOPSIS | |
Connects to a vShield Manager Server. | |
.DESCRIPTION | |
Connects to a vShield Manager Server. The cmdlet starts a new session with a vShield Manager Server using the specified parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$esxhosts = Get-VMHost | Sort-Object Name | |
Foreach ($esxhost in $esxhosts) | |
{ | |
Write-Host "Starting install on $esxhost..." -ForegroundColor Green | |
$esxcli = Get-EsxCli -VMHost $esxhost | |
$esxcli.software.vib.install($null,$false,$false,$true,$false,$true,$null,$null, "/vmfs/volumes/NFS-01/_offlinebundles/net-enic-2.1.2.42-1OEM.550.0.0.1198611.x86_64.vib") | |
$esxcli.software.vib.install($null,$false,$false,$true,$false,$true,$null,$null, "/vmfs/volumes/NFS-01/_offlinebundles/scsi-fnic-1.6.0.5-1OEM.550.0.0.1198611.x86_64.vib") | |
Write-Host "Install completed on $esxhost..." -ForegroundColor Red | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Mar 13 16:21:51.733: GSI: netconf app _s_ssh.[0x7FE52EF841C8]: new ssh connection from 10.12.0.7 | |
*Mar 13 16:21:51.734: NETCONF: ns_clone.sess=0x7FE52EA3D428 | |
*Mar 13 16:21:51.734: NETCONF: naap_accept.clone=0x7FE52EA3D428 | |
*Mar 13 16:21:51.734: NETCONF: ns_send.sess=0x7FE52EA3D428 | |
<?xml version="1.0" encoding="UTF-8"?><hello><capabilities><capability>urn:ietf:params:netconf:base:1.0</capability><capability>urn:ietf:params:netconf:capability:writeable-running:1.0</capability><capability>urn:ietf:params:netconf:capability:startup:1.0</capability><capability>urn:ietf:params:netconf:capability:url:1.0</capability><capability>urn:cisco:params:netconf:capability:pi-data-model:1.0</capability><capability>urn:cisco:params:netconf:capability:notification:1.0</capability></capabilities><session-id>782488616</session-id></hello> | |
*Mar 13 16:21:51.734: NETCONF: ne_send.sess=0x7FE52EA3D428 | |
*Mar 13 16:21:51.738: GSI: netconf app _s_ssh.[0x7FE520C3ACE0]: <?xml version="1.0" encoding="UTF-8"?><nc:hello xmlns:nc="urn:ietf:param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires ncclient - https://github.com/leopoul/ncclient | |
from ncclient import manager | |
host = '67.218.95.16' | |
user = 'root' | |
password = 'root' | |
with manager.connect(host=host, port=22, username=user, password=password, hostkey_verify=False) as m: | |
c = m.get().data_xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires ncclient - https://github.com/leopoul/ncclient | |
from ncclient import manager | |
host = '192.168.7.140' | |
user = 'admin' | |
password = 'Cisco.com' | |
with manager.connect(host=host, port=22, username=user, password=password, hostkey_verify=False, device_params={'name':'nexus'}) as m: | |
#c = m.get_capabilities() |
OlderNewer