How to get the latest configuration of a set of devices from Config database?

We always have up to date configuration of all devices in Solarwinds (via daily backup job). I want to run some scripts against some of these configs, but I do not want to download them directly from device. Can I query these configs using SWIS API?

  • Thanks tdanner​. Sorry my question may be misleading. I am aware of the Cirrus.ConfigArchive entity, Perhaps the challenge is just a matter of constructing the SWQL query.  I am looking at something like this:

    SELECT TOP 1 Config from Cirrus.ConfigArchive C

    WHERE C.NodeID IN (SELECT NodeID from Cirrus.Nodes WHERE NodeCaption LIKE '%DSW%')

    ORDER BY DownloadTime DESC

    But this yields just 1 result whereas the sub query should yield 60 NodeID's and I need the latest config of those 60 nodes.

    On a side note, which is the official recommended way to access NCM entities? We have Cirrus.ConfigArchive & NCM.ConfigArchive entity. Is there any difference between two? I can't grasp the logic in which entities are grouped hierarchically. Sometimes I remember the entity name but spend significant time exploring schema to find the parent entity. In the earlier versions, I could grep the offline filenames now it is slightly trickier. Perhaps I should open a different thread to discuss this.

  • A query like this should work:

    SELECT c1.NodeID, c1.DownloadTime, c1.Config

    FROM Cirrus.ConfigArchive c1

    INNER JOIN (

         SELECT c2.NodeID, MAX(c2.DownloadTime) AS DownloadTime

         FROM Cirrus.ConfigArchive c2

         WHERE c2.NodeID IN (SELECT NodeID FROM Cirrus.Nodes WHERE NodeCaption LIKE '%DSW%')

         GROUP BY NodeID

    ) c3 ON c1.NodeID=c3.NodeID AND c1.DownloadTime=c3.DownloadTime

    I referred your question about Cirrus.ConfigArchive vs. NCM.ConfigArchive to the architect for NCM. I suspect the reason for having both of them is historical, but I don't know what it is.

  • Thanks! Let me try this at work next week.

  • In terms of differences in tables there is no difference. Cirrus one is old. It left there for compatibility. Suggest to use NCM one