We have a scheduled network discovery configured and the results show up on the Solarwinds console as expected. Is there a way to email the results out from each scan if new devices are detected? I don't see any options on there at the moment.
is this possible? If so how?
I also whish to see what nodes where discovered during the nightly network discovery as well as a few other people that dont have access to Solarwinds console, so we need to send the report to several managers.
Please advise if this is possible and how.
thanks
Try this SQL, the DiscoveredNodes table holds the last run discovery information for the nodes found, joined against the DiscoveryProfiles to get a name for it.
SELECT DP.Name, DN.[IPAddress] ,DN.[Hostname]
,DN.[DNS]
,DN.[SysObjectID]
,DN.[Vendor]
,DN.[MachineType]
,DN.[SysDescription]
,DN.[SysName]
FROM [SolarWinds].[dbo].[DiscoveredNodes] DN
INNER JOIN DiscoveryProfiles DP
ON DP.ProfileID = DN.ProfileID
WHERE DN.ProfileID IN (SELECT ProfileID From DiscoveryProfiles
WHERE Name LIKE '<Discovery Profile Name>')
Edit the <Discovery Profile Name> to match your Discovery Profile's name and run it Database Manager, MS SQL Studio, or create an Orion Report with it.
Profile names and their history can be found with this type of SQL query:
SELECT DP.Name --Disco-Profile Name
,DL.[ProfileID] --handy to know for the SQL query above
,DL.[FinishedUTC] --When it finished
,DL.[Result] -- result code
,DL.[ResultDescription] --result description
,DL.[ErrorMessage] --NULL unless it failed
FROM [SolarWinds].[dbo].[DiscoveryLogs] DL
ON DL.ProfileID = DP.ProfileID
--AND CPUMultiLoad.TimeStampUTC > DATEADD(hh,-24, getdate()) --uncomment this and it will show only the last 24 hours of discovery history
Hope it helps
Once you see the logic and how the tables work, the alert trigger should be easy.
You know the ProfileID for the discovery, you can now check the DiscoveryLogs table for its last result [Result] or [ResultDescription] and use this as your alert trigger.
However, getting the results to display in the alert (email) might be the problem. You can write advanced SQL/SWQL queries and their result be displayed in the alert text, but it doesn't handle more than one result.
Wondering if anyone else on Thwack has gotten around this, without scripting the thing from PowerShell?
That is of course an option, call the SQL via PowerShell and then email your discovery results from from there, scheduled with Windows Scheduled Tasks.
Shouldn't need to create a separate alert for SQL for this, should be built into the feature. Will raise a request to be voted on..
https://thwack.solarwinds.com/ideas/11515