-
Notifications
You must be signed in to change notification settings - Fork 1
/
Export-UCS-Inventory-to-html.ps1
1250 lines (1036 loc) · 66.7 KB
/
Export-UCS-Inventory-to-html.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#
.NOTES
===========================================================================
Created by: Russell Hamker
Date: July 30, 2021
Version: 1.0
Twitter: @butch7903
GitHub: https://github.com/butch7903
===========================================================================
.SYNOPSIS
This script will generate a UCS Inventory in html format.
.DESCRIPTION
Use this script to create a HTML UCS Inventory.
.NOTES
This script requires a Cisco.UCSManager version 3.0.1.2 or greater.
.TROUBLESHOOTING
#>
##Document Start Time
$STARTTIME = Get-Date -format "MMM-dd-yyyy HH-mm-ss"
$STARTTIMESW = [Diagnostics.Stopwatch]::StartNew()
##Set Variables
##Get Current Path
$pwd = pwd
$CURRENTDATE = Get-Date
#Set Months to keep data
$MONTHSTOKEEP = -3 #-3 equals 3 months
<# Originally based on the below.
Modified to add credential stored with AES Encryption and setup to read CSV list of UCS to get inventory from
# Reference code: https://github.com/smitmartijn/Cisco-UCS-Inventory-Script
#
# Cisco UCS Inventory Script (UIS) - v1.3 (17-04-2016)
# Martijn Smit <[email protected]>
#
# - Grab all information from a UCS Manager and output it to a file.
# - Useful for post-implementation info dumps and scheduled checks
#
# Usage: .\UCS-Inventory-Script-v1.2.ps1 -UCS <IP or hostname UCS Manager> [-OutFile <report.html>] [[-Password <passwd>] [-Username <user>]]
#
# - If Username or Password parameter are omitted, the script will prompt for manual credentials
#
# v1.3 - 17-04-2016 - Added multiple UCS Manager support via a CSV file and logging to a file.
# v1.2 - 30-06-2014 - Added a recommendations tab for configuration and health recommendations,
# taken from experience in the field.
# v1.1 - 30-12-2013 - Add arguments for the require input data, allow it to run as a scheduled task.
# v1.0 - 25-11-2013 - First version; capture every bit of information from UCS Manager I could think of.
#
#>
##Check if Modules are installed, if so load them, else install them
if (Get-InstalledModule -Name Cisco.UCSManager -MinimumVersion 3.0.1.2) {
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
Write-Host "PowerShell Module Cisco.UCSManager required minimum version was found previously installed"
Write-Host "Importing PowerShell Module Cisco.UCSManager"
Import-Module -Name Cisco.UCSManager
Write-Host "Importing PowerShell Module Cisco.UCSManager Completed"
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
#CLEAR
} else {
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
Write-Host "PowerShell Module Cisco.UCSManager does not exist"
Write-Host "Setting TLS Security Protocol to TLS1.2, this is needed for Proxy Access"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Host "Setting Micrsoft PowerShell Gallery as a Trusted Repository"
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Write-Host "Verifying that NuGet is at minimum version 2.8.5.201 to proceed with update"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false
Write-Host "Uninstalling any older versions of the PowerShellGet Module"
Get-Module PowerShellGet | Uninstall-Module -Force
Write-Host "Installing PowerShellGet Module"
Install-Module -Name PowerShellGet -Scope AllUsers -Force
Write-Host "Setting Execution Policy to RemoteSigned"
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
Write-Host "Uninstalling any older versions of the Cisco.UCSManager Module"
Get-Module Cisco.UCSManager | Uninstall-Module -Force
Write-Host "Installing Newest version of Cisco.UCSManager PowerShell Module"
Install-Module -Name Cisco.UCSManager -MinimumVersion 3.0.1.2 -Scope AllUsers -Force -AcceptLicense
Write-Host "Importing PowerShell Module Cisco.UCSManager"
Import-Module -Name Cisco.UCSManager
Write-Host "PowerShell Module Cisco.UCSManager Loaded"
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
#Clear
}
#if ucs-domains.csv exists, import it
$AnswerFile = $pwd.path+"\"+"ucs-domains.csv"
If (Test-Path $AnswerFile){
Write-Host "Answer file found, importing answer file"$AnswerFile
$UCSLIST = Get-Content -Path $AnswerFile | Sort
}Else{
$Answers_List = @()
$Answers="" | Select UCSList
$UCSLIST = Read-Host "Please input the FQDN or IP of your UCSM
Note: If you wish to do multiple UCSMs, edit the CSV to include many
Example 1: hamucs01.hamker.local
Example 2:
hamucs01.hamker.local
hamucs02.hamker.local
hamucs03.hamker.local
"
$Answers.UCSList = $UCSLIST
$Answers_List += $Answers
$Answers_List | Format-Table -AutoSize
Write-Host "Exporting Information to File"$AnswerFile
$Answers_List | Export-CSV -NoTypeInformation $AnswerFile
}
##Get Date Info for Logging
$LOGDATE = Get-Date -format "MMM-dd-yyyy_HH-mm"
##Specify Log File Info
$LOGFILENAME = "Log_UCS-Inventory_" + $LOGDATE + ".txt"
#Create Log Folder
$LogFolder = $pwd.path+"\Log"
If (Test-Path $LogFolder){
Write-Host "Log Directory Created. Continuing..."
}Else{
New-Item $LogFolder -type directory
}
#Specify Log File
$LOGFILE = $pwd.path+"\Log\"+$LOGFILENAME
##Starting Logging
Start-Transcript -path $LOGFILE -Append
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
Write-Host (Get-Date -format "MMM-dd-yyyy_HH-mm-ss")
Write-Host "Script Logging Started"
Write-Host (Get-Date -format "MMM-dd-yyyy_HH-mm-ss")
Write-Host "-----------------------------------------------------------------------------------------------------------------------"
##Create Secure AES Keys for User and Password Management
$KeyFile = $pwd.path+"\"+"UCSAES.key"
If (Test-Path $KeyFile){
Write-Host "AES File Exists"
$Key = Get-Content $KeyFile
Write-Host "Continuing..."
}
Else {
$Key = New-Object Byte[] 16 # You can use 16, 24, or 32 for AES
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
$Key | out-file $KeyFile
}
##Create Secure XML Credential File for UCS
$UCSCreds = $pwd.path+"\"+"UCSCreds.xml"
If (Test-Path $UCSCreds){
Write-Host "UCSCreds.xml file found"
Write-Host "Continuing..."
$ImportObject = Import-Clixml $UCSCreds
$SecureString = ConvertTo-SecureString -String $ImportObject.Password -Key $Key
$MyCredential = New-Object System.Management.Automation.PSCredential($ImportObject.UserName, $SecureString)
}
Else {
$newPScreds = Get-Credential -message "Enter UCS admin creds here:"
#$rng = [System.Security.Cryptography.RNGCryptoServiceProvider]::Create()
#$rng.GetBytes($Key)
$exportObject = New-Object psobject -Property @{
UserName = $newPScreds.UserName
Password = ConvertFrom-SecureString -SecureString $newPScreds.Password -Key $Key
}
$exportObject | Export-Clixml UCSCreds.xml
$MyCredential = $newPScreds
}
$UCSCredentials = $MyCredential
function GenerateReport()
{
Param([Parameter(Mandatory=$true)][string]$UCSM,
[Parameter(Mandatory=$true)][string]$OutFile,
[Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$UCSCredentials)
# Create or empty file
New-Item -ItemType file $OutFile -Force | Out-Null
# Get current date and time
$date = Get-Date
$Global:TMP_OUTPUT = ""
Function AddToOutput($txt)
{
$Global:TMP_OUTPUT += $txt, "`n"
}
# Connect to the UCS
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #Added for proxy requirement. may need to comment this out to disable if not using TLS1.2
$ucsc = Connect-Ucs -Name $UCSM -Credential $UCSCredentials
# Test connection
$connected = Get-UcsPSSession
if ($connected -eq $null) {
Write-Host "Error connecting to UCS Manager!"
Return
}
Write-Host "Connected to: $UCSM"
Write-Host "Starting inventory collection and outputting to: "
Write-Host "$OutFile"
# Output HTML headers and CSS
AddToOutput -txt "<html>"
AddToOutput -txt "<html>"
AddToOutput -txt "<head>"
AddToOutput -txt "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"
AddToOutput -txt "<title>UCS Inventory Script</title>"
AddToOutput -txt "<style type='text/css'>"
AddToOutput -txt "body { font-family: 'Calibri', serif; font-size:14px; }"
AddToOutput -txt "div.content { border-top: #e3e3e3 solid 3px; clear: left; width: 100%; }"
AddToOutput -txt "div.content.inactive { display: none; }"
AddToOutput -text "div.content-sub.inactive { display: none; } "
AddToOutput -txt "ul { height: 2em; list-style: none; margin: 0; padding: 0; }"
AddToOutput -txt "ul a { background: #e3e3e3; color: #000000; display: block; float: left; height: 2em; padding-left: 10px; text-decoration: none; font-weight: bold; }"
AddToOutput -txt "ul a:hover { background-color: #e85a05; background-position: 0 -120px; color: #ffffff; }"
AddToOutput -txt "ul a:hover span { background-position: 100% -120px; }"
AddToOutput -txt "ul li { float: left; margin: 0 1px 0 0; }"
AddToOutput -txt "ul li.ui-tabs-active a { background-color: #e85a05; background-position: 0 -60px; color: #fff; font-weight: bold; }"
AddToOutput -txt "ul li.ui-tabs-active a span { background-position: 100% -60px; }"
AddToOutput -txt "ul span { display: block; line-height: 2em; padding-right: 10px; }"
AddToOutput -txt "table { border: #e3e3e3 2px solid; border-collapse: collapse; min-width: 800px; }"
AddToOutput -txt "th { padding: 2px; border: #e3e3e3 2px solid; background-color:#e3e3e3; }"
AddToOutput -txt "td { padding: 2px; border: #e3e3e3 2px solid; }"
AddToOutput -txt ".ui-tabs-vertical .ui-tabs-nav { float: left; width: 250px; padding-top: 25px; }"
AddToOutput -txt ".ui-tabs-vertical .ui-tabs-nav li { height: 30px; }"
AddToOutput -txt ".ui-tabs-vertical .ui-tabs-nav li a { padding-top: 7px; width: 200px; }"
AddToOutput -txt ".ui-tabs-vertical .ui-tabs-panel { float: left; width: 1100px; }"
AddToOutput -txt "</style>"
# Include jQuery and jQueryUI and define the tabs
AddToOutput -txt "<script src='http://code.jquery.com/jquery-1.9.1.js'></script>"
AddToOutput -txt "<script src='http://code.jquery.com/ui/1.10.3/jquery-ui.js'></script>"
AddToOutput -txt "<script> jQuery(function() {"
AddToOutput -txt "jQuery('#tabs').tabs(); "
AddToOutput -txt "jQuery('#equipment-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#equipment-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#server-config-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#server-config-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#lan-config-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#lan-config-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#san-config-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#san-config-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#admin-config-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#admin-config-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#stats-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');"
AddToOutput -txt "jQuery('#stats-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "jQuery('#recommendations-tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix'); "
AddToOutput -txt "jQuery('#recommendations-tabs li').removeClass('ui-corner-top').addClass('ui-corner-left'); "
AddToOutput -txt "});</script>"
AddToOutput -txt "</head>"
AddToOutput -txt "<body>"
AddToOutput -txt "<h1>UCS Inventory Script</h1>"
AddToOutput -txt "Generated: "
$Global:TMP_OUTPUT += $date
AddToOutput -txt "<div id='tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#equipment'><span>Hardware Inventory</span></a></li>"
AddToOutput -txt "<li><a href='#server-config'><span>Service Configuration</span></a></li>"
AddToOutput -txt "<li><a href='#lan-config'><span>LAN Configuration</span></a></li>"
AddToOutput -txt "<li><a href='#san-config'><span>SAN Configuration</span></a></li>"
AddToOutput -txt "<li><a href='#admin-config'><span>Admin Configuration</span></a></li>"
AddToOutput -txt "<li><a href='#stats'><span>Statistics & Faults</span></a></li>"
AddToOutput -txt "<li><a href='#recommendations'><span>Recommendations</span></a></li>"
AddToOutput -txt "</ul>"
##########################################################################################################################################################
##########################################################################################################################################################
################################################### EQUIPMENT OVERVIEW ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='equipment'>"
AddToOutput -txt "<div id='equipment-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#equipment-tab-fi'>Fabric Interconnect</a></li>"
AddToOutput -txt "<li><a href='#equipment-tab-chassis'>Chassis</a></li>"
AddToOutput -txt "<li><a href='#equipment-tab-servers'>Servers</a></li>"
AddToOutput -txt "<li><a href='#equipment-tab-firmware'>Firmware</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='equipment-tab-fi'>"
# Get Fabric Interconnects
AddToOutput -txt "<h2>Fabric Interconnects</h2>"
$Global:TMP_OUTPUT += Get-UcsNetworkElement | Select-Object Ucs,Rn,OobIfIp,OobIfMask,OobIfGw,Operability,Model,Serial | ConvertTo-Html -Fragment
# Get Fabric Interconnect inventory
AddToOutput -txt "<h2>Fabric Interconnect Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsFiModule | Sort-Object -Property Dn | Select-Object Dn,Model,Descr,OperState,State,Serial | ConvertTo-Html -Fragment
# Get Cluster State
AddToOutput -txt "<h2>Cluster Status</h2>"
$Global:TMP_OUTPUT += Get-UcsStatus | Select-Object Name,VirtualIpv4Address,HaConfiguration,HaReadiness,HaReady,EthernetState | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsStatus | Select-Object FiALeadership,FiAOobIpv4Address,FiAManagementServicesState | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsStatus | Select-Object FiBLeadership,FiBOobIpv4Address,FiBManagementServicesState | ConvertTo-Html -Fragment
AddToOutput -txt "</div>"
AddToOutput -txt "<div class='content-sub' id='equipment-tab-chassis'>"
# Get Chassis info
AddToOutput -txt "<h2>Chassis Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsChassis | Sort-Object -Property Rn | Select-Object Rn,AdminState,Model,OperState,LicState,Power,Thermal,Serial | ConvertTo-Html -Fragment
# Get chassis IOM info
AddToOutput -txt "<h2>IOM Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsIom | Sort-Object -Property Dn | Select-Object ChassisId,Rn,Model,Discovery,ConfigState,OperState,Side,Thermal,Serial | ConvertTo-Html -Fragment
# Get Fabric Interconnect to Chassis port mapping
AddToOutput -txt "<h2>Fabric Interconnect to IOM Connections</h2>"
$Global:TMP_OUTPUT += Get-UcsEtherSwitchIntFIo | Select-Object ChassisId,Discovery,Model,OperState,SwitchId,PeerSlotId,PeerPortId,SlotId,PortId,XcvrType | ConvertTo-Html -Fragment
# Get Global chassis discovery policy
$chassisDiscoveryPolicy = Get-UcsChassisDiscoveryPolicy | Select-Object Rn,LinkAggregationPref,Action
AddToOutput -txt "<h2>Chassis Discovery Policy</h2>"
$Global:TMP_OUTPUT += $chassisDiscoveryPolicy | ConvertTo-Html -Fragment
# Get Global chassis power redundancy policy
$chassisPowerRedPolicy = Get-UcsPowerControlPolicy
AddToOutput -txt "<h2>Chassis Power Redundancy Policy</h2>"
$Global:TMP_OUTPUT += $chassisPowerRedPolicy | Select-Object Rn,Redundancy | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='equipment-tab-servers'>"
# Get all UCS servers and server info
# Does the system have blade servers? return those
if (Get-UcsBlade) {
AddToOutput -txt "<h2>Server Inventory - Blades</h2>"
$Global:TMP_OUTPUT += Get-UcsBlade | Select-Object ServerId,Model,AvailableMemory,@{N='CPUs';E={$_.NumOfCpus}},@{N='Cores';E={$_.NumOfCores}},@{N='Adaptors';E={$_.NumOfAdaptors}},@{N='eNICs';E={$_.NumOfEthHostIfs}},@{N='fNICs';E={$_.NumOfFcHostIfs}},AssignedToDn,OperPower,Serial | Sort-Object -Property ChassisID,SlotID | ConvertTo-Html -Fragment
}
# Does the system have rack servers? return those
if (Get-UcsRackUnit) {
AddToOutput -txt "<h2>Server Inventory - Rack-mounts</h2>"
$Global:TMP_OUTPUT += Get-UcsRackUnit | Select-Object ServerId,Model,AvailableMemory,@{N='CPUs';E={$_.NumOfCpus}},@{N='Cores';E={$_.NumOfCores}},@{N='Adaptors';E={$_.NumOfAdaptors}},@{N='eNICs';E={$_.NumOfEthHostIfs}},@{N='fNICs';E={$_.NumOfFcHostIfs}},AssignedToDn,OperPower,Serial | Sort-Object { [int]$_.ServerId } | ConvertTo-Html -Fragment
}
# Get server adaptor (mezzanine card) info
AddToOutput -txt "<h2>Server Adaptor Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorUnit | Sort-Object -Property Dn | Select-Object ChassisId,BladeId,Rn,Model | ConvertTo-Html -Fragment
# Get server adaptor port expander info
AddToOutput -txt "<h2>Servers with Adaptor Port Expanders</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorUnitExtn | Sort-Object -Property Dn | Select-Object Dn,Model,Presence | ConvertTo-Html -Fragment
# Get server processor info
AddToOutput -txt "<h2>Server CPU Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsProcessorUnit | Sort-Object -Property Dn | Select-Object Dn,SocketDesignation,Cores,CoresEnabled,Threads,Speed,OperState,Thermal,Model | Where-Object {$_.OperState -ne "removed"} | ConvertTo-Html -Fragment
# Get server memory info
AddToOutput -txt "<h2>Server Memory Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsMemoryUnit | Sort-Object -Property Dn,Location | where {$_.Capacity -ne "unspecified"} | Select-Object -Property Dn,Location,Capacity,Clock,OperState,Model | ConvertTo-Html -Fragment
# Get server storage controller info
AddToOutput -txt "<h2>Server Storage Controller Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsStorageController | Sort-Object -Property Dn | Select-Object Vendor,Model | ConvertTo-Html -Fragment
# Get server local disk info
AddToOutput -txt "<h2>Server Local Disk Inventory</h2>"
$Global:TMP_OUTPUT += Get-UcsStorageLocalDisk | Sort-Object -Property Dn | Select-Object Dn,Model,Size,Serial | where {$_.Size -ne "unknown"} | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='equipment-tab-firmware'>"
# Get UCSM firmware version
AddToOutput -txt "<h2>UCS Manager</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "mgmt-ext"} | ConvertTo-Html -Fragment
# Get Fabric Interconnect firmware
AddToOutput -txt "<h2>Fabric Interconnect</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "switch-kernel" -OR $_.Type -eq "switch-software"} | ConvertTo-Html -Fragment
# Get IOM firmware
AddToOutput -txt "<h2>IOM</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Deployment,Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "iocard"} | Where-Object -FilterScript {$_.Deployment -notlike "boot-loader"} | ConvertTo-Html -Fragment
# Get Server Adapter firmware
AddToOutput -txt "<h2>Server Adapters</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Deployment,Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "adaptor"} | Where-Object -FilterScript {$_.Deployment -notlike "boot-loader"} | ConvertTo-Html -Fragment
# Get Server CIMC firmware
AddToOutput -txt "<h2>Server CIMC</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Deployment,Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "blade-controller"} | Where-Object -FilterScript {$_.Deployment -notlike "boot-loader"} | ConvertTo-Html -Fragment
# Get Server BIOS versions
AddToOutput -txt "<h2>Server BIOS</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareRunning | Select-Object Dn,Type,Version | Sort-Object -Property Dn | Where-Object {$_.Type -eq "blade-bios" -Or $_.Type -eq "rack-bios"} | ConvertTo-Html -Fragment
# Get Host Firmware Packages
AddToOutput -txt "<h2>Host Firmware Packages</h2>"
$Global:TMP_OUTPUT += Get-UcsFirmwareComputeHostPack | Select-Object Dn,Name,BladeBundleVersion,RackBundleVersion | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs container
AddToOutput -txt "</div>" # end tab
##########################################################################################################################################################
##########################################################################################################################################################
################################################### SERVICE CONFIGURATION ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='server-config'>"
AddToOutput -txt "<div id='server-config-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#server-config-tab-sp'>Service Profiles</a></li>"
AddToOutput -txt "<li><a href='#server-config-tab-policies'>Policies</a></li>"
AddToOutput -txt "<li><a href='#server-config-tab-pools'>Pools</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='server-config-tab-sp'>"
# Get Service Profile Templates
AddToOutput -txt "<h2>Service Profile Templates</h2>"
$Global:TMP_OUTPUT += Get-UcsServiceProfile | Where-object {$_.Type -ne "instance"} | Sort-object -Property Name | Select-Object Dn,Name,BiosProfileName,BootPolicyName,HostFwPolicyName,LocalDiskPolicyName,MaintPolicyName,VconProfileName | ConvertTo-Html -Fragment
# Get Service Profiles
AddToOutput -txt "<h2>Service Profiles</h2>"
$Global:TMP_OUTPUT += Get-UcsServiceProfile | Where-object {$_.Type -eq "instance"} | Sort-object -Property Name | Select-Object Dn,Name,OperSrcTemplName,AssocState,PnDn,BiosProfileName,IdentPoolName,Uuid,BootPolicyName,HostFwPolicyName,LocalDiskPolicyName,MaintPolicyName,VconProfileName,OperState | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='server-config-tab-policies'>"
# Get Maintenance Policies
AddToOutput -txt "<h2>Maintenance Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsMaintenancePolicy | Select-Object Name,Dn,UptimeDisr,Descr | ConvertTo-Html -Fragment
# Get Boot Policies
AddToOutput -txt "<h2>Boot Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsBootPolicy | sort-object -Property Dn | Select-Object Dn,Name,Purpose,RebootOnUpdate | ConvertTo-Html -Fragment
# Get SAN Boot Policies
AddToOutput -txt "<h2>SAN Boot Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsLsbootSanImagePath | sort-object -Property Dn | Select-Object Dn,Type,Vnicname,Lun,Wwn | Where-Object -FilterScript {$_.Dn -notlike "sys/chassis*"} | ConvertTo-Html -Fragment
# Get Local Disk Policies
AddToOutput -txt "<h2>Local Disk Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsLocalDiskConfigPolicy | Select-Object Dn,Name,Mode,Descr | ConvertTo-Html -Fragment
# Get Scrub Policies
AddToOutput -txt "<h2>Scrub Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsScrubPolicy | Select-Object Dn,Name,BiosSettingsScrub,DiskScrub | Where-Object {$_.Name -ne "policy"} | ConvertTo-Html -Fragment
# Get BIOS Policies
AddToOutput -txt "<h2>BIOS Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Select-Object Dn,Name | ConvertTo-Html -Fragment
# Get BIOS Policy Settings
AddToOutput -txt "<h2>BIOS Policy Settings</h2>"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfQuietBoot | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfPOSTErrorPause | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfResumeOnACPowerLoss | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfFrontPanelLockout | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosTurboBoost | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosEnhancedIntelSpeedStep | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosHyperThreading | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfCoreMultiProcessing | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosExecuteDisabledBit | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfIntelVirtualizationTechnology | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfDirectCacheAccess | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfProcessorCState | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfProcessorC1E | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfProcessorC3Report | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfProcessorC6Report | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfProcessorC7Report | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfCPUPerformance | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfMaxVariableMTRRSetting | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosIntelDirectedIO | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfSelectMemoryRASConfiguration | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosNUMA | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosLvDdrMode | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfUSBBootConfig | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfUSBFrontPanelAccessLock | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfUSBSystemIdlePowerOptimizingSetting | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfMaximumMemoryBelow4GB | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfMemoryMappedIOAbove4GB | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfBootOptionRetry | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfIntelEntrySASRAIDModule | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
$Global:TMP_OUTPUT += Get-UcsBiosPolicy | Where-Object {$_.Name -ne "SRIOV"} | Get-UcsBiosVfOSBootWatchdogTimer | Sort-Object Dn | Select-Object Dn,Vp* | ConvertTo-Html -Fragment
AddToOutput -txt "<br />"
# Get Service Profiles vNIC/vHBA Assignments
AddToOutput -txt "<h2>Service Profile vNIC Placements</h2>"
$Global:TMP_OUTPUT += Get-UcsLsVConAssign -Transport ethernet | Select-Object Dn,Vnicname,Adminvcon,Order | Sort-Object Dn | ConvertTo-Html -Fragment
# Get Ethernet VLAN to vNIC Mappings #
AddToOutput -txt "<h2>Ethernet VLAN to vNIC Mappings</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorVlan | sort-object Dn |Select-Object Dn,Name,Id,SwitchId | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='server-config-tab-pools'>"
# Get UUID Suffix Pools
AddToOutput -txt "<h2>UUID Pools</h2>"
$Global:TMP_OUTPUT += Get-UcsUuidSuffixPool | Select-Object Dn,Name,AssignmentOrder,Prefix,Size,Assigned | ConvertTo-Html -Fragment
# Get UUID Suffix Pool Blocks
AddToOutput -txt "<h2>UUID Pool Blocks</h2>"
$Global:TMP_OUTPUT += Get-UcsUuidSuffixBlock | Select-Object Dn,From,To | ConvertTo-Html -Fragment
# Get UUID UUID Pool Assignments
AddToOutput -txt "<h2>UUID Pool Assignments</h2>"
$Global:TMP_OUTPUT += Get-UcsUuidpoolAddr | Where-Object {$_.Assigned -ne "no"} | select-object AssignedToDn,Id | sort-object -property AssignedToDn | ConvertTo-Html -Fragment
# Get Server Pools
AddToOutput -txt "<h2>Server Pools</h2>"
$Global:TMP_OUTPUT += Get-UcsServerPool | Select-Object Dn,Name,Assigned | ConvertTo-Html -Fragment
# Get Server Pool Assignments
AddToOutput -txt "<h2>Server Pool Assignments</h2>"
$Global:TMP_OUTPUT += Get-UcsComputePooledSlot | Select-Object Dn,Rn | ConvertTo-Html -Fragment
$Global:TMP_OUTPUT += "<br />"
$Global:TMP_OUTPUT += Get-UcsComputePooledRackUnit | Select-Object Dn,PoolableDn | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs container
AddToOutput -txt "</div>" # end tab service configuration
##########################################################################################################################################################
##########################################################################################################################################################
################################################### LAN CONFIGURATION ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='lan-config'>"
AddToOutput -txt "<div id='lan-config-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#lan-config-tab-lan'>LAN</a></li>"
AddToOutput -txt "<li><a href='#lan-config-tab-policies'>Policies</a></li>"
AddToOutput -txt "<li><a href='#lan-config-tab-pools'>Pools</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='lan-config-tab-lan'>"
# Get LAN Switching Mode
AddToOutput -txt "<h2>Fabric Interconnect Ethernet Switching Mode</h2>"
$Global:TMP_OUTPUT += Get-UcsLanCloud | Select-Object Rn,Mode | ConvertTo-Html -Fragment
# Get Fabric Interconnect Ethernet port usage and role info
AddToOutput -txt "<h2>Fabric Interconnect Ethernet Port Configuration</h2>"
$Global:TMP_OUTPUT += Get-UcsFabricPort | Select-Object Dn,IfRole,LicState,Mode,OperState,OperSpeed,XcvrType | Where-Object {$_.OperState -eq "up"} | ConvertTo-Html -Fragment
# Get Ethernet LAN Uplink Port Channel info
AddToOutput -txt "<h2>Fabric Interconnect Ethernet Uplink Port Channels</h2>"
$Global:TMP_OUTPUT += Get-UcsUplinkPortChannel | Sort-Object -Property Name | Select-Object Dn,Name,OperSpeed,OperState,Transport | ConvertTo-Html -Fragment
# Get Ethernet LAN Uplink Port Channel port membership info
AddToOutput -txt "<h2>Fabric Interconnect Ethernet Uplink Port Channel Members</h2>"
$Global:TMP_OUTPUT += Get-UcsUplinkPortChannelMember | Sort-Object -Property Dn |Select-Object Dn,Membership | ConvertTo-Html -Fragment
# Get QoS Class Configuration
AddToOutput -txt "<h2>QoS System Class Configuration</h2>"
$Global:TMP_OUTPUT += Get-UcsQosClass | Select-Object Priority,AdminState,Cos,Weight,Drop,Mtu | ConvertTo-Html -Fragment
# Get QoS Policies
AddToOutput -txt "<h2>QoS Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsQosPolicy | Select-Object Dn,Name | ConvertTo-Html -Fragment
# Get QoS vNIC Policy Map
AddToOutput -txt "<h2>QoS vNIC Policy Map</h2>"
$Global:TMP_OUTPUT += Get-UcsVnicEgressPolicy | Sort-Object -Property Prio | Select-Object Dn,Prio | ConvertTo-Html -Fragment
# Get Ethernet VLANs
AddToOutput -txt "<h2>Ethernet VLANs</h2>"
$Global:TMP_OUTPUT += Get-UcsVlan | where {$_.IfRole -eq "network"} | Sort-Object -Property Id | Select-Object Id,Name,SwitchId | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='lan-config-tab-policies'>"
# Get Network Control Policies
AddToOutput -txt "<h2>Network Control Policies</h2>"
$Global:TMP_OUTPUT += Get-UcsNetworkControlPolicy | Select-Object Dn,Name,Cdp,UplinkFailAction | ConvertTo-Html -Fragment
# Get vNIC Templates
$vnicTemplates = Get-UcsVnicTemplate | Select-Object Dn,Name,Descr,SwitchId,TemplType,IdentPoolName,Mtu,NwCtrlPolicyName,QosPolicyName
AddToOutput -txt "<h2>vNIC Templates</h2>"
$Global:TMP_OUTPUT += $vnicTemplates | ConvertTo-Html -Fragment
# Get Ethernet VLAN to vNIC Mappings #
AddToOutput -txt "<h2>Ethernet VLAN to vNIC Mappings</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorVlan | sort-object Dn |Select-Object Dn,Name,Id,SwitchId | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='lan-config-tab-pools'>"
# Get IP Pools
AddToOutput -txt "<h2>IP Pools</h2>"
$Global:TMP_OUTPUT += Get-UcsIpPool | Select-Object Dn,Name,AssignmentOrder,Size | ConvertTo-Html -Fragment
# Get IP Pool Blocks
AddToOutput -txt "<h2>IP Pool Blocks</h2>"
$Global:TMP_OUTPUT += Get-UcsIpPoolBlock | Select-Object Dn,From,To,Subnet,DefGw | ConvertTo-Html -Fragment
# Get IP CIMC MGMT Pool Assignments
AddToOutput -txt "<h2>CIMC IP Pool Assignments</h2>"
$Global:TMP_OUTPUT += Get-UcsIpPoolAddr | Sort-Object -Property AssignedToDn | where {$_.Assigned -eq "yes"} | Select-Object AssignedToDn,Id | ConvertTo-Html -Fragment
# Get MAC Address Pools
AddToOutput -txt "<h2>MAC Address Pools</h2>"
$Global:TMP_OUTPUT += Get-UcsMacPool | Select-Object Dn,Name,AssignmentOrder,Size,Assigned | ConvertTo-Html -Fragment
# Get MAC Address Pool Blocks
AddToOutput -txt "<h2>MAC Address Pool Blocks</h2>"
$Global:TMP_OUTPUT += Get-UcsMacMemberBlock | Select-Object Dn,From,To | ConvertTo-Html -Fragment
# Get MAC Pool Assignments
AddToOutput -txt "<h2>MAC Address Pool Assignments</h2>"
$Global:TMP_OUTPUT += Get-UcsVnic | Sort-Object -Property Dn | Select-Object Dn,IdentPoolName,Addr | where {$_.Addr -ne "derived"} | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs containers
AddToOutput -txt "</div>" # end tab LAN configuration
##########################################################################################################################################################
##########################################################################################################################################################
################################################### SAN CONFIGURATION ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='san-config'>"
AddToOutput -txt "<div id='san-config-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#san-config-tab-san'>SAN</a></li>"
AddToOutput -txt "<li><a href='#san-config-tab-policies'>Policies</a></li>"
AddToOutput -txt "<li><a href='#san-config-tab-pools'>Pools</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='san-config-tab-san'>"
# Get SAN Switching Mode
AddToOutput -txt "<h2>Fabric Interconnect Fibre Channel Switching Mode</h2>"
$Global:TMP_OUTPUT += Get-UcsSanCloud | Select-Object Rn,Mode | ConvertTo-Html -Fragment
# Get Fabric Interconnect FC Uplink Ports
AddToOutput -txt "<h2>Fabric Interconnect FC Uplink Ports</h2>"
$Global:TMP_OUTPUT += Get-UcsFiFcPort | Select-Object EpDn,SwitchId,SlotId,PortId,LicState,Mode,OperSpeed,OperState,wwn | sort-object -descending | where-object {$_.OperState -ne "sfp-not-present"} | ConvertTo-Html -Fragment
# Get SAN Fiber Channel Uplink Port Channel info
AddToOutput -txt "<h2>Fabric Interconnect FC Uplink Port Channels</h2>"
$Global:TMP_OUTPUT += Get-UcsFcUplinkPortChannel | Select-Object Dn,Name,OperSpeed,OperState,Transport | ConvertTo-Html -Fragment
# Get Fabric Interconnect FCoE Uplink Ports
AddToOutput -txt "<h2>Fabric Interconnect FCoE Uplink Ports</h2>"
$Global:TMP_OUTPUT += Get-UcsFabricPort | Where-Object {$_.IfRole -eq "fcoe-uplink"} | Select-Object IfRole,EpDn,LicState,OperState,OperSpeed | ConvertTo-Html -Fragment
# Get SAN FCoE Uplink Port Channel info
AddToOutput -txt "<h2>Fabric Interconnect FCoE Uplink Port Channels</h2>"
$Global:TMP_OUTPUT += Get-UcsFabricFcoeSanPc | Select-Object Dn,Name,FcoeState,OperState,Transport,Type | ConvertTo-Html -Fragment
# Get SAN FCoE Uplink Port Channel Members
AddToOutput -txt "<h2>Fabric Interconnect FCoE Uplink Port Channel Members</h2>"
$Global:TMP_OUTPUT += Get-UcsFabricFcoeSanPcEp | Select-Object Dn,IfRole,LicState,Membership,OperState,SwitchId,PortId,Type | ConvertTo-Html -Fragment
# Get FC VSAN info
AddToOutput -txt "<h2>FC VSANs</h2>"
$Global:TMP_OUTPUT += Get-UcsVsan | Select-Object Dn,Id,FcoeVlan,DefaultZoning | ConvertTo-Html -Fragment
# Get FC Port Channel VSAN Mapping
AddToOutput -txt "<h2>FC VSAN to FC Port Mappings</h2>"
$Global:TMP_OUTPUT += Get-UcsVsanMemberFcPortChannel | Select-Object EpDn,IfType | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='san-config-tab-policies'>"
# Get vHBA Templates
$vhbaTemplates = Get-UcsVhbaTemplate | Select-Object Dn,Name,Descr,SwitchId,TemplType,QosPolicyName
AddToOutput -txt "<h2>vHBA Templates</h2>"
$Global:TMP_OUTPUT += $vhbaTemplates | ConvertTo-Html -Fragment
# Get Service Profiles vNIC/vHBA Assignments
AddToOutput -txt "<h2>Service Profile vHBA Placements</h2>"
$Global:TMP_OUTPUT += Get-UcsLsVConAssign -Transport fc | Select-Object Dn,Vnicname,Adminvcon,Order | Sort-Object dn | ConvertTo-Html -Fragment
# Get vHBA to VSAN Mappings
AddToOutput -txt "<h2>vHBA to VSAN Mappings</h2>"
$Global:TMP_OUTPUT += Get-UcsVhbaInterface | Select-Object Dn,OperVnetName,Initiator | Where-Object {$_.Initiator -ne "00:00:00:00:00:00:00:00"} | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='san-config-tab-pools'>"
# Get WWNN Pools
AddToOutput -txt "<h2>WWN Pools</h2>"
$Global:TMP_OUTPUT += Get-UcsWwnPool | Select-Object Dn,Name,AssignmentOrder,Purpose,Size,Assigned | ConvertTo-Html -Fragment
# Get WWNN/WWPN Pool Assignments
AddToOutput -txt "<h2>WWN Pool Assignments</h2>"
$Global:TMP_OUTPUT += Get-UcsVhba | Sort-Object -Property Addr | Select-Object Dn,IdentPoolName,NodeAddr,Addr | where {$_.NodeAddr -ne "vnic-derived"} | ConvertTo-Html -Fragment
# Get WWNN/WWPN vHBA and adaptor Assignments
AddToOutput -txt "<h2>vHBA Details</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorHostFcIf | sort-object -Property VnicDn -Descending | Select-Object VnicDn,Vendor,Model,LinkState,SwitchId,NodeWwn,Wwn | Where-Object {$_.NodeWwn -ne "00:00:00:00:00:00:00:00"} | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs containers
AddToOutput -txt "</div>" # end tab SAN configuration
##########################################################################################################################################################
##########################################################################################################################################################
################################################### ADMIN CONFIGURATION ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='admin-config'>"
AddToOutput -txt "<div id='admin-config-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#admin-config-tab-general'>General Settings</a></li>"
AddToOutput -txt "<li><a href='#admin-config-tab-user'>User Management</a></li>"
AddToOutput -txt "<li><a href='#admin-config-tab-comm'>Communication Management</a></li>"
AddToOutput -txt "<li><a href='#admin-config-tab-license'>Licensing</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='admin-config-tab-general'>"
# Get Organizations
AddToOutput -txt "<h2>Organizations</h2>"
$Global:TMP_OUTPUT += Get-UcsOrg | Select-Object Name,Dn | ConvertTo-Html -Fragment
# Get Fault Policy
AddToOutput -txt "<h2>Fault Policy</h2>"
$Global:TMP_OUTPUT += Get-UcsFaultPolicy | Select-Object Rn,AckAction,ClearAction,ClearInterval,FlapInterval,RetentionInterval | ConvertTo-Html -Fragment
# Get Syslog Remote Destinations
AddToOutput -txt "<h2>Remote Syslog</h2>"
$Global:TMP_OUTPUT += Get-UcsSyslogClient | Where-Object {$_.AdminState -ne "disabled"} | Select-Object Rn,Severity,Hostname,ForwardingFacility | ConvertTo-Html -Fragment
# Get Syslog Sources
AddToOutput -txt "<h2>Syslog Sources</h2>"
$Global:TMP_OUTPUT += Get-UcsSyslogSource | Select-Object Rn,Audits,Events,Faults | ConvertTo-Html -Fragment
# Get Syslog Local File
AddToOutput -txt "<h2>Syslog Local File</h2>"
$Global:TMP_OUTPUT += Get-UcsSyslogFile | Select-Object Rn,Name,AdminState,Severity,Size | ConvertTo-Html -Fragment
# Get Full State Backup Policy
AddToOutput -txt "<h2>Full State Backup Policy</h2>"
$Global:TMP_OUTPUT += Get-UcsMgmtBackupPolicy | Select-Object Descr,Host,LastBackup,Proto,Schedule,AdminState | ConvertTo-Html -Fragment
# Get All Config Backup Policy
AddToOutput -txt "<h2>All Configuration Backup Policy</h2>"
$Global:TMP_OUTPUT += Get-UcsMgmtCfgExportPolicy | Select-Object Descr,Host,LastBackup,Proto,Schedule,AdminState | ConvertTo-Html -Fragment
AddToOutput -txt "</div>"
AddToOutput -txt "<div class='content-sub' id='admin-config-tab-user'>"
# Get Native Authentication Source
AddToOutput -txt "<h2>Native Authentication</h2>"
$Global:TMP_OUTPUT += Get-UcsNativeAuth | Select-Object Rn,DefLogin,ConLogin,DefRolePolicy | ConvertTo-Html -Fragment
# Get local users
AddToOutput -txt "<h2>Local users</h2>"
$Global:TMP_OUTPUT += Get-UcsLocalUser | Sort-Object Name | Select-Object Name,Email,AccountStatus,Expiration,Expires,PwdLifeTime | ConvertTo-Html -Fragment
# Get LDAP server info
AddToOutput -txt "<h2>LDAP Providers</h2>"
$Global:TMP_OUTPUT += Get-UcsLdapProvider | Select-Object Name,Rootdn,Basedn,Attribute | ConvertTo-Html -Fragment
# Get LDAP group mappings
AddToOutput -txt "<h2>LDAP Group Mappings</h2>"
$Global:TMP_OUTPUT += Get-UcsLdapGroupMap | Select-Object Name | ConvertTo-Html -Fragment
# Get user and LDAP group roles
AddToOutput -txt "<h2>LDAP User Roles</h2>"
$Global:TMP_OUTPUT += Get-UcsUserRole | Select-Object Name,Dn | Where-Object {$_.Dn -like "sys/ldap-ext*"} | ConvertTo-Html -Fragment
# Get tacacs providers
AddToOutput -txt "<h2>TACACS+ Providers</h2>"
$Global:TMP_OUTPUT += Get-UcsTacacsProvider | Sort-Object -Property Order,Name | Select-Object Order,Name,Port,KeySet,Retries,Timeout | ConvertTo-Html -Fragment
AddToOutput -txt "</div>"
AddToOutput -txt "<div class='content-sub' id='admin-config-tab-comm'>"
# Get Call Home config
$callHome = Get-UcsCallhome
AddToOutput -txt "<h2>Call Home Configuration</h2>"
$Global:TMP_OUTPUT += $callHome | Sort-Object -Property Ucs | Select-Object AdminState | ConvertTo-Html -Fragment
# Get Call Home SMTP Server
AddToOutput -txt "<h2>Call Home SMTP Server</h2>"
$Global:TMP_OUTPUT += Get-UcsCallhomeSmtp | Sort-Object -Property Ucs | Select-Object Host | ConvertTo-Html -Fragment
# Get Call Home Recipients
AddToOutput -txt "<h2>Call Home Recipients</h2>"
$Global:TMP_OUTPUT += Get-UcsCallhomeRecipient | Sort-Object -Property Ucs | Select-Object Dn,Email | ConvertTo-Html -Fragment
# Get SNMP Configuration
AddToOutput -txt "<h2>SNMP Configuration</h2>"
$Global:TMP_OUTPUT += Get-UcsSnmp | Sort-Object -Property Ucs | Select-Object AdminState,Community,SysContact,SysLocation | ConvertTo-Html -Fragment
# Get DNS Servers
$dnsServers = Get-UcsDnsServer | Select-Object Name
AddToOutput -txt "<h2>DNS Servers</h2>"
$Global:TMP_OUTPUT += $dnsServers | ConvertTo-Html -Fragment
# Get Timezone
AddToOutput -txt "<h2>Timezone</h2>"
$Global:TMP_OUTPUT += Get-UcsTimezone | Select-Object Timezone | ConvertTo-Html -Fragment
# Get NTP Servers
$ntpServers = Get-UcsNtpServer | Select-Object Name
AddToOutput -txt "<h2>NTP Servers</h2>"
$Global:TMP_OUTPUT += $ntpServers | ConvertTo-Html -Fragment
# Get Cluster Configuration and State
AddToOutput -txt "<h2>Cluster Configuration</h2>"
$Global:TMP_OUTPUT += Get-UcsStatus | Select-Object Name,VirtualIpv4Address,HaConfiguration,HaReadiness,HaReady,FiALeadership,FiAOobIpv4Address,FiAOobIpv4DefaultGateway,FiAManagementServicesState,FiBLeadership,FiBOobIpv4Address,FiBOobIpv4DefaultGateway,FiBManagementServicesState | ConvertTo-Html -Fragment
# Get Management Interface Monitoring Policy
AddToOutput -txt "<h2>Management Interface Monitoring Policy</h2>"
$Global:TMP_OUTPUT += Get-UcsMgmtInterfaceMonitorPolicy | Select-Object AdminState,EnableHAFailover,MonitorMechanism | ConvertTo-Html -Fragment
AddToOutput -txt "</div>"
AddToOutput -txt "<div class='content-sub' id='admin-config-tab-license'>"
# Get host-id information
AddToOutput -txt "<h2>Fabric Interconnect HostIDs</h2>"
$Global:TMP_OUTPUT += Get-UcsLicenseServerHostId | Sort-Object -Property Scope | Select-Object Scope,HostId | ConvertTo-Html -Fragment
# Get installed license information
$ucsLicenses = Get-UcsLicense
AddToOutput -txt "<h2>Installed Licenses</h2>"
$Global:TMP_OUTPUT += $ucsLicenses | Sort-Object -Property Scope,Feature | Select-Object Scope,Feature,Sku,AbsQuant,UsedQuant,GracePeriodUsed,OperState,PeerStatus | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs containers
AddToOutput -txt "</div>" # end tab SAN configuration
##########################################################################################################################################################
##########################################################################################################################################################
################################################### STATISTICS ##############################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='stats'>"
AddToOutput -txt "<div id='stats-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#stats-tab-faults'>Faults</a></li>"
AddToOutput -txt "<li><a href='#stats-tab-equip'>Equipment</a></li>"
AddToOutput -txt "<li><a href='#stats-tab-eth'>Ethernet</a></li>"
AddToOutput -txt "<li><a href='#stats-tab-fc'>Fiberchannel</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='stats-tab-faults'>"
# Get all UCS Faults sorted by severity
AddToOutput -txt "<h2>Faults</h2>"
$Global:TMP_OUTPUT += Get-UcsFault | Sort-Object -Property @{Expression = {$_.Severity}; Ascending = $true}, Created -Descending | Select-Object Severity,Created,Descr,dn | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='stats-tab-equip'>"
# Get chassis power usage stats
AddToOutput -txt "<br /><small>* Temperatures are in Celcius</small>"
AddToOutput -txt "<h2>Chassis Power</h2>"
$Global:TMP_OUTPUT += Get-UcsChassisStats | Select-Object Dn,InputPower,InputPowerAvg,InputPowerMax,InputPowerMin,OutputPower,OutputPowerAvg,OutputPowerMax,OutputPowerMin,Suspect | ConvertTo-Html -Fragment
# Get chassis and FI power status
AddToOutput -txt "<h2>Chassis and Fabric Interconnect Power Supply Status</h2>"
$Global:TMP_OUTPUT += Get-UcsPsu | Sort-Object -Property Dn | Select-Object Dn,OperState,Perf,Power,Thermal,Voltage | ConvertTo-Html -Fragment
# Get chassis PSU stats
AddToOutput -txt "<h2>Chassis Power Supplies</h2>"
$Global:TMP_OUTPUT += Get-UcsPsuStats | Sort-Object -Property Dn | Select-Object Dn,AmbientTemp,AmbientTempAvg,Input210v,Input210vAvg,Output12v,Output12vAvg,OutputCurrentAvg,OutputPowerAvg,Suspect | ConvertTo-Html -Fragment
# Get chassis and FI fan stats
AddToOutput -txt "<h2>Chassis and Fabric Interconnect Fan</h2>"
$Global:TMP_OUTPUT += Get-UcsFan | Sort-Object -Property Dn | Select-Object Dn,Module,Id,Perf,Power,OperState,Thermal | ConvertTo-Html -Fragment
# Get chassis IOM temp stats
AddToOutput -txt "<h2>Chassis IOM Temperatures</h2>"
$Global:TMP_OUTPUT += Get-UcsEquipmentIOCardStats | Sort-Object -Property Dn | Select-Object Dn,AmbientTemp,AmbientTempAvg,Temp,TempAvg,Suspect | ConvertTo-Html -Fragment
# Get server power usage
AddToOutput -txt "<h2>Server Power</h2>"
$Global:TMP_OUTPUT += Get-UcsComputeMbPowerStats | Sort-Object -Property Dn | Select-Object Dn,ConsumedPower,ConsumedPowerAvg,ConsumedPowerMax,InputCurrent,InputCurrentAvg,InputVoltage,InputVoltageAvg,Suspect | ConvertTo-Html -Fragment
# Get server temperatures
AddToOutput -txt "<h2>Server Temperatures</h2>"
$Global:TMP_OUTPUT += Get-UcsComputeMbTempStats | Sort-Object -Property Dn | Select-Object Dn,FmTempSenIo,FmTempSenIoAvg,FmTempSenIoMax,FmTempSenRear,FmTempSenRearAvg,FmTempSenRearMax,Suspect | ConvertTo-Html -Fragment
# Get Memory temperatures
AddToOutput -txt "<h2>Memory Temperatures</h2>"
$Global:TMP_OUTPUT += Get-UcsMemoryUnitEnvStats | Sort-Object -Property Dn | Select-Object Dn,Temperature,TemperatureAvg,TemperatureMax,Suspect | ConvertTo-Html -Fragment
# Get CPU power and temperatures
AddToOutput -txt "<h2>CPU Power and Temperatures</h2>"
$Global:TMP_OUTPUT += Get-UcsProcessorEnvStats | Sort-Object -Property Dn | Select-Object Dn,InputCurrent,InputCurrentAvg,InputCurrentMax,Temperature,TemperatureAvg,TemperatureMax,Suspect | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='stats-tab-eth'>"
# Get LAN Uplink Port Channel Loss Stats
AddToOutput -txt "<h2>LAN Uplink Port Channel Loss</h2>"
$Global:TMP_OUTPUT += Get-UcsUplinkPortChannel | Get-UcsEtherLossStats | Sort-Object -Property Dn | Select-Object Dn,ExcessCollision,ExcessCollisionDeltaAvg,LateCollision,LateCollisionDeltaAvg,MultiCollision,MultiCollisionDeltaAvg,SingleCollision,SingleCollisionDeltaAvg | ConvertTo-Html -Fragment
# Get LAN Uplink Port Channel Receive Stats
AddToOutput -txt "<h2>LAN Uplink Port Channel Receive</h2>"
$Global:TMP_OUTPUT += Get-UcsUplinkPortChannel | Get-UcsEtherRxStats | Sort-Object -Property Dn | Select-Object Dn,BroadcastPackets,BroadcastPacketsDeltaAvg,JumboPackets,JumboPacketsDeltaAvg,MulticastPackets,MulticastPacketsDeltaAvg,TotalBytes,TotalBytesDeltaAvg,TotalPackets,TotalPacketsDeltaAvg,Suspect | ConvertTo-Html -Fragment
# Get LAN Uplink Port Channel Transmit Stats
AddToOutput -txt "<h2>LAN Uplink Port Channel Transmit</h2>"
$Global:TMP_OUTPUT += Get-UcsUplinkPortChannel | Get-UcsEtherTxStats | Sort-Object -Property Dn | Select-Object Dn,BroadcastPackets,BroadcastPacketsDeltaAvg,JumboPackets,JumboPacketsDeltaAvg,MulticastPackets,MulticastPacketsDeltaAvg,TotalBytes,TotalBytesDeltaAvg,TotalPackets,TotalPacketsDeltaAvg,Suspect | ConvertTo-Html -Fragment
# Get vNIC Stats
AddToOutput -txt "<h2>vNICs</h2>"
$Global:TMP_OUTPUT += Get-UcsAdaptorVnicStats | Sort-Object -Property Dn | Select-Object Dn,BytesRx,BytesRxDeltaAvg,BytesTx,BytesTxDeltaAvg,PacketsRx,PacketsRxDeltaAvg,PacketsTx,PacketsTxDeltaAvg,DroppedRx,DroppedRxDeltaAvg,DroppedTx,DroppedTxDeltaAvg,ErrorsTx,ErrorsTxDeltaAvg,Suspect | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "<div class='content-sub' id='stats-tab-fc'>"
# Get FC Uplink Port Channel Loss Stats
AddToOutput -txt "<h2>FC Uplink Ports</h2>"
$Global:TMP_OUTPUT += Get-UcsFcErrStats | Sort-Object -Property Dn | Select-Object Dn,CrcRx,CrcRxDeltaAvg,DiscardRx,DiscardRxDeltaAvg,DiscardTx,DiscardTxDeltaAvg,LinkFailures,SignalLosses,Suspect | ConvertTo-Html -Fragment
# Get FCoE Uplink Port Channel Stats
AddToOutput -txt "<h2>FCoE Uplink Port Channels</h2>"
$Global:TMP_OUTPUT += Get-UcsEtherFcoeInterfaceStats | Select-Object DN,BytesRx,BytesTx,DroppedRx,DroppedTx,ErrorsRx,ErrorsTx | ConvertTo-Html -Fragment
AddToOutput -txt "</div>" # end subtab
AddToOutput -txt "</div>" # end subtabs containers
AddToOutput -txt "</div>" # end tab SAN configuration
##########################################################################################################################################################
##########################################################################################################################################################
################################################# RECOMMENDATIONS ###########################################################################
##########################################################################################################################################################
##########################################################################################################################################################
AddToOutput -txt "<div class='content' id='recommendations'>"
AddToOutput -txt "<div id='recommendations-tabs'>"
AddToOutput -txt "<ul>"
AddToOutput -txt "<li><a href='#recommendations-tab'>Recommendations</a></li>"
AddToOutput -txt "</ul>"
AddToOutput -txt "<div class='content-sub' id='recommendations-tab'>"
AddToOutput -txt "<h2>Recommendations</h2>"
AddToOutput -txt "<table>"
AddToOutput -txt "<tr><th>Recommendation</th><th>Status</th></tr>"
# DNS servers defined?
$recommendationText = "Are there DNS server(s) configured?"
if($dnsServers.count -eq 0) {
AddToOutput -txt "<tr><td>$recommendationText</td><td style='background-color: red'>No</td></tr>"
}
else {
AddToOutput -txt "<tr><td>$recommendationText</td><td style='background-color: green'>Yes</td></tr>"
}
# NTP servers defined?
$recommendationText = "Are there NTP server(s) configured?"
if($ntpServers.count -eq 0) {
AddToOutput -txt "<tr><td>$recommendationText</td><td style='background-color: red'>No</td></tr>"
}
else {
AddToOutput -txt "<tr><td>$recommendationText</td><td style='background-color: green'>Yes</td></tr>"
}
# Telnet disabled?
$recommendationText = "Is telnet disabled?"