Configuration
Here you would find a long description, maybe the description in example file are enough for you.
The config file for Yanic written in "Tom's Obvious, Minimal Language." syntax. (if you need somethink multiple times, checkout out the [[array of table]] section)
[respondd]
Group for configuration of respondd request.
[respondd]
enable = true
# synchronize = "1m"
collect_interval = "1m"
#[respondd.sites.example]
#domains = ["city"]
#[[respondd.custom_field]]
#name = zip
# You can use arbitrary GJSON expressions here, see https://github.com/tidwall/gjson
# We expect this expression to return a string.
#path = nodeinfo.location.zip
[[respondd.interfaces]]
ifname = "br-ffhb"
#ip_address = "fe80::..."
#send_no_request = false
#multicast_address = "ff02::2:1001"
#port = 10001
enable
Enable request and collection of data per respondd requests
enable = true
synchronize
Delay startup until a multiple of the period since zero time
synchronize = "1m"
collect_interval
How often send request per respondd.
It will send UDP packets with multicast address ff05::2:1001
and port 1001
.
If a node does not answer after the half time, it will request with the last know address under the port 1001
.
collect_interval = "1m"
[respondd.sites.example]
Tables of sites to save stats for (not exists for global only). Here is the site ffhb.
[respondd.sites.ffhb]
domains = ["city"]
domains
list of domains on this site to save stats for (empty for global only)
domains = ["city"]
[[respondd.interfaces]]
Interface that has an ip address in your mesh network. It is possible to have multiple interfaces, just add this group again with new parameters (see toml [[array of table]]).
[[respondd.interfaces]]
ifname = "br-ffhb"
#ip_address = "fe80::..."
#send_no_request = false
#multicast_address = "ff02::2:1001"
#port = 10001
ifname
name of interface on which this collector is running.
ifname = "br-ffhb"
ip_address
ip address is the own address which is used for sending. If not set or set with empty string it will take an address of ifname. (It prefers the link local address, so at babel mesh-network it should be configurated)
ip_address = "fe80::..."
send_no_request
Disable sending multicast respondd request. For receiving only respondd packages e.g. database respondd.
send_no_request = true
multicast_address
Multicast address to destination of respondd.
If not set or set with empty string it will take the batman default multicast address ff05::2:1001
(Needed to set for legacy ff02::2:1001
)
multicast_address = "ff02::2:1001"
port
Define a port to listen and send the respondd packages. If not set or set to 0 the kernel will use a random free port at its own.
port = 10001
[[respondd.custom_fields]]
If you have custom respondd fields, you can ask Yanic to also collect these.
NOTE: This does not automatically include these fields in the output. The meshviewer-ffrgb output module will include them under "custom_fields", but other modules may simply ignore them.
name = zip
# You can use arbitrary GJSON expressions here, see https://github.com/tidwall/gjson
# We expect this expression to return a string.
path = nodeinfo.location.zip
[webserver]
Yanic has a little build-in webserver, which statically serves a directory. This is useful for testing purposes or for a little standalone installation.
[webserver]
enable = false
bind = "127.0.0.1:8080"
webroot = "/var/www/html/meshviewer"
enable
Enable to start the built-in webserver of Yanic
enable = false
bind
On which ip address and port listen the webserver
bind = "127.0.0.1:8080"
webroot
The path to a folder, which files are published on this webserver.
webroot = "/var/www/html/meshviewer"
[nodes]
[nodes]
state_path = "/var/lib/yanic/state.json"
prune_after = "7d"
save_interval = "5s"
offline_after = "10m"
state_path
A json file to cache all data collected directly from respondd.
state_path = "/var/lib/yanic/state.json"
prune_after
Prune data in RAM, cache-file and output json files (i.e. nodes.json) that were inactive for longer than.
prune_after = "7d"
save_interval
Export nodes and graph periodically.
save_interval = "5s"
offline_after
Set node to offline if not seen within this period.
offline_after = "10m"
[[nodes.output.example]]
This example block shows all option which is useable for every following output type.
Every output type has his own configuration under nodes.output
.
It is possible to have multiple output for one type of output, just add this group again with new parameters (see toml [[array of table]]).
[[nodes.output.example]]
enable = true
[nodes.output.example.filter]
no_owner = true
blacklist = ["00112233445566", "1337f0badead"]
sites = ["ffhb"]
domain_as_site = true
domain_append_site = true
has_location = true
[nodes.output.example.filter.in_area]
latitude_min = 34.30
latitude_max = 71.85
longitude_min = -24.96
longitude_max = 39.72
enable
Each output format has its own config block and needs to be enabled by adding:
enable = true
[nodes.output.example.filter]
For each output format there can be set different filters
[nodes.output.example.filter]
no_owner = true
blacklist = ["00112233445566", "1337f0badead"]
sites = ["ffhb"]
has_location = true
[nodes.output.example.filter.in_area]
latitude_min = 34.30
latitude_max = 71.85
longitude_min = -24.96
longitude_max = 39.72
no_owner
Set to false, if you want the json files to contain the owner information
WARNING: if it is not set, it will publish contact information of other persons.
no_owner = true
blacklist
List of nodeids of nodes that should be filtered out, so they won't appear in output
blacklist = ["00112233445566", "1337f0badead"]
sites
List of site_codes of nodes that should be included in output
sites = ["ffhb"]
domain_as_site
Replace the site_code
with the domain_code
in this output.
e.g. site_code='ffhb',domain_code='city'
becomes site_code='city', domain_code=''
domain_as_site = true
domain_append_site
Append on the site_code
the domain_code
with a .
in this output.
e.g. site_code='ffhb',domain_code='city'
becomes site_code='ffhb.city', domain_code=''
domain_append_site = true
sites
List of site_codes of nodes that should be included in output
sites = ["ffhb"]
has_location
set has_location to true if you want to include only nodes that have geo-coordinates set (setting this to false has no sensible effect, unless you'd want to hide nodes that have coordinates)
has_location = true
[nodes.output.example.filter.in_area]
nodes outside this area are not shown on the map but are still listed as a node without coordinates
latitude_min = 34.30
latitude_max = 71.85
longitude_min = -24.96
longitude_max = 39.72
[[nodes.output.geojson]]
The geojson output produces a geojson file which contains the location data of all monitored nodes to be used to visualize the location of the nodes. It is optimized to be used with UMap but should work with other tools as well.
Here is a public demo provided by Freifunk Muenchen: http://u.osmfr.org/m/328494/
[[nodes.output.geojson]]
enable = true
path = "/var/www/html/meshviewer/data/nodes.geojson"
path
The path, where to store nodes.geojson
path = "/var/www/html/meshviewer/data/nodes.geojson"
[[nodes.output.meshviewer-ffrgb]]
The new json file format for the meshviewer developed in Regensburg.
[[nodes.output.meshviewer-ffrgb]]
enable = true
path = "/var/www/html/meshviewer/data/meshviewer.json"
#[nodes.output.meshviewer-ffrgb.filter]
#no_owner = false
#blacklist = ["00112233445566", "1337f0badead"]
#has_location = true
#[nodes.output.meshviewer-ffrgb.filter.in_area]
#latitude_min = 34.30
#latitude_max = 71.85
#longitude_min = -24.96
#longitude_max = 39.72
path
The path, where to store meshviewer.json
path = "/var/www/html/meshviewer/data/meshviewer.json"
[[nodes.output.meshviewer]]
[[nodes.output.meshviewer]]
enable = false
version = 2
nodes_path = "/var/www/html/meshviewer/data/nodes.json"
graph_path = "/var/www/html/meshviewer/data/graph.json"
version
The structure version of the output which should be generated (i.e. nodes.json)
- version 1 is accepted by the legacy meshviewer (which is the master branch)
- https://github.com/ffnord/meshviewer/tree/master
- version 2 is accepted by the new version of meshviewer (which are in legacy develop branch or newer)
- https://github.com/ffnord/meshviewer/tree/dev
- https://github.com/ffrgb/meshviewer/tree/develop
version = 2
nodes_path
The path, where to store nodes.json (supports version 1 and two, see nodes_version
)
nodes_path = "/var/www/html/meshviewer/data/nodes.json"
graph_path
The path, where to store graph.json (only version 1)
graph_path = "/var/www/html/meshviewer/data/graph.json"
[[nodes.output.nodelist]]
The nodelist output is a minimal output with current state of collected data. Should be preferred to use it on the ffapi for the freifunk-karte.de
[[nodes.output.nodelist]]
enable = false
path = "/var/www/html/meshviewer/data/nodelist.json"
#[nodes.output.nodelist.filter]
#no_owner = false
path
The path, where to store nodelist.json
path = "/var/www/html/meshviewer/data/nodelist.json"
[[nodes.output.raw]]
This output takes the respondd response as sent by the node and includes it in a JSON document.
[[nodes.output.raw]]
enable = false
path = "/var/www/html/meshviewer/data/raw.json"
#[nodes.output.raw.filter]
#no_owner = false
path
The path, where to store raw.json
path = "/var/www/html/meshviewer/data/raw.json"
[database]
The database organize all database types. For all database types the is a internal job, which reset data for nodes (global statistics are still stored). (We have for privacy policy to store node data for maximum seven days.)
delete_after = "7d"
delete_interval = "1h"
delete_after
This will send delete commands to the database to prune data which is older than:
delete_after = "7d"
delete_interval
How often run the delete commands.
delete_interval = "1h"
[[database.connection.example]]
This example block shows all option which is useable for every following database type.
Every database type has his own configuration under database.connection
.
It is possible to have multiple connections for one type of database, just add this group again with new parameters (see toml [[array of table]]).
[[database.connection.example]]
enable = true
enable
Each database-connection has its own config block and needs to be enabled by adding:
enable = true
[[database.connection.influxdb]]
Save collected data to InfluxDB. There are would be the following measurements:
- node: store node specific data i.e. clients memory, airtime
- global: store global data, i.e. count of clients and nodes
- firmware: store the count of nodes tagged with firmware
- model: store the count of nodes tagged with hardware model
enable = false
address = "http://localhost:8086"
database = "ffhb"
username = ""
password = ""
insecure_skip_verify = false
[database.connection.influxdb.tags]
tagname1 = "tagvalue 1"
system = "productive"
site = "ffhb"
address
Address to connect on InfluxDB server.
address = "http://localhost:8086"
database
Database on which the measurement should be stored.
database = "ffhb"
username
Username to authenticate on InfluxDB
username = ""
password
Password to authenticate on InfluxDB.
password = ""
insecure_skip_verify
Skip insecure verify for self-signed certificates.
insecure_skip_verify = true
[database.connection.influxdb.tags]
You could set manuelle tags with inserting into a influxdb. Useful if you want to identify the yanic instance when you use multiple own on the same influxdb (e.g. multisites).
Warning:
Tags used by Yanic would override the tags from this config (e.g. nodeid
, hostname
, owner
, model
, firmware_base
, firmware_release
, frequency11g
, frequency11a
).
tagname1 = "tagvalue 1s"
# some useful e.g.:
system = "productive"
site = "ffhb"
[[database.connection.graphite]]
Save collected data to a graphite database.
enable = false
address = "localhost:2003"
prefix = "freifunk"
address
Address to connect on graphite server.
address = "localhost:2003"
prefix
Graphite is replacing every "." in the metric name with a slash "/" and uses that for the file system hierarchy it generates. it is recommended to at least move the metrics out of the root namespace (that would be the empty prefix). If you only intend to run one community and only freifunk on your graphite node then the prefix can be set to anything (including the empty string) since you probably wont care much about "polluting" the namespace.
prefix = "freifunk"
[[database.connection.respondd]]
Forward collected respondd package to a address (e.g. to another respondd collector like a central yanic instance or hopglass)
enable = false
type = "udp6"
address = "stats.bremen.freifunk.net:11001"
type
Type of network to create a connection.
Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket".
type = "udp6"
address
Destination address to connect/send respondd package.
address = "stats.bremen.freifunk.net:11001"
[[database.connection.logging]]
This database type is just for, debugging without a real database connection. A example for other developers for new database types.
enable = false
path = "/var/log/yanic.log"
path
Path to file where to store some examples with every line.
path = "/var/log/yanic.log"