14 let del_ws_spc = Util.del_ws_spc
15 let value_to_eol = store /[^ \t][^\n]+/
16 let eol_no_spc = Util.del_str "\n"
18 let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
19 let include = [ key /include|dispinclude|netinclude|directory/ . del_ws_spc . value_to_eol . eol_no_spc ]
20 let title = [ key "title" . del_ws_spc . value_to_eol . eol_no_spc ]
23 let tag = del_ws_spc . [ label "tag" . store /[^ \n\t]+/ ]
24 let host_ip = [ label "ip" . store ip ]
25 let host_hostname = [ label "fqdn" . store word ]
26 let host_colon = del /[ \t]*#/ " #"
27 let host = [ label "host" . host_ip . del space " " . host_hostname . host_colon . tag* . eol ]
29 (* Define group-compress and group-only *)
30 let group_extra = del_ws_spc . value_to_eol . eol_no_spc . (comment | empty | host | title)*
31 let group = [ key "group" . group_extra ]
32 let group_compress = [ key "group-compress" . group_extra ]
33 let group_sorted = [ key "group-sorted" . group_extra ]
35 let group_only_col = [ label "col" . store Rx.word ]
36 let group_only_cols = del_ws_spc . group_only_col . ( Util.del_str "|" . group_only_col )*
37 let group_only = [ key "group-only" . group_only_cols . group_extra ]
39 (* Have to use namespacing because page's title overlaps plain title tag *)
40 let page_name = store word
41 let page_title = [ label "pagetitle" . del_ws_spc . value_to_eol . eol_no_spc ]
42 let page_extra = del_ws_spc . page_name . (page_title | eol_no_spc) . (comment | empty | title | include | host)*
43 . (group | group_compress | group_sorted | group_only)*
44 let page = [ key /page|subpage/ . page_extra ]
46 let subparent_parent = [ label "parent" . store word ]
47 let subparent = [ key "subparent" . del_ws_spc . subparent_parent . page_extra ]
49 let ospage = [ key "ospage" . del_ws_spc . store word . del_ws_spc . [ label "ospagetitle" . value_to_eol . eol_no_spc ] ]
51 let lns = (empty | comment | include | host | title | ospage )* . (group | group_compress | group_sorted | group_only)* . (page | subparent)*
53 let filter = incl "/etc/xymon/hosts.cfg" . incl "/etc/xymon/pages.cfg"
55 let xfm = transform lns filter