2 Replies Latest reply on Jan 10, 2017 8:07 PM by Mike Lomax

    "Object reference not set to an instance of an object." when adding new Node with SNMPv3

    Mike Lomax

      I am trying to add a NPM node with SDK through PowerShell using SNMPv3 as the Polling Method.

       

      I CAN add the node using ICMP, WMI or SNMPv2 as below:

       

      $NewNodeProps = @{

      IPAddress = $IpAddress;

      Caption = $NodNam;

      EngineID = 1;

      ObjectSubType = "ICMP";   

      }

      $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

       

       

      $NewNodeProps = @{

      IPAddress = $IpAddress;

      Caption = $NodNam;

      EngineID = 1;

      ObjectSubType = "WMI";   

      }

      $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

       

       

      $NewNodeProps = @{

      IPAddress = $IpAddress;

      Caption = $NodNam;

      EngineID = 1;

      ObjectSubType = "SNMP";

      SNMPVersion = 2;

      Community = "public";   

      }

      $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

       

      All above result in the node created with the proper Polling Method.

       

      However when I try to create using Polling Method of SNMPv3, as in the following:

       

      $NewNodeProps = @{

      IPAddress = $IpAddress;

      Caption = $NodNam;

      EngineID = 1;

      ObjectSubType = "SNMP";

      SNMPVersion = 3;

      SNMPV3Username = "someone";

      SNMPV3PrivMethod = "None";

      SNMPV3AuthMethod = "MD5";

      SNMPV3AuthKey = "somepassword";

      }

      $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

       

      The response is:

       

      New-SwisObject : Object reference not set to an instance of an object.

      At line:69 char:19

      +     $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $Ne ...

      +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          + CategoryInfo          : InvalidOperation: (:) [New-SwisObject], FaultException`1

          + FullyQualifiedErrorId : SwisError,SwisPowerShell.NewSwisObject

       

      Been researching for several hours now and cannot find the answer.

       

      What am I missing?

       

       

      Thanks in advance...

       

      Mike