...when I'm relitively certain that the NodeIDs WILL conflict / possibly be duplicated ?
Any thoughts / help on this appreciated!
The node has to exist in the nodes table (Orion.Nodes) on the NCM server before you can use AddNodeToNCM to enable NCM management of that node. The script Diner referred to above (CopyNodes.ps1) can be used to copy the node from the NPM server where it is configured now to the NCM server.
You can't specify the NodeID when adding a node, so there is no danger of conflict/duplication of NodeID values.
What versions are you moving from/to?
Hello, for this purpose there exists sample script, which is bundled with your SDK installation. It's by default located in c:\Program Files (x86)\SolarWinds\Orion SDK\Samples\PowerShell\CopyNodes.ps1 . This will copy the nodes from one orion to another. Copies Nodes, Volumes(when enabled in script), Intefaces(when enabled in script) aand the pollers. There's one limitation, that it can't copy WMI nodes. Please go through the script. I believe this can possibly suit your needs
Our current NPM version is apparently 11.0.1, and NCM 7.3.2 is running on those NPM servers (because some version of it has to from what I'm told).
However, we're testing NPM 11.5, so I guess it would be NPM 11.5 (or 11.0.1) to NCM server 7.3.2. Our production servers are running 11.0.1, and as I said above, we're testing NPM 11.5 on a 'nonprod' server.
Your statement confuses me though. Looking at my AddNodeToNCM() method, (which of course calls the */Solarwinds/InformationService/v3/json/Invoke/Cirrus.Nodes/AddNodeToNCM verb) it appears that the payload / body data is simply "[<NodeID>]" (a json array containing the integer node id).
This runs as part of a console app I've written to programmatically add Node(s)/Interface(s) to the appropriate NPM server, then to 'let the NCM server know about it' so to speak. As far as I know, it's been working fine in tests, thus my confusion over your statement that I don't/can't add NodeIDs to NCM.
In fact, here's a snippet from my debug log:18-Mar-2015 22:03:22.9480 DEBUG AddNodeToNCM(): Calling18-Mar-2015 22:03:22.9520 DEBUG AddNodeToNCM(): Uri: |https://lsdorionnonprod:17778/Solarwinds/InformationService/v3/json/Invoke/Cirrus.Nodes/AddNodeToNCM|18-Mar-2015 22:03:22.9550 DEBUG AddNodeToNCM(): Payload: /[471]/18-Mar-2015 22:03:23.6429 DEBUG AddNodeToNCM(): response: 0fe0012a-e831-49e8-a20f-e240fddcd8b518-Mar-2015 22:03:23.6449 DEBUG AddNodeToNCM(): Done
In case that has any bearing on the facts (/what you're trying to tell me.)
I don't think this is what I'm looking for as I'm just trying to 'let NCM know, so that it can track/handle/deal with the specified Node' that's been added to either of our two NPM servers.
(Perhaps 'Add Nodes' was a bad way to put it.)
Thanks,
Scott
The function of "AddNodeToNCM" is to take a node that is already in Orion (in the Nodes table) and enable it for config/NCM monitoring. From the way you describe your setup, it sounds like you have three Orion databases - two with just NPM and one with just NCM. Is that accurate?
Essentially, yes. As I mentioned, I've heard that there are 'mini-versions' (or whatever the official term is) of NCM running on both of the NPM servers because it has to, but our "main" NCM server is now one, rather than two, which they did for several reasons. I can get you those reasons later today if need be, although I'm pretty sure the main reason was so that they could do configuration tasks against BOTH of the NPM servers (or the Nodes being tracked by same) in one place.
Okay, I checked our NCM database and it's got plenty of nodes in its dbo.Nodes table, but what we are missing are the custom properties that we have set up on our two NPM servers.
Is there a simple way to 'export' the Custom Properties .. data/tables/whatever we need from one of our NPM servers and then 'import' them into the db on the single NCM server?
Yes. There are two steps: copying the custom property definitions and copying the data.
Copying the definitions: if you have a relatively small number of custom properties, you can just manually create properties on the target system to match the properties on the source system. If the number of properties is large enough to make this a burden, we can look at scripting it.
Copying the data: the Manage Custom Properties page (/Orion/Admin/CPE/Default.aspx) has toolbar buttons for exporting custom property data to a .CSV file. On the source system, use this to export the data for the properties you want to transfer. Include the IP_Address column - you'll need that during the import step. On the target system, use the Import Values button to import the CSV file.
Excellent!
Well, we have probably 15-20, so scripting it would be great. I had been thinking about creating SQL Server 'Script As/To' script(s) for the tables, but I realized that while I think I've figured out which tables contain this data, I'm not 100% sure, thus checking with you.
Not sure if I should ask this separately, but here goes. Given what you've said, it sounds like if we want to have a two(+) NPM with one single NCM server setup, we'll need to keep the NCM server's Nodes table records synchronized with the NPM servers tables (Nodes, Interfaces) data, correct? And if so, is there a relatively simple way to do that?
Thanks again!
SWQL query to find the current node custom properties (run this on the source system):
SELECT Field, DataType, MaxLength, DescriptionFROM Orion.CustomPropertyWHERE TargetEntity='Orion.NodesCustomProperties'
To create a custom property on the target system (in PowerShell), do this:
Invoke-SwisVerb -Swis $target Orion.NodesCustomProperties CreateCustomProperty @($field, $description, $dataType, $maxLength, "", "", "", "", "", "")
As for syncing nodes between systems, personally I would rather not. I would try to find a way to combine into a single system with however many polling engines it takes. But if you do want to sync nodes between separate systems, I would start with the CopyNodes.ps1 script and edit from there.
Tdanner,
Regarding your custom properties proposed solution. I am getting the following error when attempting to run the CODE LISTED BELOW:
Invoke-SwisVerb : An error occurred when verifying security for the message.
At line:1 char:1
+ Invoke-SwisVerb -Swis $swis Orion.NodesCustomProperties CreateCustomProperty @($ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], MessageSecurityException
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
==============================================================================================================================
Here is the code:
$CustomeProperties=Import-Csv ".\CustomPros.csv"For($i=0;$i -le $CustomeProperties.Length - 1;$i++){ $Table+=@($CustomeProperties[$i].Table) $Field+=@($CustomeProperties[$i].Field) $DataType+=@($CustomeProperties[$i].DataType) $MaxLength+=@($CustomeProperties[$i].MaxLength) $StorageMethod+=@($CustomeProperties[$i].StorageMethod) $Description+=@($CustomeProperties[$i].Description) $TargetEntity+=@($CustomeProperties[$i].TargetEntity) }
Add-PSSnapin SwisSnapin -ErrorAction SilentlyContinue$creds=Get-Credential$swis = Connect-Swis –Credential $creds Invoke-SwisVerb -Swis $swis Orion.NodesCustomProperties CreateCustomProperty @($Table, $Field, $DataType, $MaxLength, $StorageMethod,$Description, $TargetEntity)
******************** TIME ON THIS SYSTEM IS SYNC'ED ACCURATELY WITH DC ***************************************
This script was ran on a server which has NPM 11.0 and SDK 1.10 (SWQL) Installed.
Please advise.
Andrew
If you are running it on the NPM server, you can just use the -Certificate parameter to Connect-Swis instead of prompting for credentials.