NetXMS Support Forum

English Support => General Support => Topic started by: AleCoelli on April 10, 2022, 10:39:42 PM

Title: Network discovery filter script
Post by: AleCoelli on April 10, 2022, 10:39:42 PM
Hi,
this is my Network Discovery configuration:
(https://i.ibb.co/9ysSC3P/2022-04-10-21-33-06.png) (https://ibb.co/kqQvW6Z)

and this is Filter::NetworkDiscovery scipt:
tracelevel=0;
trace(tracelevel, "======= Filter::NetworkDiscovery ==========");
return false;


Nodes on 192.168.150.0/24 are discovered and added to the right Zone through proxy, the script isn't runned (no log trace) and should filter all (fixed return false).

My server version is 4.0.2227

Do you have any ideas?

thanks
Alessandro
Title: Re: Network discovery filter scipt
Post by: Filipp Sudanov on April 11, 2022, 06:12:58 PM
Hi!

Could it be so that nodes for these IP addresses are already present in the system when discovery happens? If so, the script is not executed, if that address is already added.
Title: Re: Network discovery filter scipt
Post by: AleCoelli on April 11, 2022, 06:21:48 PM
Hi Filipp,
  The nodes are present, I delete them (as you can see in the screenshot) and after some time they appear again, without running the script
(https://i.ibb.co/k4VVKPd/2022-04-11-17-17-41.png) (https://ibb.co/sKppjXB)
Title: Re: Network discovery filter script
Post by: Filipp Sudanov on April 11, 2022, 06:45:55 PM
I'd suggest to turn off the active discovery. Then to check that discovery queue is empty (run "show queues" from Tools->Server console). After that try deleting the nodes again and retry the discovery.
Title: Re: Network discovery filter script
Post by: AleCoelli on April 11, 2022, 07:04:56 PM
Same problem:
- Disabled Network discovery
- show queue as attached (0)
- Enabled Network disconvery
- Queue start to grow
- after some minutes, the nodes appear again
Title: Re: Network discovery filter script
Post by: Filipp Sudanov on April 12, 2022, 07:30:54 PM
This is actually strange. The only possible reason I can think of is if runtime error happens in the script. In this case script is interpreted as if it would return true (this will be reworked in next release). But script run-time error would be visible in the log file. And your script looks to be correct.

I would increase active discovery interval to 3600 - this is to make sure that discovery processes would stop. Then try setting server debug level to 6 (hopefully it's a test environment with not too many nodes - otherwise there will be too many lines in the log). And try to run discovery scan manually - select the range and click scan. The log should have detailed information on how discovery is happening.