16 Replies Latest reply on Aug 5, 2013 3:17 PM by tdanner

    Custom Poller Assignment

    emarkiewicz

      How is the CustomPollerAssignmentID generated?

      ~Ed

        • Re: Custom Poller Assignment
          tdanner

          A new GUID (essentially a big random number) is generated at the time you assign a universal device poller.

          • Re: Custom Poller Assignment
            Mark Roberts

            Hi Tim,

             

            Is the ability to assign custom pollers to Nodes via the SDK coming along any time soon, can you share?

             

            I have a need to use the API to add a new node to Orion and assign up to 20 custom pollers to the device. Not having the ability to automate the assignment of custom pollers means that the benefit of automating the addition of a new node is lost.

             

            thanks

             

            Mark

              • Re: Custom Poller Assignment
                tdanner

                I can't make any promises in that area. Let me see if the product manager would like to comment.

                • Re: Custom Poller Assignment
                  WildBuzz

                  Here is what I was doing in Perl :

                  sub AddCustomPollers
                  {
                    my $nodeIP   = shift;
                    my $nodeID   = shift;
                    my $name     = shift;
                    my $store    = shift;
                    my $nodeType = shift;
                    my $swis     = shift;
                    
                    my $sth;
                    my $pollerID;
                    
                    my $pollers  = {'Router'=>['ciscoEnvMonTemperatureState',
                                               'ciscoEnvMonFanStateTable'
                                              ],
                                   'Switch'=>['ciscoEnvMonSupplyStateTable',
                                              'ciscoEnvMonFanStateTable'
                                             ],
                                   'Controler'=>[
                                                ],
                                   'SpareRouter'=>['ciscoEnvMonTemperatureStatusValue',
                                                   'ciscoEnvMonFanStateTable'
                                                  ],
                                   'SpareSwitch'=>['ciscoEnvMonSupplyStateTable',
                                                   'ciscoEnvMonFanStateTable'
                                                  ]
                                  };
                    if ( $nodeType !~ /Unknown/ ) {
                      $log->msg(1,"AddCustomPollers: About to add custom pollers - Store $store ($nodeIP)\n");
                      foreach my $poller ( @{$pollers->{$nodeType}} ) {
                        $log->msg(1,"AddCustomPollers: installing $poller poller - Store $store ($nodeIP)\n");
                        $sth = $dbh_orion->prepare("SELECT CustomPollerID FROM CustomPollers WHERE UniqueName = '".$poller."'");
                        if (! defined ($sth->err()) ) {
                          my $rv = $sth->execute();
                          if ( $rv != 0 ) {
                            $pollerID = $sth->fetchrow();
                            $log->msg(1,"AddCustomPollers: found id $pollerID for $poller poller - Store $store ($nodeIP)\n");
                            $sth->finish();
                            my $ith = $dbh_orion->prepare("SELECT CustomPollerID FROM CustomPollerAssignment WHERE CustomPollerID='".$pollerID."' AND NodeID = ".$nodeID.";");
                            if ( ! defined ($ith->err()) )
                            {
                              my $rvi = $ith->execute();
                              if ( $rvi != 0 )
                              {
                                $log->msg(1,"AddPollers: poller $poller already exists for $nodeIP\n");
                                $ith->finish();
                              }
                              else {  
                                $ith->finish();
                                $ith = $dbh_orion->prepare("INSERT INTO CustomPollerAssignment (AssignmentName, CustomPollerID, NodeID, InterfaceID) VALUES ('".$poller." on ".$name."', '".$pollerID."', ".$nodeID.", 0)");
                                if ( ! defined ($ith->err()) )
                                {
                                  my $rvi = $ith->execute();
                                  if ( $rvi < 1 )
                                  {
                                    $log->msg(1,"AddCustomPollers: ERROR - SQL Insert - ".$ith->errstr()." - for ".$poller." on ".$name."\n");
                                  }
                                  $ith->finish();
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    else {
                      $log->msg(1,"AddCustomPollers: ERROR - Node type unknown - Store $store ($nodeIP)\n");
                    }
                  }
                  
                  
                • Re: Custom Poller Assignment
                  Mark Roberts

                  Hi Tim,

                   

                  Could you please provide an update on the ability to programatically assign Custom UnDP Pollers to nodes. We are now creating a dev test to add a node to Orion and as part of this script assign UnDP's, which will be based on the Perl script process supplied by Martin above.

                   

                  thanks

                   

                  Mark

                  • Re: Custom Poller Assignment
                    RichardLetts

                    Is there any progress on this -- it is getting to the point where I cannot use the UnDP to add custom pollers to nodes -- with several thousand nodes of any particular type modifying a UnDP times out.