HP Scripting Tools for Windows PowerShell User Manual

Page 18

Advertising
background image

}

The IP addresses, including the user names and passwords, for the iLOs that you want to view are
imported from the CSV file. For each iLO included, you can identify the types of entries and the
count of each. This preceding script works for many entries in the input CSV file.

Script output:

192.168.1.9 has 93 iLO log entries.
There are 2 type(s) of events in the iLO log.
Count Name
----- ----
90 Informational
3 Caution

192.168.1.14 has 255 iLO log entries.
There are 2 type(s) of events in the iLO log.
Count Name
----- ----
221 Informational
34 Caution

From this output you can see that there are many Informational messages that you might want to
ignore. However, you might want to view the Caution messages. There are no Critical messages.

The preceding script can be modified to view the Integrated Management Log (IML). This can easily
be done with one code change and a few message changes. The following is the modified script.

PowerShell script:

$path = ".\input3.csv"
$csv = Import-Csv $path
$rt = $csv | Get-HPiLOIML
#process the system IML returned from each iLO
foreach ($ilo in $rt) {
$ilo.IP + " has " + $ilo.EVENT.Count + " IML entries."
$sevs = $(foreach ($event in $ilo.EVENT) {$event.SEVERITY})
$uniqsev = $($sevs | Sort-Object | Get-Unique)
$sevcnts = $ilo.EVENT | group-object -property SEVERITY –noelement
"There are " + $uniqsev.Count + " type(s) of events in the IML.”
$sevcnts | Format-Table
}

Script output:

192.168.1.9 has 3 IML entries.
There are 1 type(s) of events in the IML.
Count Name
----- ----
3 Informational

192.168.1.14 has 84 IML entries.
There are 3 type(s) of events in the IML.
Count Name
----- ----
22 Informational
19 Repaired
43 Caution

18

HP Scripting Tools for Windows PowerShell cmdlets

Advertising