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.

Adding pollers isn't adding all pollers correctly.

Hello all,

I've been messing around with the SDK and I've hit an odd road block.

I can add the node just fine and it'll even check the status for me. It's the other pollers I'm adding that don't seem to be enabling correctly or something. After adding my pollers to a target node I check the DB for those pollers. I not only see that it has all my pollers listed under the pollers table but it also has other pollers I've not assigned to it. These are for interfaces and volumes. I'm surprised these get added and I'm actually liking that they are getting added but the only things I can tell are polling correctly are status and response time.

I'll stick to the first thing at hand, which is why all the pollers I've added are showing up but not polling anything aside from the aforementioned. Why would this be?

Below is part of a very large script I'm developing for adding nodes automatically after a discovery has been run.

And yes the format of the code is terrible. I've been told this from many an accomplished programmer...

#function to add nodes to Orion

##############################################################

function AddNode ($IPAddress, $IPAddressGUID, $Caption, $EngineID, $Community, $Pollers)

{

    Write-Host "Entering AddNode Function"

$AllNodePollers = Get-SwisData $swis "Select Distinct PollerType from Orion.Pollers Where NetObjectType = 'N'"

   

    # add a node

    $newNodeProps = @{

        EntityType="Orion.Nodes";

        IPAddress=$IPAddress;

        IPAddressGUID = $IPAddressGUID

        Caption=$Caption;

        DynamicIP=$False;

        EngineID=$EngineID;

        Status=1;

        UnManaged=$False;

        Allow64BitCounters=$False;

        ObjectSubType="SNMP";

        SysObjectID="";

        MachineType="";

        VendorIcon="";

        SNMPVersion="2";

        Community=$Community;

        RediscoveryInterval=5;

        PollInterval=120;

        StatCollection=10;

    }

           

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

    $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

    $newNodeUri

Write-Host "Entering Node Pollers section"

    ForEach ($PollerAdd in $Pollers)

    {

   

        If($AllNodePollers -contains $PollerAdd -and ($PollerAdd -ne "N.ResponseTime.SNMP.Native" -or $PollerAdd -ne "N.Status.SNMP.Native"))

        {

             Write-Host "Found Poller $PollerAdd"

       

                $poller = @{

                PollerType="$PollerAdd";

                NetObject="N:"+$nodeProps["NodeID"];

                NetObjectType="N";

                NetObjectID=$nodeProps["NodeID"];

               

                }

        $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

           

         }

        }

Invoke-SwisVerb $swis Orion.Nodes PollNow @("N:" + $NodeID)

    Write-Host "Exiting AddNode Function"

}

  • Hah! it turns out my lab is just a bit slow and it has a SWIS service error that's keeping a few of the resources from rendering. Though there is a new issue along the same line of this original problem.

    I've put in my code to skip the snmp status and response time pollers as I don't want SNMP selected in the list resources for these pollers.

    Also I've added the asset inventory poller but I'm not seeing the tab in my node details page.

    Also getting a Cisco resource unable to render. This is a windows node and that poller is not added...

  • I am being slow this Friday. Looks like I was pulling other nodes interfaces and volumes when I was verifying the code. Also found out that I'm passing the discovery nodeID and not the newly generated nodeID. Now that that's taken care of I'm getting an XML generation error.

    My node is still defaulting to snmp polling for status and response time and I'd like to make that not happen as well. I've stopped the addition of volumes until I figure out why interfaces is bombing now.

    Any insight on this would be much appreciated!

  • Hi dkeyser,

    If you have trouble about seeing node details, you must add "N.Details.SNMP.Generic" pollers. You can take a look to that thread.

    NCM Node Details (Re: NCM Node Details)

  • Hello juniordev!

    I finally fixed this issue in my script with the hover over. The only thing I'm not getting to work right is the status check selection upon node addition. It's still defaulting to SNMP for status and response time checks. I'd like ICMP as it's faster.

  • Hi,

    Try adding 'N.StatusAndResponseTime.ICMP.SendEcho' poller.

    This poller gets node response time and status. It utilizes ICMP query to find out if node is responding.