HPE OneView
cancel
Showing results for 
Search instead for 
Did you mean: 

OneView Custom Report

SOLVED
Go to solution
Chris_L1
Advisor

OneView Custom Report

Is there a way (PowerShell, etc) to run a script to get more information from OneView?

Our manager is looking for a report that will give the basic inventory of what we have in OV, along with physical inventory (specifically CPU and RAM) as well as CPU usage over a specific time-frame (weekly/monthly).

Any input is appreciated.

3 REPLIES
Cottoc
Advisor
Solution

Re: OneView Custom Report

Hey Chris_L1

This has actually been a topic of interest for me as well recently. My management sometimes requests some reports from me, and though I try to steer them to the built in reports from OneView and the OneView Global Dashboard, they dont always like that and just want a .csv to filter through.

Now I havent really jumped into utilization, but I know that depending on what version OneView you are running and what version of the powershell library you have there is a show-hpovutilization cmdlet. You can apply the same principles as what I have done below to that most likely to build out your own reports.

I will disclaimer this with:

-this is all just fiddling around, and there are most likely 'cleaner' ways of pulling some of this information, I am just using this as an excuse to get a little better with my own powershell skills. I would love to hear if someone else can piggy back on some of the stuff I am doing and make it better!

Additional, I am running 3 instances of OneView 3.10.08 and I run these reports using the Powershell Library release Vers. 3.10.1588.1229

@ChrisLynchHPE if I absolutely butcher something in here, just pretend like you didnt see it, I dont want you to think I just dump your awesome Powershell modules into a garbage disposal lol.

To begin, I have created a local read-only account on my OneView instances, lets call it 'ovreporting' and lets say it has a password of 'PASSWORD'. Lets also say my OneView appliances are named 'ovapp01' 'ovapp02' and 'ovapp03'

To begin I start my script by building out some variables I am going to use throughout. The formatting might get garbled in here, so apologies if this looks nasty

----------------------------------

$appliances = @('ovapp01','ovapp02','ovapp03')
$reportUsername = 'ovreporting'
$reportPassword = 'PASSWORD'
$filePath = "\\UNC_PATH\Scheduled_Reports\OneView_Reports\"
$date = Get-Date
$fileDate = "_" + $Date.Year + "-" + $Date.Month + "-" + $Date.Day
$reportName = @{
   serverInventory = "Server_Inventory";
}
$exportPath = @{
   serverInventory = $filePath + "Server_Inventory\" + $reportName.serverInventory + $fileDate + ".csv";
}

----------------------------------

I have several other reports that run in this manner, so you can follow that format within the $reportName and $exportPath variable depending on what info you are retreiving.

Note that you can also use the Global variable for appliance connection, I just wasnt aware of it when I initially started writing this script, and I just havent made it back around to correct, i just use the $appliances variable when i need to refer to 'all'

Then I loop through and connect to all of my appliances below

----------------------------------

ForEach ($appliance in $appliances)
{
Connect-HPOVMgmt -Hostname $appliance -AuthLoginDomain Local -UserName $reportUsername -Password $reportPassword
}

----------------------------------

From here I have jumped into a specific cmdlet 'Get-HPOVServer' and I pulled out only the information my Management wanted in a specific report. Again, I steer them to the built in reports as often as possible, but I still have to provide what is requested of me. I clean up the column headers just a touch and then just dump it to a .csv in the filepath we defined earlier.

----------------------------------

Get-HPOVServer -ApplianceConnection $appliances |
   Select-Object -Property @{Name="Name"; Expression={$_.name}},
      @{Name="Server Name"; Expression={$_.serverName}},
      @{Name="Serial Number"; Expression={$_.serialNumber}},
      @{Name="Asset Tag"; Expression={$_.assetTag}},
      @{Name="Status"; Expression={$_.status}},
      @{Name="Profile State"; Expression={$_.state}},
      @{Name="Power State"; Expression={$_.powerState}},
      @{Name="Intelligent Provisioning Version"; Expression={$_.intelligentProvisioningVersion}},
      @{Name="License Type"; Expression={$_.licensingIntent}},
      @{Name="Model"; Expression={$_.model}},
      @{Name="Form Factor"; Expression={$_.formFactor}},
      @{Name="Part Number"; Expression={$_.partNumber}},
      @{Name="RAM Count - GB"; Expression={$_.memoryMb / 1024}},
      @{Name="Processor Model"; Expression={$_.processorType}},
      @{Name="Processor Speed MHz"; Expression={$_.processorSpeedMhz}},
      @{Name="Processor Socket Count"; Expression={$_.processorCount}},
      @{Name="Processor Core Count"; Expression={$_.processorCoreCount}},
      @{Name="iLO Version"; Expression={$_.mpModel}},
      @{Name="iLO Firmware Version"; Expression={$_.mpFirmwareVersion}},
      @{Name="iLO Hostname"; Expression={$_.mpHostInfo.mpHostName}},
      @{Name="iLO IP"; Expression={$_.mpHostInfo.mpIpAddresses | Select-Object -ExpandProperty address}},
      @{Name="ROM Version"; Expression={$_.romVersion}},
      @{Name="Source OneView Appliance"; Expression={$_.applianceConnection.name}} |
Export-Csv -NoTypeInformation -Path $exportPath.serverInventory

----------------------------------

Once that is done I just loop through a disconnect and there you have a quick and easy report from the Powershell modules.

----------------------------------

ForEach ($appliance in $appliances)
{
Disconnect-HPOVMgmt -Hostname $appliance
}

----------------------------------

I have used this method to build out several reports. There are several ways of pulling out what you need from a cmdlet to set up a different report. I personally prefer to pipe the results of a 'get-something' or 'show-something' cmdlet to 'format-custom' and then out-file so that I can open it up in notepad++ and have it as reference while I build out what I want from the report. You can also pipe to a 'Get-Member', or even a 'Select-Object *' to find out what all is returned.

I have a handy one I use to tell me which of my Servers have a broken registration to IRS

----------------------------------

Get-HPOVServer -ApplianceConnection $appliances |
   Select-Object -Property @{Name="Name"; Expression={$_.name}},
      @{Name="Serial Number"; Expression={$_.serialNumber}},
      @{Name="Model"; Expression={$_.model}},
      @{Name="IRS Status"; Expression={$_.remoteSupportSettings.remoteSupportCurrentState}},
      @{Name="Registered Via"; Expression={$_.remoteSupportSettings.destination}} |
Export-Csv -NoTypeInformation -Path $exportPath.insightRemoteSupportStatus

----------------------------------

Hopefully that makes sense or gives you some guidance. Let me know if you have a question about my wall of text above, hopefully I will be able to answer it!

-Cottoc

Chris_L1
Advisor

Re: OneView Custom Report

Perfect outline to what I was looking for.

Thanks for the help - it is greatly appreciated.

Chris_L1
Advisor

Re: OneView Custom Report

Going to have to open new string - now requesting more information including:

CPU Utilization, Power Utilization, Temperature - on an hourly basis to span a full month.