| 1 | # bird_exporter |
| 2 | [](https://goreportcard.com/report/github.com/czerwonk/bird_exporter) |
| 3 | |
| 4 | Metric exporter for bird routing daemon to use with Prometheus. |
| 5 | |
| 6 | ## Remarks |
| 7 | Since bird_exporter uses the bird unix sockets, bird has to be installed on the same machine as bird_exporter. Also the user executing bird_exporter must have permission to access the bird socket files. |
| 8 | |
| 9 | ### Bird configuration |
| 10 | To get meaningful uptime information bird has to be configured this way: |
| 11 | ``` |
| 12 | timeformat protocol iso long; |
| 13 | ``` |
| 14 | |
| 15 | ## Important information for users of bird 2.0+ |
| 16 | Version 2.0 of bird routing daemon does support IPv4 and IPv6 in one single daemon now. |
| 17 | For further information see [here](https://gitlab.labs.nic.cz/labs/bird/wikis/transition-notes-to-bird-2). |
| 18 | Since version 1.1 bird_exporter can be used with bird 2.0+ using the `-bird.v2` parameter. |
| 19 | When using this parameter bird_exporter queries the same bird socket for IPv4 and IPv6. |
| 20 | In this mode the IP protocol is determined by the channel information and parameters `-bird.ipv4`, `-bird.ipv6` and `-bird.socket6` are ignored. |
| 21 | |
| 22 | ## Metric formats |
| 23 | In version 1.0 a new metric format was introduced. |
| 24 | To prevent a breaking change the new format is optional and can be enabled by using the ```-format.new``` flag. |
| 25 | The new format handles protocols more generic and allows a better query structure. |
| 26 | Also it adheres more to the metric naming best practices. |
| 27 | In both formats protocol specific metrics are prefixed with the protocol name (e.g. OSPF running metric). |
| 28 | |
| 29 | Since verson 1.3 the new metric format is the default. |
| 30 | |
| 31 | This is a short example of the different formats: |
| 32 | |
| 33 | ### old format |
| 34 | ``` |
| 35 | bgp4_session_prefix_count_import{name="bgp1"} 600000 |
| 36 | bgp6_session_prefix_count_import{name="bgp1"} 50000 |
| 37 | ospfv3_running{name="ospf1"} 1 |
| 38 | ``` |
| 39 | |
| 40 | ### new format |
| 41 | ``` |
| 42 | bird_protocol_prefix_import_count{name="bgp1",proto="BGP",ip_version="4"} 600000 |
| 43 | bird_protocol_prefix_import_count{name="bgp1",proto="BGP",ip_version="6"} 50000 |
| 44 | bird_ospfv3_running{name="ospf1"} 1 |
| 45 | ``` |
| 46 | |
| 47 | ### Default Port |
| 48 | In version 0.7.1 the default port changed to 9324 since port 9200 is the default port of Elasticsearch. The new port is now registered in the default port allocation list (https://github.com/prometheus/prometheus/wiki/Default-port-allocations) |
| 49 | |
| 50 | ### Sockets |
| 51 | In version 0.8 communication to bird changed to sockets. The default socket path is ```/var/run/bird.ctl``` (for bird) and ```/var/run/bird6.ctl``` (for bird6). In case you are using different paths in your installation, the socket path can be specified by usind the ```-bird.socket``` (for bird) and ```-bird.socket6``` (for bird6) flag. |
| 52 | |
| 53 | ## Install |
| 54 | ``` |
| 55 | go get -u github.com/czerwonk/bird_exporter |
| 56 | ``` |
| 57 | |
| 58 | ## Usage |
| 59 | ``` |
| 60 | bird_exporter -format.new=true |
| 61 | ``` |
| 62 | |
| 63 | ## BIRD Grafana Dashboard |
| 64 | |
| 65 | There are three Grafana dashboards available for this exporter. Check the [grafana](https://github.com/czerwonk/bird_exporter/tree/main/grafana) for more. |
| 66 | |
| 67 | ## Features |
| 68 | * BGP session state |
| 69 | * OSPF neighbor/interface count |
| 70 | * imported / exported / filtered prefix counts / route state changes (BGP, OSPF, Kernel, Static, Device, Direct, Babel) |
| 71 | * protocol uptimes (BGP, OSPF, BFD) |
| 72 | * BFD session status |
| 73 | |
| 74 | ## Third Party Components |
| 75 | This software uses components of the following projects |
| 76 | * Prometheus Go client library (https://github.com/prometheus/client_golang) |
| 77 | |
| 78 | ## License |
| 79 | (c) Daniel Czerwonk, 2016. Licensed under [MIT](LICENSE) license. |
| 80 | |
| 81 | ## Prometheus |
| 82 | see https://prometheus.io/ |
| 83 | |
| 84 | ## Bird routing daemon |
| 85 | see http://bird.network.cz/ |