Exa-Networks / exabgp

The BGP swiss army knife of networking
Other
2.09k stars 447 forks source link

How to pass argument to api call in exabgp #869

Closed rewajkale closed 5 years ago

rewajkale commented 5 years ago
Summary
OS
Centos 7 and Python 2.7.5
[root@~]# uname -a
Linux nfvis 3.10.0-862.11.6.el7.1.x86_64 #1 SMP Fri Dec 14 23:08:18 IST 2018 x86_64 x86_64 x86_64 GNU/Linux
Version
[root@~]# exabgp --version
ExaBGP : 4.0.10-a8462350
Python : 2.7.5 (default, Dec 12 2017, 07:08:55)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Uname  : Linux nfvis 3.10.0-862.11.6.el7.1.x86_64 #1 SMP Fri Dec 14 23:08:18 IST 2018 x86_64
Root   : /usr
Installation
Installed it using the rpm built out of tar.gz of this git repo
Environment
Output is empty
Configuration
process healthcheck {
    run /usr/bin/python2 /opt/nfvos-confd/route_distribution_healthcheck.py 172.25.221.106;
    encoder json;
}

neighbor 172.24.56.78 {
    router-id 172.26.78.98;
    local-address 172.26.78.98;
    local-as 65000;
    peer-as 65000;

    api {
        processes [healthcheck];
    }
}
neighbor 172.24.56.43 {
    router-id 172.26.78.98.;
    local-address 172.26.78.98;
    local-as 65000;
    peer-as 65000;

    api {
        processes [healthcheck];
    }
}
Program output
Dec 20 19:33:31 nfvis exabgp[15705]: 19:33:31 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:33:45 nfvis exabgp[15705]: 19:33:45 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:33:59 nfvis exabgp[15705]: 19:33:59 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:34:13 nfvis exabgp[15705]: 19:34:13 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:34:27 nfvis exabgp[15705]: 19:34:27 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:34:41 nfvis exabgp[15705]: 19:34:41 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:34:55 nfvis exabgp[15705]: 19:34:55 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:35:09 nfvis exabgp[15705]: 19:35:09 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:35:23 nfvis exabgp[15705]: 19:35:23 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Dec 20 19:35:37 nfvis exabgp[15705]: 19:35:37 | 15705  | api             | route added to neighbor 172.25.221.106 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open, neighbor 172.25.221.17 local-ip 172.25.221.108 local-as 65000 peer-as 65000 router-id 172.25.221.108 family-allowed in-open : 10.20.0.0/24 next-hop self
Steps to reproduce
Add more than one neighbor address in the conf file and the second neighbor will not get the routes announced
Importance
Yes, it is affected my production environment, we would like to support multiple neighbor addresses
rewajkale commented 5 years ago

I am unable to pass argument to api call like: process healthcheck { run /usr/bin/python2 /healthcheck.py %neighbor_address%; encoder json; }

Like I would like to pass neighbor address as an argument to api call

Is there any way I can access the neighbor address which is performing api call inside that healthcheck.py file?