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.

Manage Nodes With NCM setting in Database

Hi guys,

I've searched and search and searched some more but can't find the table in which this setting is stored.

Does anyone know where the change is being made?

TIA

/Deltona

  • The settings is stored in the NCM_NCMSettings table.

    Jiri

  • Are you sure?

    I am not getting the list of nodes when running SELECT * FROM NCM_NCMSettings

    All I get is the location of NCMIndexCatalogPath, Support Account Limitation in NCM Jobs, Vuln Last Error/Run.

  • We're obviously talking about different things. For me, "settings" is the data that you see in the Settings section in the Web UI.

    You are looking for something else. If you tell me a little more, I can find out where that is in the DB.

    Jiri

  • Sorry about that, The explanation could have been more clear.

    I am looking for the table in the database where you'd find all Node IDs and their setting for being enabled in NCM or not.

    A super simple example would be the following:

    NodeID           NCMLicensed

    1                     Yes

    2                     Yes

    3                     No

    4                     No

    5                     Yes

  • I don't know if there is an explicit column in a table that says that.  However, you can figure it out quite easily.   In the "Nodes" table (or view) in NPM, you have your NodeID.  In the NCM_NodeProperties table you have a couple columns "NodeID" (which is specific to NCM) and "CoreNodeID" which would be the same as the NodeID is in the NPM Nodes table.   If you do a left outer join on them, if there isn't a NCM_NodeProperties.NodeID in the resulting table you know its not in NCM...

    SELECT TOP 100 N.NodeID, CASE WHEN NCM.NodeID IS NULL THEN 'False' ELSE 'True' END AS InNCM

    FROM Nodes N LEFT OUTER JOIN NCM_NodeProperties NCM ON (N.NodeID = NCM.CoreNodeID)

    This query should illustrate it, rather than having the second column be the NCM_NodeProperties.NodeID (or NULL) I converted it to a true/false with the "CASE" statement..

    HTH!!

  • Hi Craig,

    Thanks for the query. I have tested it and it works as explained.

    Ultimately, what I'm after is a query that will add nodes to the NCM_NodePorperties table because NCM currently can't do this automatically.

    It would be a SQL job that runs once a day. If a Node who's vendor = Cisco, and is not in the NCM_NodeProperties table, then the query would add that Node to NCM.

    Does it make sense?

  • Ok, then I would do the following using Orion SDK:

    1. Find out which nodes are/aren't licensed by NCM. SWQL:

      SELECT n.NodeId, n.Caption,n.NCMLicenseStatus.LicensedByNCM
      FROM Orion.Nodes as n

    2. Add these nodes to NCM using the following verb for one node:
      AddNodeToNCM(NodeId)

    Jiri

  • Any chance this could be done using raw SQL queries?

    Use of the SDK add a layer of complexity that I'd rather avoid.