Is there a way through the API to determine the current managed/unmanaged state of a node?
I don't see anything in Orion.Nodes which would indicate the state of Managed/UnManaged.
When a node is currently unmanaged, the Status will be '9' (see the Orion.StatusInfo entity to translate this enumeration; note that only a few of these status apply to nodes - many are specific to Interfaces, Applications, etc.), and the Unmanaged property will be true. When a node is not currently unmanaged (e.g., polling and alerting normally), Status will be something else and Unmanaged will be false.
I personally don't unmanage devices, I do something similar to this article Re: TIPS & TRICKS: Stop the madness! Avoiding alerts but continuing to pull statistics.
with the addition of Start Time and Duration in minutes. We have a Stored Procedure that will unmute the device after the time expires so we don't have to rely on an engineer remembering to do this.
Hi dcornell,
Can you please share the stored procedure to mute/unmute the devices.
You have to create the custom properties n_mute, n_muteStartTime, n_muteDiration. I also have code that will find all the connected interfaces and mute those interfaces as well, but it is a C# PowerShell module written for our instance.
USE [SolarWindsOrion]
GO
/****** Object: StoredProcedure [dbo].[sp_UpdateMuteExpirations] Script Date: 4/20/2015 4:11:30 PM ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE PROCEDURE [dbo].[sp_UpdateMuteExpirations]
AS
BEGIN
SET NOCOUNT ON;
-- unmute and expired in Nodes table
update Nodes
set n_mute = 0,
n_muteDuration = 0,
n_muteStartTime = null
where n_muteStartTime is not null
and n_mute = 1
and DATEADD(minute,n_muteDuration,n_muteStartTime) < GETUTCDATE()
-- unmute and expired in interfaces table
update Interfaces
set i_mute = 0,
i_muteDuration = 0,
i_muteStartTime = null
where i_muteStartTime is not null
and i_mute = 1
and DATEADD(minute,i_muteDuration,i_muteStartTime) < GETUTCDATE()
END
Here is the query we use to find the connected interfaces of a node. For every connected interface we mute theses interfaces otherwise you will get alert for these as well. Remember you have to adjust your alert rules to include n_mute for nodes and I_mute for interfaces.
SELECT DestNodeID, DestInterfaceID, SrcNodeID, SrcInterfaceID FROM Orion.TopologyConnections TC JOIN Orion.NPM.Interfaces I ON I.InterfaceID = TC.DestInterfaceID JOIN Orion.Nodes N ON N.NodeID = I.NodeID WHERE SrcNodeID = {0} OR DestNodeID = {0}"
replace {0} with the nodeId of the node you want to mute.