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 LGPLv2+, like the rest of Augeas.
Augeas Lenses
word
commandnrpe.cfg usually has many entries defining commands to run
item_reregular entries re
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 LGPLv2+, like the rest of Augeas.

Augeas Lenses

word

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

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_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 re

item

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

regular entries

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 | item | include | include_dir | comment | empty ) *

The Nrpe lens

filter

File filter

let word = /[^=\n\t ]+/
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_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 re
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 | item | include | include_dir | comment | empty ) *
The Nrpe lens
Close