nProbe icon indicating copy to clipboard operation
nProbe copied to clipboard

BGP Perl module question

Open 51qwerty opened this issue 1 year ago • 5 comments

Question / potential feature request:

I want to add BGP data to the sflow data to improve troubleshooting capabilities. However, when nProbe is running inside a kubernetes infrastructure, if I attempt to run the perl script from inside the container, the container is not able to attach an interface because the IP is from the CNI overlay and is dynamically allocated and is not from the baremetal / host level network. So the perl script configuration doesn't align with the configured IP address.

  • The configured IP can be NATTED on firewalls or other elements to get the BGP session to establish, but becuase the container IP is dynamiclly allocated it throws errors.

The questions I have are: 1.) Are there plans to improve the usability of the bgp perl script such that it can run natively in nProbe inside a container? 2.) Should I just run the perl script outside of the container and feed the data to nProbe similar to how sflow ingresses through the K8s infrastructure to the container? Essentially bypassing the K8s complexity where the perl script is concerned.

For additional context, when I attempt to run the script from inside the nprobe containt, I'm instructing the container to:

  • Install cpan so it can install the needed perl modules
  • Instal Net::BGP perl module with associated dependancies
  • Launch the perl script

K8s commands run at container start: sudo apt update && sudo apt --assume-yes install cpanminus sleep 10 yes | sudo perl -MCPAN -e 'install Net::BGP' /etc/ntopbgp/bgp_probe_client.pl

The last step fails and throws the error: bind() failed at /usr/local/share/perl/5.34.0/Net/BGP/Process.pm line 237. at /etc/ntopbgp/bgp_probe_client.pl line 134.

line 134 = $bgp->event_loop();

from the perl script.

51qwerty avatar Jul 26 '24 17:07 51qwerty