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 LGPLv2+, like the rest of Augeas. |
Augeas Lenses | |
word | |
command | nrpe.cfg usually has many entries defining commands to run |
item_re | regular entries re |
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 ]+/
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 re
let item_re = "server_port" | "command_prefix" | "server_address" | "allowed_hosts" | "debug" | "nrpe_user" | "nrpe_group" | "dont_blame_nrpe" | "command_timeout" | "connection_timeout" | "allow_weak_random_seed" | "pid_file" | "log_facility"
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 | item | include | include_dir | comment | empty ) *