Nrpe

Parses nagios-nrpe configuration files.

Author: Marc Fournier marc.f.nosp@m.ournier@camptoc.nosp@m.amp.com

Summary
NrpeParses nagios-nrpe configuration files.
LicenseThis file is licensed under the LGPL v2+, like the rest of Augeas.
Augeas Lenses
word
item_re
commandnrpe.cfg usually has many entries defining commands to run
itemregular entries
includeAn include entry.
include_dirinclude_dir=/path/to/dir/
commentNrpe comments must start at beginning of line
lnsThe Nrpe lens
filterFile filter

License

This file is licensed under the LGPL v2+, like the rest of Augeas.

Augeas Lenses

word

let word = /[^=\n\t ]+/

item_re

let item_re = /[^#=\n\t\/ ]+/ - (/command\[[^]\/\n]+\]/ | "include" | "include_dir")

command

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

item

let item = [ key item_re . eq . store word . eol ]

regular entries

allow_bash_command_substitution=0

include

let include = [ key "include" . [ label "file" . eq . store word . eol ] ]

An include entry.

nrpe.cfg can include more than one file or directory of files

include=/path/to/file1.cfg
include=/path/to/file2.cfg

include_dir

let include_dir = [ key "include_dir" . [ label "dir" . eq . store word . eol ] ]

include_dir=/path/to/dir/

comment

let comment = Util.comment_generic /#[ \t]*/ "# "

Nrpe comments must start at beginning of line

lns

let lns = ( command | include | include_dir | item | comment | empty ) *

The Nrpe lens

filter

File filter

let word = /[^=\n\t ]+/
let item_re = /[^#=\n\t\/ ]+/ - (/command\[[^]\/\n]+\]/ | "include" | "include_dir")
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
let item = [ key item_re . eq . store word . eol ]
regular entries
let include = [ key "include" . [ label "file" . eq . store word . eol ] ]
An include entry.
let include_dir = [ key "include_dir" . [ label "dir" . eq . store word . eol ] ]
include_dir=/path/to/dir/
let comment = Util.comment_generic /#[ \t]*/ "# "
Nrpe comments must start at beginning of line
let lns = ( command | include | include_dir | item | comment | empty ) *
The Nrpe lens
Close