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.

Hardware Item Threshold update via SQL

Useful query to mass add (not change, but add.. change would be a diff query) thresholds to hardware health items  and set the warning and critical amount.  To make this work, you will need 1 example of the warning and critical json that is created + a filtering mechanism  that you can use to filter out/select the hardware health items.

Here is the base of the query:

INSERT INTO [dbo].[APM_HardwareItem_Thresholds] (id, warning, critical)

SELECT ID as id, WarningJsonString, CriticalJsonString FROM [dbo].[APM_HardwareItem]

WHERE DisplayName LIKE '%Something%'

AND DisaplayName LIKE '%Something Else%'

AND ID NOT IN (SELECT ID FROM [dbo].[APM_HardwareItem_Thresholds])

The Something and Something would be the filtering of the name of the hardware health item.  The Warning and Critical Json strings would be found within the HardwareItem_Thresholds table via looking at the entry that was made for the one example hardware health item that was set up.