Filter based on condition or watchdog

Jan Matejka jan.matejka at nic.cz
Fri Jun 2 14:38:34 CEST 2017


On 06/02/2017 12:59 PM, Войнович Андрей Александрович wrote:
> Hi all!
> 
>  
> 
> Does BIRD allow to write a filter, where I can define a condition when it should import/export some route(s) and when it should not? To clarify my question, example: I want to check whether some process (lets say apache) is running and the server is listening TCP port 80, so if these conditions are true, BIRD should export some route to OSPF, if false – should not.
> 

No, this is not possible in a simple way.

Anyway, you may use a set of config files like this:

bird.conf:
...
include "apache-check.conf";
...

apache-check-yes.conf:
static apachecheck { route XYZ };

apache-check-no.conf: empty

apache-check.conf: symlink to apache-check-no.conf

write a script like this:

* if the condition is true: ln -sf apache-check-yes.conf apache-check.conf
* else: ln -sf apache-check-no.conf apache-check.conf
* if the script changed the symlink, reload bird config

and run the script by cron every other while.

Hope this is clear enough to help you.
MQ


More information about the Bird-users mailing list