PerfStack API PowerShell Module

Version 1

    My initial commit of a powershell module for querying the new PerfStack API

     

    GitHub - StarkCaptain/solarwinds-perfstackapi: PowerShell Module that interfaces with the solarwinds orion 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

    1. Suggested that you trust all certificates Enable-TrustAllCertificates
    2. Create a new Basic Authentication Credential $Cred = New-BasicAuthCreds -Username domain\username -Password P@ssw0rd
    3. Create a new SolarWinds Session $WebSession = New-SWSession -ServerName 'solarwinds.test.com' -Credential $Cred -ServerPort '6751'
    4. 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