How is the CustomPollerAssignmentID generated?
~Ed
A new GUID (essentially a big random number) is generated at the time you assign a universal device poller.
So, if I generate a record and add it to the dbo.CustomPollerAssignment tale, the CustomPollerAssignmentID field is automatically generated by Orion and added to he field?
At this time there is no supported way to programmatically assign a custom poller.
OK, but how is the CustomPollerAssignmentID determined? I can create the code but I don't know what method is used to determine it.
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
I can't make any promises in that area. Let me see if the product manager would like to comment.
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"); }}
Thanks very much for sharing this.
An option if the ability to do so in the API isnt available in time. If a customer is in a position to need to automate the creation of nodes within Orion, it is highly likely that they will have custom pollers that would need assigning at the time of node creation.
Thanks again
No problem.
Martin
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.
I have no progress to report on this front. I'll ping the product manager again.
Hi Dobbs,
I can confirm there is currently no change in API/SDK for custom pollers. We currently plan to re-work the UI and custom pollers functionality so they will be easier to use & set-up. The API/SDK update may be part of it but UI is a high priority for our users right now. anyway, I'll keep it on my list and I'll work on that with engineering and architects if we can get API support there and what's the cost.
thanks,
Michal
Just to add my backing I hope this makes the cut it would be nice to see the api moving along at the same pace as the UI
JonnyG
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.
No progress yet, but I'll add your name to the list requesting this.
Are there any updates on this request?
Yes, this was added several versions ago. Docs here: NPM Universal Device Pollers · solarwinds/OrionSDK Wiki · GitHub