Parses nagios-nrpe configuration files.
Author: Marc Fournier marc.f@camptoc amp.com ournier
Nrpe | Parses nagios-nrpe configuration files. |
License | This file is licensed under the LGPL v2+, like the rest of Augeas. |
Augeas Lenses | |
word | |
item_re | |
command | nrpe.cfg usually has many entries defining commands to run |
item | regular entries |
include | An include entry. |
include_dir | include_dir=/path/to/dir/ |
comment | Nrpe comments must start at beginning of line |
lns | The Nrpe lens |
filter | File filter |
let command = let obrkt = del /\[/ "[" in let cbrkt = del /\]/ "]" in [ key "command" . [ obrkt . key /[^]\/\n]+/ . cbrkt . eq . store /[^\n]+/ . del /\n/ "\n" ] ]
nrpe.cfg usually has many entries defining commands to run
command[check_foo]=/path/to/nagios/plugin -w 123 -c 456 command[check_bar]=/path/to/another/nagios/plugin --option
let word = /[^=\n\t ]+/
let item_re = /[^#=\n\t\/ ]+/ - (/command\[[^]\/\n]+\]/ | "include" | "include_dir")
nrpe.cfg usually has many entries defining commands to run
let command = let obrkt = del /\[/ "[" in let cbrkt = del /\]/ "]" in [ key "command" . [ obrkt . key /[^]\/\n]+/ . cbrkt . eq . store /[^\n]+/ . del /\n/ "\n" ] ]
regular entries
let item = [ key item_re . eq . store word . eol ]
An include entry.
let include = [ key "include" . [ label "file" . eq . store word . eol ] ]
include_dir=/path/to/dir/
let include_dir = [ key "include_dir" . [ label "dir" . eq . store word . eol ] ]
Nrpe comments must start at beginning of line
let comment = Util.comment_generic /#[ \t]*/ "# "
The Nrpe lens
let lns = ( command | include | include_dir | item | comment | empty ) *