9 Replies Latest reply: Feb 23, 2012 3:05 PM by tom.rybka RSS

Adding an SNMP node with SDK, but SNMP details never populate

qbarry

Hi all,

We're using the SDK and a powershell script to create a SNMP node. When I use SWQL Studio to compare the node added via the script to one added via the admin GUI, the details look pretty much identical, except that the SNMP fields like NodeDescription, SysName, Vendor, SysObjectID and so on, never get populated on the node we add via the script. Here's our code snippit (we're passing in nodename, IPaddress as command line args to the script):

 $newNodeProps = @{
  EntityType="Orion.Nodes";
  IPAddress=$args[1];
  Caption=$args[0];
  DynamicIP=$False;
  EngineID=1;
  Status=1;
  UnManaged=$False;
  Allow64BitCounters=$False;
  ObjectSubType="SNMP";
  SysObjectID="";
  MachineType="";
  VendorIcon="";
  SNMPVersion=2;
  Community="public";
  PollInterval=120;
  StatCollection=10;
  RediscoveryInterval=30;
 }

 $newNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $newNodeProps
 $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

 # Windows/UNIX
 $poller = @{
  PollerType="Poller_HT";
  NetObject="N:"+$nodeProps["NodeID"]
 }
 $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

 

So even when we've added a node via this method and tried to manually issue a "rediscover" in the Node Management context in the GUI, the fields still don't populate (yet it claims the rediscover completes). Am I missing something here? Only thing i can see via SWQL that might be relevant is the "NextRediscovery" field on the script added node is "1/1/0001 12:00" but the same field in the GUI added node is up to date.

 
  • Re: Adding an SNMP node with SDK, but SNMP details never populate
    tdanner

    What version of NPM are you using? Also, you should compare the contents of the Pollers table for a node added through the GUI vs. the API.

    • Re: Adding an SNMP node with SDK, but SNMP details never populate
      qbarry

      Hi Tim - NPM is 10.2.

      Yes, the contents of the pollers table is odd. It looks as if the only poller type that is listed for the script added node is Poller_HT, which is exactly what my script is doing, as per the SDK documentation. For the node added via the GUI, there's different entries:

      N.Details.SNMP.Generic

      N.Uptime.SNMP.Generic

      N.Topology.SNMP.Layer3

       

      These poller types don't appear in the SDK docs - is that a complete list of all the poller types that can be added to a node on page 18? Do I need to add these pollers to my node also?  Would be helpful if there was a complete list of the poller types in the doc, if that's what I'm missing here.

      • Re: Adding an SNMP node with SDK, but SNMP details never populate
        tom.rybka

        Starting Orion Platform 2011.2 shipped with NPM 10.2, the list of poller type has changed to be more concrete (and optimized) as well as using more structured naming convention.

        We are close to release a new version of SDK with the updated list.

        Before that happens, I suggest you to add nodes of your interest via the UI and see what specific pollers have been detected. Since pollers are more specific now, it is not possible to provide a mapping of previous to new pollers.

        • Re: Adding an SNMP node with SDK, but SNMP details never populate
          qbarry

          Aha! The plot thickens. Ok, so any ETA on when the new SDK will be available?

          In the meantime I've examined the pollers that are created when a node is added via the GUI and I've replicated those same pollers for a node added via the SDK. Still doesn't seem to want to populate any of the SNMP data though even after issuing a "rediscover" for the node. Not sure what the issue is now... These are the pollers that get created for a GUI added node it seems:

          N.Details.SNMP.Generic
          N.Uptime.SNMP.Generic
          N.Topology.Snmp.Layer3

          • Re: Adding an SNMP node with SDK, but SNMP details never populate
            trondf

            Was wondering the same thing after nodes added after 10.2 update got messed up, but changing to these pollers fixed mine so far. 

            So the nodes are now OK, however I have an issue with polling interfaces. I'm now adding these pollers as I found these in the database added on nodes created manually.

            I.StatisticsTraffic.SNMP.Universal
            I.Rediscovery.SNMP.IfTablel
            I.StatisticsErrors32.SNMP.IfTable
            I.Status.SNMP.IfTable

            The interface shows up status Unknown and with questionmark. no name and no button for status. The img URL seems to be invalid... (img src = "/NetPerfMon/images/small-")

            I'm adding these properties for interfaces that are added which worked on NPM 10.1:

            props.Add("NodeID", nodeID);
            props.Add("InterfaceName", this.customIfName);
            props.Add("InterfaceIndex", this.IfIndex);
            props.Add("PollInterval", 120);
            props.Add("RediscoveryInterval", 120);
            props.Add("ObjectSubType", "SNMP");
            props.Add("Status", 0);
            props.Add("UnPluggable", true); 

            Could allso mention that some interfaces dont seem to get polled even when added manually from the web interface. But at least the the database is populated with interfacetype, mac address etc. Så this could allso be a NPM issue not just SDK?

            Any suggestions for a workaround would be appreciated =)

            • Re: Adding an SNMP node with SDK, but SNMP details never populate
              tom.rybka

              I am sorry for a delay, anyway we have just made Orion SDK 1.4 available, you can download it here.

              In the Technical Reference document, you can find a complete list of available pollers and their names to put in Orion.Pollers.

              • Re: Adding an SNMP node with SDK, but SNMP details never populate
                mkomeara

                I'm using SDK 1.4 and have the same issue.  I successfully added the node and five node pollers, then added the Custom Properties.  Then I added one interface which shows up in the web interface, but when I query the Pollers table, there aren't any interface pollers listed for that node.

                • Re: Adding an SNMP node with SDK, but SNMP details never populate
                  mkomeara

                  The interface shows up in the Interfaces table.  Here is my Powershell code for adding the interface and pollers;

                  # add interface and pollers for Ethernet0
                  $nodeId = "2395"
                  $newIfaceProps = @{
                  NodeID=$nodeId;
                  InterfaceName="Ethernet0";
                  InterfaceIndex=1;
                  ObjectSubType="SNMP";
                  Status=1;
                  }
                  $newIfaceUri = New-SwisObject $swis –EntityType "Orion.NPM.Interfaces" –Properties $newIfaceProps
                  $ifaceProps = Get-SwisObject $swis -Uri $newIfaceUri
                  # register specific pollers for Ethernet0
                  #
                  # Interface Traffic Statistics
                  $poller = @{
                  PollerType="I.StatisticsTraffic.SNMP.Universal";
                  NetObject="I:"+$ifaceProps["InterfaceID"]
                  }
                  $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                  #
                  # Interface Errors
                  $poller = @{
                  PollerType="I.StatisticsErrors32.SNMP.IfTable";
                  NetObject="I:"+$ifaceProps["InterfaceID"]
                  }
                  $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                  #
                  # Interface Status
                  $poller = @{
                  PollerType="I.Status.SNMP.IfTable";
                  NetObject="I:"+$ifaceProps["InterfaceID"]
                  }
                  $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                  #
                  # Interface Rediscovery
                  $poller = @{
                  PollerType="I.Rediscovery.SNMP.IfTable";
                  NetObject="I:"+$ifaceProps["InterfaceID"]
                  }
                  $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                  #

                   

                  Ideas?  Should I try to add the pollers again?