NetXMS Support Forum

English Support => Feature Requests => Topic started by: StanHubble on June 26, 2018, 11:09:48 PM

Title: node discovery poll
Post by: StanHubble on June 26, 2018, 11:09:48 PM
would it be possible to add a manual discovery poll on a subnet? similar to a manual node poll?
i.e. (EntireNetwork->(zoneUIN)->subnet/mask) rightclick -> poll -> discovery

Along with a Hook::DiscoveryPoll script that could be called even if no new nodes are added.  This way a subnet-customattribute could be updated with a last run date/time similar to Alex's configuration poll example.

Thx.
Title: Re: node discovery poll
Post by: Victor Kirhenshtein on June 28, 2018, 10:24:50 AM
All polls run on a node level. It is possible to add discovery poll menu on subnet object, but all it can do is to start discovery polls on each node within subnet.
When exactly you want discovery poll hook to be called?

Best regards,
Victor
Title: Re: node discovery poll
Post by: StanHubble on June 29, 2018, 06:31:24 PM
Since the subnet doesn't show up unless there is a node in it, that means there is a node to do the discovery on.  I assume it then looks at the arp table , fdb, cdp, or lldp,  of the existing nodes for new nodes. 

As to when to do the hook, either at the beginning of the process or the end, i guess it doesn't matter.  what i would be looking to do is set a custom attribute with a last run date/time, whether or not it found anything new.
Title: Re: node discovery poll
Post by: Victor Kirhenshtein on July 18, 2018, 03:19:56 PM
I'm a bit lost - are we talking about hook script or about manually starting discovery poll? Hook script already exist - you can use it to update attributes on all subnets where current node belongs.

Best regards,
Victor
Title: Re: node discovery poll
Post by: StanHubble on July 18, 2018, 06:29:09 PM
Manually Starting a Discovery Poll on a subnet. 

As far as existing hook scripts ...I don't see one that would have access to the subnet object (at least not in the comments).

Title: Re: node discovery poll
Post by: Victor Kirhenshtein on July 18, 2018, 07:09:04 PM
This is simple hook script that sets attribute "lastDiscoveryPoll" to current time for all node's subnets:


for(o : GetObjectParents($node))
{
   if (o->type == 1)
   {
      SetCustomAttribute(o, "lastDiscoveryPoll", time());
   }
}


Best regards,
Victor
Title: Re: node discovery poll
Post by: StanHubble on July 18, 2018, 08:31:55 PM
Thx.

I maybe a little thick......would i create a new script called Hook::DiscoveryPoll or add that into one of the existing Hook:: scripts?

I currently have:
11 - Hook::StatusPoil
12 - Hook::ConfigurationPoll
13 - Hook::InstancePoll
15 - Hook::CreateInterface
16 - Hook::AcceptNewNode
Title: Re: node discovery poll
Post by: Victor Kirhenshtein on July 18, 2018, 09:18:56 PM
Actually, I made a mistake here. There are hook for topology poll (it's not created by default for some reason, should be called Hook::TopologyPoll), but not for discovery poll. I'll add discovery poll hook in next release.

Best regards,
Victor

Title: Re: node discovery poll
Post by: Victor Kirhenshtein on July 19, 2018, 10:45:38 AM
Just added new hook "DiscoveryPoll" - it will be available in 2.2.8.

Best regards,
Victor