-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGet-UcsServerFaultCount.ps1
39 lines (26 loc) · 1.16 KB
/
Get-UcsServerFaultCount.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
<#
.SYNOPSIS
Get-UcsFaultCount, get the counts of Critical, Major, Minor and Warning faults from a UCS Manager domain
.DESCRIPTION
Get-UcsFaultCount, get the counts of Critical, Major, Minor and Warning faults from a UCS Manager domain
.NOTES
John McDonough, Cisco Systems, Inc. (jomcdono)
#>
param( [Parameter(Mandatory=$true,HelpMessage="Enter UCS Manager IP")]
[string] $ucsHost,
[Parameter(Mandatory=$true,HelpMessage="Enter UCS Manager user")]
[string] $ucsUser,
[Parameter(Mandatory=$true,HelpMessage="Enter UCS Manager user's Password")]
[string] $ucsPass,
[Parameter(Mandatory=$true,HelpMessage="Enter Chassis Id")]
[string] $chassisId,
[Parameter(Mandatory=$true,HelpMessage="Enter Slot Id")]
[string] $slotId,
[switch] $fromSpark
);
Import-Module -Name Cisco.UCSManager
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $ucsUser,$(convertto-securestring -Force -AsPlainText $ucsPass)
$ucs_connection = Connect-Ucs -Name $ucsHost -Credential $credentials
$ucsServerFaults = get-ucsblade -Chassis $chassisId -SlotId $slotId | Get-ucsfault
$ucsServerFaults.Count
$ucs_connection = Disconnect-Ucs