3
Parses @CONFPATH@/hosts.conf
5
Author: Frederic Bohe <fredericbohe@eaton.com>
8
This file is licensed under the GPL.
11
Sample usage of this lens in augtool
13
* Print all monitored upsd
14
> print /files@CONFPATH@/hosts.conf/MONITOR
16
About: Configuration files
17
This lens applies to @CONFPATH@/hosts.conf. See <filter>.
23
(************************************************************************
25
*************************************************************************)
28
let del_spc = Util.del_opt_ws ""
29
let sep_spc = Util.del_ws_spc
31
let word = /[^"#; \t\n]+/
32
let empty = Util.empty
33
let comment = Util.comment
34
let quoted_string = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
36
let hosts_notify = [ del_spc . key "MONITOR" . sep_spc
37
. [ label "system" . store word . sep_spc ]
38
. [ label "description" . quoted_string ] . eol ]
40
let hosts_lns = (hosts_notify|comment|empty)*
42
let hosts_filter = ( incl "@CONFPATH@/hosts.conf" )
45
let hosts_xfm = transform hosts_lns hosts_filter