Network Management

Orion Platform: Enable Hardware Health Sensor in bulk using SQL query

This articles provides information on using SQL queries to enable hardware health sensors for Nodes in the Orion Platform.

First published date

10/27/2018 3:13 AM

Last published date

5/31/2022 5:14 PM

Overview

Users may need to enable hardware health sensors for Nodes in bulk and this will take a long time to do on the List Resources page for each Node. The SQL queries below will enable hardware health sensors for Multiple Nodes in the Orion Platform.

Product section

Network Performance Monitor

Resolution

  1. Open Orion Database Manager (Start > All Programs > SolarWinds Orion Advanced Features > Database Manager)
  2. Connect to your DB server (if not on the list please add it with relevant credentials)
  3. Before doing any work on your database please make sure that you have a current backup, as this will make a permanent change to your database.
  4. Expand your database
  5. Right click on ANY table and select 'Query Table'
  6. Overwrite the existing query with the query given below:
-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.
INSERT INTO dbo.[NodeSettings] (NodeID, SettingName, SettingValue)
  SELECT
    n.NodeID,
    'NeedsInventory',
    'HWH'
  FROM Nodes n
  LEFT JOIN APM_HardwareInfo hw
    ON (n.NodeID = hw.NodeID)
  WHERE n.ObjectSubType = 'SNMP'
  AND hw.NodeID IS NULL
  AND n.NodeID NOT IN (SELECT
    NodeID
  FROM dbo.[NodeSettings]
  WHERE SettingName = 'NeedsInventory'
  AND SettingValue = 'HWH')
  1. Click 'Refresh' 
    • In NPM 12.1 and above, you can run the following SQL query to Enable all Hardware Health sensors at once: 
      Update [dbo].[APM_HardwareItem] set IsDisabled = '0'
    • To disable all Hardware sensors: 
      Update [dbo].[APM_HardwareItem] set IsDisabled = '1'
    • NPM 12.X and above also includes sensors that are not in the APM_Hardware tables but in the HWH_HardwareXXX tables. Here is an example query that may help disable a sensor based on Node caption and sensor name (sensorname and nodename can be changed to reflect what you are looking) : 
      Update [dbo].[HWH_HardwareItem] set IsDisabled = 0 where UniqueName = 'sensorname' and HardwareInfoID in (select ID from HWH_HardwareInfo where netobjecttype = 'N' and netobjectID in (select nodeid
      from nodesdata where caption like '%nodename%'))
Update [dbo].[HWH_HardwareItem] set IsDisabled = 0 where UniqueName = 'sensorname' and HardwareInfoID in (select ID from HWH_HardwareInfo where netobjecttype = 'N' and netobjectID in (select nodeid
from nodesdata where caption like '%nodename%'))