10 Replies Latest reply on Oct 23, 2013 4:19 AM by juniordev

    NCM Node Details

    juniordev

      Hi folks,

      I have a question. I created a node for NCM via SWIS and C# code but any information doesn't shown on Node Details section. Is there any requirement fields/properties to fill (like Caption, Location etc..) when creating a node via SWIS?

       

      My code block is below:

       

                      Dictionary<string, string> _dic = new Dictionary<string, string>();

                      _dic.Add("ObjectSubType", "SNMP");

                      _dic.Add("SNMPVersion", "2");

                      _dic.Add("IPAddress", "192.168.1.254");

                      _dic.Add("Caption", "");

                      _dic.Add("SysName", "");

                      _dic.Add("Contact", "");

                      _dic.Add("Location", "");

                      _dic.Add("PercentMemoryUsed", "-2");

                      _dic.Add("MemoryUsed", "-2");

                      _dic.Add("CPULoad", "-2");

                      _dic.Add("Community", "<community>");

                      _dic.Add("EngineID", "2");

                      _dic.Add("DynamicIP", "false");

                      _dic.Add("MachineType", "");

                      _dic.Add("Allow64BitCounters", "true");

       

                string uri = npc.AddNode(pbn);    

        • Re: NCM Node Details
          juniordev

          Is there anyone to help me?

            • Re: NCM Node Details
              tdanner

              There are some other properties you need to include for this to work properly. Please see the "Adding a node for monitoring" section in the Technical Reference (Orion SDK.pdf) document. Please also see the Samples\PowerShell\CRUD.AddNode.ps1 script under the SDK installation directory for sample code that does this.

                • Re: NCM Node Details
                  RichardLetts

                  The example (and SDK documentation on adding a node) is incomplete

                   

                  There are additional properties that need to be set above what are shown in the SDK documentation to properly add a node or you get display errors in the webUI (for hover text on nodes)

                   

                  Despite that I'm still getting the following error thrown in the syslog service:

                   

                  2013-07-24 05:52:46,421 [23] ERROR SolarWinds.Orion.Common.ManagedNodeState - Error occurred during the getting node with IP [172.x.y.z] from Nodes table!

                  System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

                     at System.Data.SqlClient.SqlBuffer.get_String()

                     at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)

                     at SolarWinds.Orion.Common.ManagedNodeState.AddNewNode(String ip, Boolean getSnmpCred)

                   

                  Below is the complete set of (non-custom) properties one needs to set when creating a node to avoid getting errrors from random pieces of the Solarwinds Orion suite on Nodes.

                  This includes the Hover text for nodes, syslog and trap receiver, and other random pieces of the infrastructure. Much of this would be simplified if SW put default values on the tables.

                  this is the perl data structure.

                   

                                  'Caption'=>$ip,

                                  'IPAddress'=>$ip,

                                  'IPAddressguid' => ip2guid($ip),

                                  'DynamicIP'=>0,

                                  'UnManaged'=>0,

                                  'EngineID'=>1,

                                  'Status'=>1,

                                  'Allow64BitCounters'=>1,

                                  'ObjectSubType'=>'SNMP',

                                  'SNMPVersion'=>2,

                                  'Community'=>$rocid,

                                  'Comments'=>'Added by noc',

                                  'SysObjectID'=>$oid,

                                  'MachineType'=>$MachineType,

                                  'Vendor'=>$Vendor,

                                  'VendorIcon'=>$VendorIcon,

                                  'BufferNoMemThisHour'=>-2,

                                  'BufferNoMemToday'=>-2,

                                  'BufferSmMissThisHour'=>-2,

                                  'BufferSmMissToday'=>-2,

                                  'BufferMdMissThisHour'=>-2,

                                  'BufferMdMissToday'=>-2,

                                  'BufferBgMissThisHour'=>-2,

                                  'BufferBgMissToday'=>-2,

                                  'BufferLgMissThisHour'=>-2,

                                  'BufferLgMissToday'=>-2,

                                  'BufferHgMissThisHour'=>-2,

                                  'BufferHgMissToday'=>-2,

                                  'PercentMemoryUsed'=>-2,

                                  'TotalMemory'=>-2,

                                  'SNMPV2Only'=>0,

                                  'External'=>0,

                                  'DNS'=>'',

                                  'IOSImage'=>'',

                                  'IOSVersion'=>'',

                                  'RWSNMPv3AuthKeyIsPwd'=>1,

                                  'RWSNMPV3AuthKey' => 'None',

                                  'RWSNMPV3AuthMethod'=> 'None',

                                  'RWSNMPV3Context' => 'None',

                                  'RWSNMPv3PrivKeyIsPwd'=>1,

                                  'RWSNMPV3PrivKey' => 'None',

                                  'RWSNMPv3PrivMethod'=> 'None',

                                  'RWSNMPV3Username' => 'None',

                                  'SNMPv3AuthKeyIsPwd' => 1,

                                  'SNMPV3AuthKey' => 'None',

                                  'SNMPv3AuthMethod' => 'None',

                                  'SNMPV3Context' => 'None',

                                  'SNMPv3PrivKeyIsPwd' => 1,

                                  'SNMPv3PrivKey' => 'None',

                                  'SNMPv3PrivMethod'=> 'None',

                                  'SNMPV3Username' => 'None'

                   

                  /RjL

                   

                  updated to have complete list of properties. Message was edited by: Richard Letts

              • Re: NCM Node Details
                juniordev

                I tried all methods you told but nothing has changed. When I look node's detail page, the Node Detail section doesn't show any information about node. I click Edit Properties button, then click save button -no change for any information-, node's detail page is starting node's information. It's just weird.

                  • Re: NCM Node Details
                    tdanner

                    If Richard's list of properties (earlier in this thread) does not fix it, here's what I would do:

                     

                    1. Add a node using your script. At this point (per your description) there will problems with this node in the web.

                    2. Call Read on the resulting uri to get a dump of the properties as the currently are.

                    3. In the web, click Edit Properties, then Save. At this point (again, per your description), the problems with this node in the web will go away.

                    4. Call Read on the node's uri again to get a new dump of the properties.

                    5. Diff the dumps from step #2 and step #4 to see what got changed by the Edit/Save dance.

                    6. Update your script to reflect knowledge gained in step #5.

                    7. Post on thwack to share what you leaned.

                  • Re: NCM Node Details
                    juniordev

                    I tried the all things but nothing changed. The differences are probably null or "" string. I don't know how to set IPAddressGUID and SysObjectID (it can change by vendor. how i decide what it is?) field. When I apply the "" string to my script, no change. Additionally, when I added node manually (via Orion web interface), I am able to get machine type, vendor etc information but added node via SWIS script, there is no information about that fields. Can you give any suggestions?

                      • Re: NCM Node Details
                        tdanner

                        Orion should fill in the SysObjectID from SNMP data once it runs rediscovery on the new node. To fill in IPAddressGUID, you can use this PowerShell function:

                         

                        function ip2guid($ipString) {

                          $ip = [System.Net.IPAddress]::Parse($ipString)

                          $src = $ip.GetAddressBytes();

                          $data = new-object byte[] 16

                          $src.CopyTo($data, $data.Length - $src.Length)

                         

                          $dest = new-object byte[] 16

                          [Array]::Copy($data, 12, $dest, 0, 4)

                          [Array]::Copy($data, 10, $dest, 4, 2)

                          [Array]::Copy($data, 8, $dest, 6, 2)

                          [Array]::Copy($data, 6, $dest, 8, 2)

                          [Array]::Copy($data, 0, $dest, 10, 6)

                         

                          return (New-Object Guid (,$dest)).ToString()

                        }

                        1 of 1 people found this helpful
                          • Re: NCM Node Details
                            juniordev

                            Hi again,

                            I didn't try to fill IPAddressGUID but adding the pollers for the node, "N.Details.SNMP.Generic" and "N.Uptime.SNMP.Generic" is the solution for me. I don't know to necessary adding IPAddressGUID but there is no problem now.

                            Thanks for your help, tdanner.