Beruflich Dokumente
Kultur Dokumente
###############
# Cisco UCS Health Check Report Version 7 by Jeremy Waldrop of Varrow - jwaldrop
@varrow.com #
################################################################################
###############
################################################################################
######################################################################
# Setup instructions
#
# - Microsoft PowerShell 2 is required. PowerShell 2 is part of Windows 7/8/20
08-R2/2012
#
# - Cisco UCS PowerTool for UCSM - http://software.cisco.com/download/release.
html?mdfid=283850978&softwareid=284574017&release=1.0.0&flowid=25021 #
# - A local UCSM user
#
#
#
# ##############################################################################
######################################################################
#########################################
# Import the Cisco UCS PowerTool module #
#########################################
Import-Module CiscoUcsPS
######################################
# Prompt for UCSM IP and credentials #
######################################
$ucsmaddr = Read-Host "Enter name or IP of UCS Manager"
$ucsmcreds = $Host.UI.PromptForCredential( "Cisco UCS Manager Authentication","E
nter UCS Manager Login","","")
####################################################
# Prompt for HTML report file output name and path #
####################################################
$ReportFile = Read-Host "Enter path and file name for the HTML report file"
New-Item -ItemType file $ReportFile -Force
#################################
# Get the current date and time #
#################################
$date = Get-Date
########################
# Authenticate to UCSM #
########################
$handle1 = Connect-Ucs $ucsmaddr -NotDefault -Credential $ucsmcreds
$handleArray = $handle1
##################
# Mail variables #
##################
$enablemail="no"
$smtpServer = "smtpserver"
$mailfrom = "Cisco UCS Healtcheck <ucshcheck@domain.com>"
$mailto = "user@domain.com"
###################
Add-Content
Add-Content
Add-Content
Add-Content
Add-Content
Add-Content
Add-Content
Add-Content
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
####################
# Define HTML Tabs #
####################
Add-Content $ReportFile
rset=utf-8' />"
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
Add-Content $ReportFile
a></li>"
Add-Content $ReportFile
i>"
Add-Content $ReportFile
></li>"
Add-Content $ReportFile
</a></li>"
Add-Content $ReportFile
</a></li>"
Add-Content $ReportFile
a></li>"
Add-Content $ReportFile
></li>"
Add-Content $ReportFile
></li>"
Add-Content $ReportFile
pan></a></li>"
Add-Content $ReportFile
</a></li>"
Add-Content $ReportFile
a></li>"
Add-Content $ReportFile
i>"
Add-Content $ReportFile
" "
"ol#toc span {"
"
background: url(tabs.gif) 100% 0;"
"
display: block;"
"
line-height: 2em;"
"
padding-right: 10px;"
"}"
"</style>"
###########################
# Define HTML Table Style #
###########################
Add-Content $ReportFile "<style>BODY{background-color:LightGoldenRodYellow;}TABL
E{font-family: Tahoma;border-width: 2px;border-style: solid;border-color: black;
border-collapse: collapse;}TH{border-width: 2px;padding: 2px;border-style: solid
;border-color: black;background-color:LightGray}TD{border-width: 2px;padding: 2p
x;border-style: solid;border-color: black;background-color:white}</style>"
#################################
# Tab 1, UCS Hardware Inventory #
#################################
Add-Content $ReportFile "<div class='content' id='page-1'>"
################################
# Get UCS Fabric Interconnects #
################################
Add-Content $ReportFile "<H2>Fabric Interconnects</H2>"
Get-UcsNetworkElement -Ucs $handleArray | Select-Object Ucs,Rn,OobIfIp,OobIfMask
,OobIfGw,Operability,Model,Serial | ConvertTo-Html -Fragment | Out-File ucsfis.h
tml
Get-Content ucsfis.html | Add-Content $ReportFile
#########################################
# Get UCS Fabric Interconnect inventory #
#########################################
Add-Content $ReportFile "<H2>Fabric Interconnect Inventory</H2>"
Get-UcsFiModule -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select-Object
Ucs,Dn,Model,Descr,OperState,State,Serial | ConvertTo-Html -Fragment | Out-File
ucsfi-inv.html
Get-Content ucsfi-inv.html | Add-Content $ReportFile
#########################
# Get UCS License usage #
#########################
Add-Content $ReportFile "<H2>Fabric Interconnect License Usage</H2>"
Get-UcsLicense -Ucs $handleArray | Sort-Object -Property Ucs,Scope | Select-Obje
ct Ucs,Scope,AbsQuant,UsedQuant,PeerStatus,OperState | ConvertTo-Html -Fragment
| Out-File ucsfilic-inv.html
Get-Content ucsfilic-inv.html | Add-Content $ReportFile
########################
# Get UCS Chassis info #
########################
Add-Content $ReportFile "<H2>Chassis Inventory</H2>"
Get-UcsChassis -Ucs $handleArray | Sort-Object -Property Ucs,Rn | Select-Object
Ucs,Rn,AdminState,Model,OperState,LicState,Power,Thermal,Serial | ConvertTo-Html
-Fragment | Out-File ucschassis-inv.html
Get-Content ucschassis-inv.html | Add-Content $ReportFile
##############################
# Get chassis IOM (FEX) info #
##############################
Add-Content $ReportFile "<H2>IO Module (FEX) Inventory</H2>"
Get-UcsIom -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select-Object Ucs,
ChassisId,Rn,Model,Discovery,ConfigState,OperState,Side,Thermal,Serial | Convert
To-Html -Fragment | Out-File ucsiom-inv.html
Get-Content ucsiom-inv.html | Add-Content $ReportFile
#######################################################
# Get UCS Fabric Interconnect to Chassis port mapping #
#######################################################
Add-Content $ReportFile "<H2>Fabric Interconnect Chassis IOM Mappings</H2>"
Get-UcsEtherSwitchIntFIo -Ucs $handleArray | Select-Object Ucs,ChassisId,Discove
ry,Model,OperState,SwitchId,PeerSlotId,PeerPortId,SlotId,PortId,XcvrType | Conve
rtTo-Html -Fragment | Out-File ucsfichassisiommap.html
Get-Content ucsfichassisiommap.html | Add-Content $ReportFile
#######################################
# Get all UCS servers and server info #
#######################################
Add-Content $ReportFile "<H2>Server Inventory</H2>"
Get-UcsBlade -Ucs $handleArray | Sort-Object -Property Ucs,ChassisID,SlotID | Se
lect-Object Ucs,ServerId,Model,AvailableMemory,NumOfCpus,NumOfCores,NumOfCoresEn
abled,NumOfThreads,NumOfAdaptors,NumOfEthHostIfs,NumOfFcHostIfs,AssignedToDn,Pre
sence,OperState,Operability,OperPower,Serial | ConvertTo-Html -Fragment | Out-Fi
le ucsserver-inv.html
Get-Content ucsserver-inv.html | Add-Content $ReportFile
################################################
# Get UCS server adaptor (mezzanine card) info #
################################################
Add-Content $ReportFile "<H2>Server Adaptor Inventory</H2>"
Get-UcsAdaptorUnit -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select-Obj
ect Ucs,ChassisId,BladeId,Rn,Model | ConvertTo-Html -Fragment | Out-File ucsadap
tor-inv.html
Get-Content ucsadaptor-inv.html| Add-Content $ReportFile
#############################################
# Get UCS server adaptor port expander info #
#############################################
Add-Content $ReportFile "<H2>Servers with Adaptor Port Expanders</H2>"
Get-UcsAdaptorUnitExtn -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select
-Object Ucs,Dn,Model,Presence | ConvertTo-Html -Fragment | Out-File ucsadaptorex
t-inv.html
Get-Content ucsadaptorext-inv.html | Add-Content $ReportFile
#################################
# Get UCS server processor info #
#################################
Add-Content $ReportFile "<H2>Server CPU Inventory</H2>"
Get-UcsProcessorUnit -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select-O
bject Ucs,Dn,SocketDesignation,Cores,CoresEnabled,Threads,Speed,OperState,Therma
l,Model | Where-Object {$_.OperState -ne "removed"} | ConvertTo-Html -Fragment |
Out-File ucsservercpu-inv.html
Get-Content ucsservercpu-inv.html| Add-Content $ReportFile
##############################
# Get UCS server memory info #
##############################
Add-Content $ReportFile "<H2>Server Memory Inventory</H2>"
Get-UcsMemoryUnit -Ucs $handleArray | Sort-Object -Property Ucs,Dn,Location | wh
ere {$_.Capacity -ne "unspecified"} | Select-Object -Property Ucs,Dn,Location,Ca
pacity,Clock,OperState,Model | ConvertTo-Html -Fragment | Out-File ucsservermemo
ry-inv.html
Get-Content ucsservermemory-inv.html| Add-Content $ReportFile
##########################################
# Get UCS server storage controller info #
##########################################
Add-Content $ReportFile "<H2>Server Storage Controller Inventory</H2>"
Get-UcsStorageController -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Sele
ct-Object Dn,Vendor,Model | ConvertTo-Html -Fragment | Out-File ucsdiskcontrolle
r-inv.html
Get-Content ucsdiskcontroller-inv.html | Add-Content $ReportFile
##################################
# Get UCS server local disk info #
##################################
Add-Content $ReportFile "<H2>Server Local Disk Inventory</H2>"
Get-UcsStorageLocalDisk -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Selec
t-Object Ucs,Dn,Model,Size,Serial | where {$_.Size -ne "unknown"} | ConvertTo-H
tml -Fragment | Out-File ucsserverdisks-inv.html
#########################################
# Get UCS Server CIMC firmware versions #
#########################################
Add-Content $ReportFile "<H2>Server CIMC Firmware Versions</H2>"
Get-UcsFirmwareRunning -Ucs $handleArray | Select-Object Ucs,Deployment,Dn,Type,
Version | Sort-Object -Property Ucs,Dn | Where-Object {$_.Type -eq "blade-contro
ller"} | Where-Object -FilterScript {$_.Deployment -notlike "boot-loader"} | Con
vertTo-Html -Fragment | Out-File ucscimcfirmwarever.html
Get-Content ucscimcfirmwarever.html | Add-Content $ReportFile
############################################
# Get UCS Server Adaptor firmware versions #
############################################
Add-Content $ReportFile "<H2>Server Adaptor Firmware Versions</H2>"
Get-UcsFirmwareRunning -Ucs $handleArray | Select-Object Ucs,Deployment,Dn,Type,
Version | Sort-Object -Property Ucs,Dn | Where-Object {$_.Type -eq "adaptor"} |
Where-Object -FilterScript {$_.Deployment -notlike "boot-loader"} | ConvertTo-Ht
ml -Fragment | Out-File ucsadaptorfirmwarever.html
Get-Content ucsadaptorfirmwarever.html | Add-Content $ReportFile
################################
# Get UCS Server BIOS versions #
################################
Add-Content $ReportFile "<H2>Server BIOS Versions</H2>"
Get-UcsFirmwareRunning -Ucs $handleArray | Select-Object Ucs,Dn,Type,Version | S
ort-Object -Property Ucs,Dn | Where-Object {$_.Type -eq "blade-bios"} | ConvertT
o-Html -Fragment | Out-File ucsbiosver.html
Get-Content ucsbiosver.html | Add-Content $ReportFile
################
# End of Tab 3 #
################
Add-Content $ReportFile "</div>"
###############################
# Tab 4, System Configuration #
###############################
Add-Content $ReportFile "<div class='content' id='page-4'>"
###########################################
# Get UCS Cluster Configuration and State #
###########################################
Add-Content $ReportFile "<H2>Cluster Configuration</H2>"
Get-UcsStatus -Ucs $handleArray | Select-Object Name,VirtualIpv4Address,HaConfig
uration,HaReadiness,HaReady,FiALeadership,FiAOobIpv4Address,FiAOobIpv4DefaultGat
eway,FiAManagementServicesState,FiBLeadership,FiBOobIpv4Address,FiBOobIpv4Defaul
tGateway,FiBManagementServicesState | ConvertTo-Html -Fragment | Out-File ucsclu
sterconfig-inv.html
Get-Content ucsclusterconfig-inv.html | Add-Content $ReportFile
##################################################
# Get UCS Management Interface Monitoring Policy #
##################################################
Add-Content $ReportFile "<H2>Manaagement Interface Monitoring Policy</H2>"
Get-UcsMgmtInterfaceMonitorPolicy -Ucs $handleArray | Select-Object UCS,AdminSta
te,EnableHAFailover,MonitorMechanism | ConvertTo-Html -Fragment | Out-File ucsmg
mtmon-pol.html
Get-Content ucsmgmtmon-pol.html | Add-Content $ReportFile
###########################################
# Get UCS Global chassis discovery policy #
###########################################
Add-Content $ReportFile "<H2>Chassis Discovery Policy</H2>"
Get-UcsChassisDiscoveryPolicy -Ucs $handleArray | Select-Object Ucs,Rn,LinkAggre
gationPref,Action | ConvertTo-Html -Fragment | Out-File ucschassisdisc-pol.html
Get-Content ucschassisdisc-pol.html | Add-Content $ReportFile
##################################################
# Get UCS Global chassis power redundancy policy #
##################################################
Add-Content $ReportFile "<H2>Chassis Power Redundancy Policy</H2>"
Get-UcsPowerControlPolicy -Ucs $handleArray | Select-Object Ucs,Rn,Redundancy |
ConvertTo-Html -Fragment | Out-File ucschassispower-pol.html
Get-Content ucschassispower-pol.html | Add-Content $ReportFile
#########################
# Get UCS Organizations #
#########################
Add-Content $ReportFile "<H2>Organizations</H2>"
Get-UcsOrg -Ucs $handleArray | Select-Object Ucs,Name,Dn | ConvertTo-Html -Fragm
ent | Out-File ucsorgs.html
Get-Content ucsorgs.html | Add-Content $ReportFile
########################
# Get UCS Fault Policy #
########################
Add-Content $ReportFile "<H2>Fault Policy</H2>"
Get-UcsFaultPolicy -Ucs $handleArray | Select-Object Ucs,Rn,AckAction,ClearActio
n,ClearInterval,FlapInterval,RetentionInterval | ConvertTo-Html -Fragment | OutFile ucsfaultpol.html
Get-Content ucsfaultpol.html | Add-Content $ReportFile
######################################
# Get UCS Syslog Remote Destinations #
######################################
Add-Content $ReportFile "<H2>Remote Syslog</H2>"
Get-UcsSyslogClient -Ucs $handleArray | Where-Object {$_.AdminState -ne "disable
d"} | Select-Object Ucs,Rn,Severity,Hostname,ForwardingFacility | ConvertTo-Html
-Fragment | Out-File ucssyslogremote.html
Get-Content ucssyslogremote.html | Add-Content $ReportFile
##########################
# Get UCS Syslog Sources #
##########################
Add-Content $ReportFile "<H2>Syslog Sources</H2>"
Get-UcsSyslogSource -Ucs $handleArray | Select-Object Ucs,Rn,Audits,Events,Fault
s | ConvertTo-Html -Fragment | Out-File ucsyslogsources.html
Get-Content ucsyslogsources.html | Add-Content $ReportFile
#############################
# Get UCS Syslog Local File #
#############################
Add-Content $ReportFile "<H2>Syslog Local File</H2>"
Get-UcsSyslogFile -Ucs $handleArray | Select-Object Ucs,Rn,Name,AdminState,Sever
ity,Size | ConvertTo-Html -Fragment | Out-File ucsyslogfile.html
Get-Content ucsyslogfile.html | Add-Content $ReportFile
####################################
# Get UCS Full State Backup Policy #
####################################
Add-Content $ReportFile "<H2>Full State Backup Policy</H2>"
Get-UcsMgmtBackupPolicy -Ucs $handleArray | Select-Object Ucs,Descr,Host,LastBac
kup,Proto,Schedule,AdminState | ConvertTo-Html -Fragment | Out-File ucsfullbacku
p.html
Get-Content ucsfullbackup.html | Add-Content $ReportFile
####################################
# Get UCS All Config Backup Policy #
####################################
Add-Content $ReportFile "<H2>All Configuration Backup Policy</H2>"
Get-UcsMgmtCfgExportPolicy -Ucs $handleArray | Select-Object Ucs,Descr,Host,Last
Backup,Proto,Schedule,AdminState | ConvertTo-Html -Fragment | Out-File ucsallcfg
backup.html
Get-Content ucsallcfgbackup.html | Add-Content $ReportFile
############################
# Get UCS LDAP server info #
############################
Add-Content $ReportFile "<H2>LDAP Providers</H2>"
Get-UcsLdapProvider -Ucs $handleArray | Select-Object Ucs,Name,Rootdn,Basedn,Att
ribute | ConvertTo-Html -Fragment | Out-File ucsldapproviders.html
Get-Content ucsldapproviders.html | Add-Content $ReportFile
###############################
# Get UCS LDAP group mappings #
###############################
Add-Content $ReportFile "<H2>LDAP Group Mappings</H2>"
Get-UcsLdapGroupMap -Ucs $handleArray | Select-Object Ucs,Name | ConvertTo-Html
-Fragment | Out-File ucsldapgroupmaps.html
Get-Content ucsldapgroupmaps.html | Add-Content $ReportFile
#####################################
# Get UCS user and LDAP group roles #
#####################################
Add-Content $ReportFile "<H2>User Roles</H2>"
Get-UcsUserRole -Ucs $handleArray | Select-Object Ucs,Name,Dn | Where-Object {$_
.Dn -like "sys/ldap-ext*"} | ConvertTo-Html -Fragment | Out-File ucsuserroles.ht
ml
Get-Content ucsuserroles.html | Add-Content $ReportFile
########################################
# Get UCS Native Authentication Source #
########################################
Add-Content $ReportFile "<H2>Native Authentication Configuration</H2>"
Get-UcsNativeAuth -Ucs $handleArray | Select-Object Ucs,Rn,DefLogin,ConLogin,Def
RolePolicy | ConvertTo-Html -Fragment | Out-File ucsnativeauth.html
Get-Content ucsnativeauth.html | Add-Content $ReportFile
############################
# Get UCS Call Home config #
############################
Add-Content $ReportFile "<H2>Call Home Configuration</H2>"
Get-UcsCallhome -Ucs $handleArray | Sort-Object -Property Ucs | Select-Object Uc
s,AdminState | ConvertTo-Html -Fragment | Out-File ucscallhomecnfg.html
Get-Content ucscallhomecnfg.html | Add-Content $ReportFile
#################################
# Get UCS Call Home SMTP Server #
#################################
#########################
# Get UCS BIOS Policies #
#########################
Add-Content $ReportFile "<H2>BIOS Policies</H2>"
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | Selec
t-Object Ucs,Dn,Name | ConvertTo-Html -Fragment | Out-File ucsbiospols.html
Get-Content ucsbiospols.html | Add-Content $ReportFile
################################
# Get UCS BIOS Policy Settings #
################################
Add-Content $ReportFile "<H2>BIOS Policy Settings</H2>"
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfQuietBoot | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | ConvertTo-H
tml -Fragment | Out-File ucsbios-settings.html
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfPOSTErrorPause | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | Conver
tTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfResumeOnACPowerLoss | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | C
onvertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfFrontPanelLockout | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | Con
vertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosTurboBoost | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | ConvertTo-Ht
ml -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosEnhancedIntelSpeedStep | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* |
ConvertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosHyperThreading | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | ConvertT
o-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfCoreMultiProcessing | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | C
onvertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosExecuteDisabledBit | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | Conv
ertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfIntelVirtualizationTechnology | Sort-Object UCS,Dn | Select-Object UCS,
dn,Vp* | ConvertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfDirectCacheAccess | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | Con
vertTo-Html -Fragment | Out-File ucsbios-settings.html -append
Add-Content ucsbios-settings.html "<br />" -Encoding Unicode
Get-UcsBiosPolicy -Ucs $handleArray | Where-Object {$_.Name -ne "SRIOV"} | GetUcsBiosVfProcessorCState | Sort-Object UCS,Dn | Select-Object UCS,dn,Vp* | Conve
rtTo-Html -Fragment | Out-File ucsbios-settings.html -append
#############################################################
Add-Content $ReportFile "<H2>Fabric Interconnect Ethernet Uplink Port Channel Me
mbers</H2>"
Get-UcsUplinkPortChannelMember -Ucs $handleArray | Sort-Object -Property Ucs,Dn
|Select-Object Ucs,Dn,Membership | ConvertTo-Html -Fragment | Out-File ucsfiethp
cmembers.html
Get-Content ucsfiethpcmembers.html | Add-Content $ReportFile
###################################
# Get UCS QoS Class Configuration #
###################################
Add-Content $ReportFile "<H2>QoS System Class Configuration</H2>"
Get-UcsQosClass -Ucs $handleArray | Select-Object Ucs,Priority,AdminState,Cos,We
ight,Drop,Mtu | ConvertTo-Html -Fragment | Out-File ucsqossys.html
Get-Content ucsqossys.html | Add-Content $ReportFile
########################
# Get UCS QoS Policies #
########################
Add-Content $ReportFile "<H2>QoS Policies</H2>"
Get-UcsQosPolicy -Ucs $handleArray | Select-Object Ucs,Dn,Name | ConvertTo-Html
-Fragment | Out-File ucsqospol.html
Get-Content ucsqospol.html | Add-Content $ReportFile
###############################
# Get UCS QoS vNIC Policy Map #
###############################
Add-Content $ReportFile "<H2>QoS vNIC Policy Map</H2>"
Get-UcsVnicEgressPolicy -Ucs $handleArray |sort-object -Property Prio | Select-O
bject UCS,Dn,Prio | ConvertTo-Html -Fragment | Out-File ucsqosvnicpol.html
Get-Content ucsqosvnicpol.html | Add-Content $ReportFile
####################################
# Get UCS Network Control Policies #
####################################
Add-Content $ReportFile "<H2>Network Control Policies</H2>"
Get-UcsNetworkControlPolicy -Ucs $handleArray | Select-Object Ucs,Dn,Name,Cdp,Up
linkFailAction | ConvertTo-Html -Fragment | Out-File ucsnetctrlpol.html
Get-Content ucsnetctrlpol.html | Add-Content $ReportFile
##########################
# Get UCS vNIC Templates #
##########################
Add-Content $ReportFile "<H2>vNIC Templates</H2>"
Get-UcsVnicTemplate -Ucs $handleArray | Select-Object Ucs,Dn,Name,Descr,SwitchId
,TemplType,IdentPoolName,Mtu,NwCtrlPolicyName,QosPolicyName | ConvertTo-Html -Fr
agment | Out-File ucsvnictemplts.html
Get-Content ucsvnictemplts.html | Add-Content $ReportFile
##########################
# Get UCS Ethernet VLANs #
##########################
Add-Content $ReportFile "<H2>Ethernet VLANs</H2>"
Get-UcsVlan -Ucs $handleArray | where {$_.IfRole -eq "network"} | Sort-Object -P
roperty Ucs,Id | Select-Object Ucs,Id,Name,SwitchId | ConvertTo-Html -Fragment |
Out-File ucsvlans.html
Get-Content ucsvlans.html | Add-Content $ReportFile
##########################################
# Get UCS Ethernet VLAN to vNIC Mappings #
##########################################
Add-Content $ReportFile "<H2>Ethernet VLAN to vNIC Mappings</H2>"
Get-UcsAdaptorVlan -Ucs $handleArray | sort-object Ucs,Dn |Select-Object Ucs,Dn,
Name,Id,SwitchId | ConvertTo-Html -Fragment | Out-File ucsvnic2vlans.html
Get-Content ucsvnic2vlans.html | Add-Content $ReportFile
################
# End of Tab 7 #
################
Add-Content $ReportFile "</div>"
###############################
# Tab 8, SAN Configuration #
###############################
Add-Content $ReportFile "<div class='content' id='page-8'>"
##############################
# Get UCS SAN Switching Mode #
##############################
Add-Content $ReportFile "<H2>Fabric Interconnect Fibre Channel Switching Mode</H
2>"
Get-UcsSanCloud -Ucs $handleArray | Select-Object Ucs,Rn,Mode | ConvertTo-Html Fragment | Out-File ucsfifcmode.html
Get-Content ucsfifcmode.html | Add-Content $ReportFile
###############################################
# Get UCS Fabric Interconnect FC Uplink Ports #
###############################################
Add-Content $ReportFile "<H2>Fabric Interconnect FC Uplink Ports</H2>"
Get-UcsFiFcPort -Ucs $handleArray | Select-Object Ucs,EpDn,SwitchId,SlotId,PortI
d,LicState,Mode,OperSpeed,OperState,wwn | sort-object -descending | where-objec
t {$_.OperState -ne "sfp-not-present"} | ConvertTo-Html -Fragment | Out-File ucs
fifcuplinkports.html
Get-Content ucsfifcuplinkports.html | Add-Content $ReportFile
##################################################
# Get SAN Fiber Channel Uplink Port Channel info #
##################################################
Add-Content $ReportFile "<H2>Fabric Interconnect FC Uplink Port Channels</H2>"
Get-UcsFcUplinkPortChannel -Ucs $handleArray | Select-Object Ucs,Dn,Name,OperSpe
ed,OperState,Transport | ConvertTo-Html -Fragment | Out-File ucsfifcpc.html
Get-Content ucsfifcpc.html | Add-Content $ReportFile
#################################################
# Get UCS Fabric Interconnect FCoE Uplink Ports #
#################################################
Add-Content $ReportFile "<H2>Fabric Interconnect FCoE Uplink Ports</H2>"
Get-UcsFabricPort -Ucs $handleArray | Where-Object {$_.IfRole -eq "fcoe-uplink"}
| Select-Object UCS,IfRole,EpDn,LicState,OperState,OperSpeed | ConvertTo-Html Fragment | Out-File ucsfifcoeuplinkports.html
Get-Content ucsfifcoeuplinkports.html | Add-Content $ReportFile
#########################################
# Get SAN FCoE Uplink Port Channel info #
#########################################
Add-Content $ReportFile "<H2>Fabric Interconnect FCoE Uplink Port Channels</H2>"
Get-UcsFabricFcoeSanPc -Ucs $handleArray | Select-Object Ucs,Dn,Name,FcoeState,O
perState,Transport,Type | ConvertTo-Html -Fragment | Out-File ucsfifcoepc.html
Get-Content ucsfifcoepc.html | Add-Content $ReportFile
############################################
# Get SAN FCoE Uplink Port Channel Members #
############################################
Add-Content $ReportFile "<H2>Fabric Interconnect FCoE Uplink Port Channel Member
s</H2>"
Get-UcsFabricFcoeSanPcEp -Ucs $handleArray | Select-Object Ucs,Dn,IfRole,LicStat
e,Membership,OperState,SwitchId,PortId,Type | ConvertTo-Html -Fragment | Out-Fil
e ucsfifcoepcmem.html
Get-Content ucsfifcoepcmem.html | Add-Content $ReportFile
#########################
# Get UCS FC VSAN info #
#########################
Add-Content $ReportFile "<H2>FC VSANs</H2>"
Get-UcsVsan -Ucs $handleArray | Select-Object Ucs,Dn,Id,FcoeVlan,DefaultZoning |
ConvertTo-Html -Fragment | Out-File ucsvsans.html
Get-Content ucsvsans.html | Add-Content $ReportFile
########################################
# Get UCS FC Port Channel VSAN Mapping #
########################################
Add-Content $ReportFile "<H2>FC VSAN to FC Port Mappings</H2>"
Get-UcsVsanMemberFcPortChannel -Ucs $handleArray | Select-Object Ucs,EpDn,IfType
| ConvertTo-Html -Fragment | Out-File ucsvsanmap.html
Get-Content ucsvsanmap.html | Add-Content $ReportFile
##########################
# Get UCS vHBA Templates #
##########################
Add-Content $ReportFile "<H2>vHBA Templates</H2>"
Get-UcsVhbaTemplate -Ucs $handleArray | Select-Object Ucs,Dn,Name,Descr,SwitchId
,TemplType,QosPolicyName | ConvertTo-Html -Fragment | Out-File ucsvhbatemplts.ht
ml
Get-Content ucsvhbatemplts.html | Add-Content $ReportFile
##################################################
# Get UCS WWNN/WWPN vHBA and adaptor Assignments #
##################################################
Add-Content $ReportFile "<H2>vHBA Details</H2>"
Get-UcsAdaptorHostFcIf -Ucs $handleArray | sort-object -Property Ucs,VnicDn -Des
cending | Select-Object Ucs,VnicDn,Vendor,Model,LinkState,SwitchId,NodeWwn,Wwn |
Where-Object {$_.NodeWwn -ne "00:00:00:00:00:00:00:00"} | ConvertTo-Html -Fragm
ent | Out-File ucsvhbadetails.html
Get-Content ucsvhbadetails.html | Add-Content $ReportFile
#################################
# Get UCS vHBA to VSAN Mappings #
#################################
Add-Content $ReportFile "<H2>vHBA to VSAN Mappings</H2>"
Get-UcsVhbaInterface -Ucs $handleArray | Select-Object Ucs,Dn,OperVnetName,Initi
ator | Where-Object {$_.Initiator -ne "00:00:00:00:00:00:00:00"} | ConvertTo-Htm
l -Fragment | Out-File ucsvhbasanmap.html
Get-Content ucsvhbasanmap.html | Add-Content $ReportFile
################
# End of Tab 8 #
################
Add-Content $ReportFile "</div>"
#######################################
##################################
# Get UCS blade temprature stats #
##################################
Add-Content $ReportFile "<H2>Server Temperature Stats (in Celcius)</H2>"
Get-UcsComputeMbTempStats -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Sel
ect-Object Ucs,Dn,FmTempSenIo,FmTempSenIoAvg,FmTempSenIoMax,FmTempSenRear,FmTemp
SenRearAvg,FmTempSenRearMax,Suspect | ConvertTo-Html -Fragment | Out-File ucsbla
detemps.html
Get-Content ucsbladetemps.html | Add-Content $ReportFile
###################################
# Get UCS Memory temprature stats #
###################################
Add-Content $ReportFile "<H2>Cisco Memory Temperature Stats (in Celcius)</H2>"
Get-UcsMemoryUnitEnvStats -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Sel
ect-Object Ucs,Dn,Temperature,TemperatureAvg,TemperatureMax,Suspect | ConvertToHtml -Fragment | Out-File ucsmemtempstats.html
Get-Content ucsmemtempstats.html | Add-Content $ReportFile
##########################################
# Get UCS CPU Power and temprature stats #
##########################################
Add-Content $ReportFile "<H2>Cisco CPU Power and Temperature Stats (in Celcius)<
/H2>"
Get-UcsProcessorEnvStats -Ucs $handleArray | Sort-Object -Property Ucs,Dn |Selec
t-Object Ucs,Dn,InputCurrent,InputCurrentAvg,InputCurrentMax,Temperature,Tempera
tureAvg,TemperatureMax,Suspect | ConvertTo-Html -Fragment | Out-File ucscputemps
tats.html
Get-Content ucscputempstats.html | Add-Content $ReportFile
################
# End of Tab 9 #
################
Add-Content $ReportFile "</div>"
#######################################
# Tab 10, UCS Ethernet Statistics #
#######################################
Add-Content $ReportFile "<div class='content' id='page-10'>"
##############################################
# Get UCS LAN Uplink Port Channel Loss Stats #
##############################################
Add-Content $ReportFile "<H2>Cisco LAN Uplink Port Channel Loss Stats</H2>"
Get-UcsUplinkPortChannel -Ucs $handleArray | Get-UcsEtherLossStats -Ucs $handleA
rray | Sort-Object -Property Ucs,Dn | Select-Object Ucs,Dn,ExcessCollision,Exces
sCollisionDeltaAvg,LateCollision,LateCollisionDeltaAvg,MultiCollision,MultiColli
sionDeltaAvg,SingleCollision,SingleCollisionDeltaAvg | ConvertTo-Html -Fragment
| Out-File ucsuplanlossstats.html
Get-Content ucsuplanlossstats.html | Add-Content $ReportFile
#################################################
# Get UCS LAN Uplink Port Channel Receive Stats #
#################################################
Add-Content $ReportFile "<H2>Cisco LAN Uplink Port Channel Receive Stats</H2>"
Get-UcsUplinkPortChannel -Ucs $handleArray | Get-UcsEtherRxStats -Ucs $handleArr
ay | Sort-Object -Property Ucs,Dn | Select-Object Ucs,Dn,BroadcastPackets,Broadc
astPacketsDeltaAvg,JumboPackets,JumboPacketsDeltaAvg,MulticastPackets,MulticastP
acketsDeltaAvg,TotalBytes,TotalBytesDeltaAvg,TotalPackets,TotalPacketsDeltaAvg,S
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
$ReportFile
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"}"
"
"//
ng on whether the"
Add-Content $ReportFile "// element is active or not."
Add-Content $ReportFile "function setClass(elem, active) {"
Add-Content $ReportFile " var classes = elem.className.split(/\s+/);"
Add-Content $ReportFile " var cls = active ? activeClass : inactiveClass, foun
d = false;"
Add-Content $ReportFile " for (var i = 0; i < classes.length; i++) {"
Add-Content $ReportFile "
if (classes[i] == activeClass || classes[i] == i
nactiveClass) {"
Add-Content $ReportFile "
if (!found) {"
Add-Content $ReportFile "
classes[i] = cls;"
Add-Content $ReportFile "
found = true;"
Add-Content $ReportFile "
} else {"
Add-Content $ReportFile "
delete classes[i--];"
Add-Content $ReportFile "
}"
Add-Content $ReportFile "
}"
Add-Content $ReportFile " }"
Add-Content $ReportFile " "
Add-Content $ReportFile " if (!found) classes.push(cls);"
Add-Content $ReportFile " elem.className = classes.join(' ');"
Add-Content $ReportFile "}"
Add-Content $ReportFile " "
Add-Content $ReportFile "// Functions for managing the hash."
Add-Content $ReportFile "function getParams() {"
Add-Content $ReportFile " var hash = location.hash || '#';"
Add-Content $ReportFile " var parts = hash.substring(1).split('&');"
Add-Content $ReportFile " "
Add-Content $ReportFile " var params = {};"
Add-Content $ReportFile " for (var i = 0; i < parts.length; i++) {"
Add-Content $ReportFile "
var nv = parts[i].split('=');"
Add-Content $ReportFile "
if (!nv[0]) continue;"
Add-Content $ReportFile "
params[nv[0]] = nv[1] || null;"
Add-Content $ReportFile " }"
Add-Content $ReportFile " "
Add-Content $ReportFile " return params;"
Add-Content $ReportFile "}"
Add-Content $ReportFile " "
Add-Content $ReportFile "function setParams(params) {"
Add-Content $ReportFile " var parts = [];"
Add-Content $ReportFile " for (var name in params) {"
Add-Content $ReportFile "
// One of the following two lines of code must b
e commented out. Use the"
Add-Content $ReportFile "
// first to keep empty values in the hash query
string; use the second"
Add-Content $ReportFile "
// to remove them."
Add-Content $ReportFile "
//parts.push(params[name] ? name + '=' + params[
name] : name);"
Add-Content $ReportFile "
if (params[name]) parts.push(name + '=' + params
[name]);"
Add-Content $ReportFile " }"
Add-Content $ReportFile " "
Add-Content $ReportFile " location.hash = knownHash = '#' + parts.join('&');"
Add-Content $ReportFile "}"
Add-Content $ReportFile " "
Add-Content $ReportFile "// Looks for changes to the hash."
Add-Content $ReportFile "var knownHash = location.hash;"
Add-Content $ReportFile "function pollHash() {"
Add-Content $ReportFile " var hash = location.hash;"
Add-Content $ReportFile " if (hash != knownHash) {"
Add-Content $ReportFile "
var params = getParams();"
"
function attach(item, basePath) {"
if (item instanceof Array) {"
for (var i = 0; i < item.length; i++) {"
attach(item[i], basePath);"
}"
} else if (typeof item == 'object') {"
for (var p in item) {"
var path = attach(p, basePath);"
attach(item[p], path);"
}"
} else if (typeof item == 'string') {"
var path = basePath ? basePath.slice(0) : []
var e = document.getElementById(item);"
if (e)"
path.push(e);"
else "
return;"
"
if (!first) first = item;"
"
// Store the elements in a lookup table."
all[item] = path;"
"
// Attach a function that will activate the
// to all anchors."
if (item in anchors) {"
// Create a function that will call the
// the proper parameters. It will be use
var func = (function (id) {"
return function (e) {"
activate(id);"
"
if (!e) e = window.event;"
if (e.preventDefault) e.preventD
e.returnValue = false;"
return false;"
};"
})(item);"
"
for (var i = 0; i < anchors[item].length
var a = anchors[item][i];"
"
if (a.addEventListener) {"
a.addEventListener('click', func
} else if (a.attachEvent) {"
a.attachEvent('onclick', func);"
} else {"
throw 'Unsupported event model.'
}"
"
all[item].push(a);"
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
ucscimcpooladdr.html
ucsuuidpool.html
ucsuuidpoolblocks.html
ucsuuidpooladdr.html
ucsmacpools.html
ucsmacpoolblocks.html
ucsmacpooladdr.html
ucswwnpools.html
ucswwnpooladdr.html
ucsserverpools.html
ucsserverpoolassigned.html
ucsqossys.html
ucsqospol.html
ucsnetctrlpol.html
ucsvnictemplts.html
ucsvhbatemplts.html
ucsvhbasanmap.html
ucschassispwr.html
ucschassispwrstats.html
ucsbladetemps.html
ucsmemtempstats.html
ucscputempstats.html
ucsfanstats.html
ucspsus.html
ucspsustats.html
ucsuplanlossstats.html
ucsuplanrxtats.html
ucsuplantxtats.html
ucsvnictats.html
ucsfcuplinkstats.html
ucsfaults.html
ucssptemplts.html
ucssps.html
ucsvlans.html
ucsvsans.html
ucsvsanmap.html
ucsfilic-inv.html
ucscallhomecnfg.html
ucscallhomesmtpsrv.html
ucscallhomerecipients.html
ucscallsnmpcfg.html
ucsvhbadetails.html
ucsvnic2vlans.html
ucsiomtempstats.html
ucsdiskcontroller-inv.html
ucsserverdisks-inv.html
ucsfifirmwarever.html
ucsiomfirmwarever.html
ucscimcfirmwarever.html
ucsadaptorfirmwarever.html
ucsbiosver.html
ucssanbootpol.html
ucsvnicorder.html
ucsqosvnicpol.html
ucsbiospols.html
ucsbios-settings.html
ucsfifcoeuplinkports.html
ucsfifcoepc.html
ucsfifcoepcmem.html
ucsippools.html
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
Remove-Item
ucsmaint.html
ucshostfirmwarepackage.html
ucsdiskpolicy.html
ucsscrubpolicy.html
ucsfaultpol.html
ucssyslogremote.html
ucsyslogsources.html
ucsyslogfile.html
ucsfullbackup.html
ucsallcfgbackup.html
ucsadaptorext-inv.html
ucsmgmtmon-pol.html
ucsfcoeuplinkstats.html
######################
# E-mail HTML output #
######################
if ($enablemail -match "yes")
{
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($ReportFile)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = $mailfrom
$msg.To.Add($mailto)
$msg.Subject = Cisco UCS Health Check
$msg.Body = Cisco UCS Health Check, open the attached HTML file to view the repor
t.
$msg.Attachments.Add($att)
$smtp.Send($msg)
#######################
# Disconnect from UCSM#
#######################
Disconnect-Ucs
}