My initial commit of a powershell module for querying the new PerfStack API
Prerequisites
You need to enable basic authentication on the api2 virtual directory in IIS on all web servers hosting the solarwinds website.
Basic Steps
- Suggested that you trust all certificates
Enable-TrustAllCertificates
- Create a new Basic Authentication Credential
$Cred = New-BasicAuthCreds -Username domain\username -Password P@ssw0rd
- Create a new SolarWinds Session
$WebSession = New-SWSession -ServerName 'solarwinds.test.com' -Credential $Cred -ServerPort '6751'
- Read the Module Help
Get-Help function-name
Basic Examples
Get the first 10 entities
$WebSession | Get-SWEntities
Returns all metrics for a specified entity
$WebSession | Get-SWEntityMetrics -EntityId 0_Orion.Nodes_2055
Gets the CPU MaxLoad for an entity for the last hour
$Start = (Get-Date).AddHours(-1)
$End = Get-Date
$WebSession | Get-SWMeasurement -EntityId 0_Orion.Nodes_2055 -MetricId Orion.CPULoad.MaxLoad -StartDate $Start -EndDate $End
Returns all relationships for a specified entity
$websession | Get-SWEntityRelationships -EntityId 0_Orion.Nodes_2055