3 Parses /etc/{nagios{3,},icinga}/*.cfg
5 Authors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>
6 Raphaƫl Pinson <raphink@gmail.com>
9 This file is licenced under the LGPL v2+, like the rest of Augeas.
14 About: Configuration files
15 This lens applies to /etc/{nagios{3,},icinga}/*.cfg. See <filter>.
21 (************************************************************************
22 * Group: Utility variables/functions
23 ************************************************************************)
27 let space_in = /[^ \t\n][^\n=]*[^ \t\n]|[^ \t\n]/
28 in key /[A-Za-z0-9_]+/
29 . Sep.opt_space . Sep.equal . Sep.opt_space
33 Macro line, as used in resource.cfg *)
35 let macro = /\$[A-Za-z0-9]+\$/
36 in let macro_decl = Rx.word | Rx.fspath
37 in key macro . Sep.space_equal . store macro_decl
39 (************************************************************************
41 ************************************************************************)
43 Params can have sub params *)
45 [ Util.indent . param_def
46 . [ Sep.space . param_def ]*
50 let macro = [ Util.indent . macro_def . Util.eol ]
52 (************************************************************************
54 ************************************************************************)
56 Define the accepted entries, such as param for regular configuration
57 files, and macro for resources.cfg .*)
63 let lns = ( Util.empty | Util.comment | entry )*
66 let filter = incl "/etc/nagios3/*.cfg"
67 . incl "/etc/nagios/*.cfg"
68 . incl "/etc/icinga/*.cfg"
69 . excl "/etc/nagios3/commands.cfg"
70 . excl "/etc/nagios/commands.cfg"
71 . excl "/etc/nagios/nrpe.cfg"
72 . incl "/etc/icinga/commands.cfg"
74 let xfm = transform lns filter