This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Setting up Volume Thresholds via PowerShell

Hi Experts 

Wondering if you could help.

We would like to use the new SolarWinds functionality for Volume Thresholds (ie. the thresholds you can now set via Edit Volume) to Override Orion General Thresholds.

 
 

Volume Thresholds.JPG

Historically we have been using Volume-level Custom Property to specify both warning and critical threshold. This was allowing us to customise and set per-Volume thresholds easily.

The challenge we have now is how to migrate the threshold values from Custom Property, to the new Volume Thresholds. I can easily read the Custom Property values via PowerShell, but I'm having no luck setting up the new Thresholds.

I'm trying to use Set-SwisObject for that, but it appears that the new Volume Thresholds haven’t got Uri that would uniquely identify them.

My code and error I'm getting are below:

$query = 'SELECT V.Node.Caption AS [Node], V.Caption AS [Vol], V.CustomProperties.warning_marker AS [Warn], V.CustomProperties.Critical_marker AS [Crit], V.PercentDiskUsedThreshold.ThresholdType AS [ThresholdType], V.Uri FROM Orion.Volumes V WHERE V.VolumeID = 5944'
$objVolume = $null
$objVolume = Get-SwisData -SwisConnection $swis -Query $query

foreach ($volume in $objVolume) {
Set-SwisObject $swis -Uri ("{0}/PercentDiskUsedThreshold" -f $volume.Uri) @{ ThresholdType = 1 }
}

But the error is:

Set-SwisObject : Operation not supported on Orion.PercentDiskUsedThreshold
At C:\Scripts\SW_update_volumes\update-Volumes.ps1:46 char:2
+  Set-SwisObject $swis -Uri ("{0}/PercentDiskUsedThreshold" -f $volume ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-SwisObject], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.SetSwisObject

I'm guessing this is not supported yet, and if so, is there any other way to achieve what we are trying?
Thanks

  • So in many cases if the swql "table" doesn't directly map to a real SQL table they won't allow set SWIS object on it, but if you dig around you can usually find a different area where the changes are allowed. I don't have the new version installed yet but I'd go to swql studio and just search threshold, or warning, or level1value and see if any of the tables you find with any of those has the volume thresholds, they're possibly mixed in with all kinds of other thresholds.
  • Thanks Marc,

    I had a look but still no luck.

    Orion.PercentDiskUsedThreshold inherits from Orion.VolumesThresholds, which inherits from Orion.Thresholds.

    None of the above seem to have Primary Key, or Uri values defined. Which I guess makes them unsupported by PowerShell commands. My understanding at least..

  • Whenever I can't find a verb in SWIS I always fall back to leveraging the execute sql verb under Orion.Reporting to make my changes directly, but be careful making edits like that if you try it.
  • Hi Marc,

    Thanks again for the reply, really appreciate it.
    This sounds like a way to go then, after some careful planning and testing.
    Maybe even we'll wait until the next release in case those APIs get developed.

  • Hi Robert, 

    I reach the same point, I try to massive edit volumes threshold with SQL, but [dbo].[Thresholds] table create a new row with a new primary key id once we override the volume threshold through Solarwinds console, so I can't do that in sql mode Disappointed

    The solution about Orion.Reporting evocated by , did you try that ? It works ? (1st time I read about Orion.Reporting)

    Thanks

  • I think this would be a great addition to the API, but as of the current version that I'm running (2020.2.4) the VolumeThresholds information is only read-only.

    That being said, I think this (and possibly the other thresholds) would be a good place to add for the API.  I'd personally write out what you'd like to have an options and put it in as an Orion Platform Feature Request. (Check to make sure that one like it doesn't already exist there or in the NPM or SAM Feature Request places.

    Be sure to provide the reason why you'd want something like this so that the product managers can properly investigate and prioritize it.