jaesivsm/MindYourNeighbors

View on GitHub
mind_your_neighbors.example.cfg

Summary

Maintainability
Test Coverage
[DEFAULT]
# see python loglevels, default if not provided is INFO, case does not matter
loglevel = DEBUG
## ------------
# below that line, all the options can be repeated in the sections below for a 'per section' behavior
# number of time in a row we have to see neighbors to launch adapted command
threshold = 3
# regex filtering in or out the lines of ip neigh
filter_on_regex = .*(10.0.0.|2001:).*
filter_out_regex = ^127\.0\.0\.1$
# list of comma separated terms that, if found in the line, will exclude it
exclude = <an address ip>,<an address mac>
# list of comma separated machine names that should be in the known_machines section, to filter in or out
filter_on_machines = <machine named below>,<machine named below>
filter_out_machines = <machine named below>,<machine named below>
# see the 'man ip-neigh', will check neighbors on a single interface
device = eth0
# if something shows up on the stderr of the launched command, and that option is true, the result of the command won't be taken into account
error_on_stderr = false

[known_machines]
myphone = ma:ca:dd:re:ss:01
mycomputer = ma:ca:dd:re:ss:02
myotherphone = ma:ca:dd:re:ss:03

[example]
# command launched when no neighbor are found
command_no_match = /usr/bin/bandwith-consuming-prgm
# command launched when one or more neighbor are found
command_match = killall bandwith-consuming-prgm
# default to true, "enable = false" will disable an entire section
enable = false

[awake my computer when I'm home]
command_match = wake machine up
# as attributes are inherited from the default section, we may have to overwrite them like this to ignore them
filter_on_regex =
filter_out_regex =
# filtering on declared machines, will be triggered if any of them are present
filter_on_machines = myphone,myotherphone
# this option will enable this section only on week days between 18 and 23h
cron = * 18-23 * * 1-5