This lens tries to keep as close as possible to `man 5 alerts.cfg` where possible.
This file is licenced under the LGPL v2+, like the rest of Augeas.
File inclusion are not followed
This lens applies to /etc/xymon/alerts.d/*.cfg and /etc/xymon/alerts.cfg. See filter.
| let store_word = store /[^ =\t\n#]+/
comparison The greater and lesser than operators
| let ws_or_eol = del /([ \t]+|[ \t]*\n[ \t]*)/ " "
| let comment = Util.comment
| let include = [ key "include" . ws . store_word . eol ]
| let macrodefinition = [ key /\$[^ =\t\n#\/]+/ . Sep.space_equal . store Rx.space_in . eol ]
A string that starts with $ and that is assigned something
| let flag (kw:string) = Build.flag kw
A flag value
| let kw_word (kw:regexp) = Build.key_value kw equal store_word
A key=value value
| let page = kw_word /(EX)?PAGE/
The (ex)?page filter definition
| let group = kw_word /(EX)?GROUP/
The (ex)?group filter definition
| let host = kw_word /(EX)?HOST/
The (ex)?host filter definition
| let service = kw_word /(EX)?SERVICE/
The (ex)?service filter definition
| let color = kw_word "COLOR"
The color filter definition
| let time = kw_word "TIME"
The time filter definition
| let duration = [ key "DURATION" . [ label "operator" . comparison ] . [ label "value" . store_word ] ]|
The duration filter definition
| let recover = flag "RECOVER"|
The recover filter definition
| let notice = flag "NOTICE"
The notice filter definition
| let rule_filter = page | group | host | service
| color | time | duration | recover | notice
Filters are made out of any of the above filter definitions
| let filters = [ label "filters" . Build.opt_list rule_filter ws ]
One or more filters
| let filters_opt = [ label "filters" . (ws . Build.opt_list rule_filter ws)? ]
Zero, one or more filters
| let kw_word_filters_opt (kw:string) = [ key kw . equal . store_word . filters_opt ]
A kw_word entry with optional filters
| let flag_filters_opt (kw:string) = [ key kw . filters_opt ]
A flag with optional filters
| let mail = [ key "MAIL" . ws . store_word . filters_opt ]
The mail recipient definition
| let script = [ key "SCRIPT" . ws . [ label "script" . store_word ]
. ws . [ label "recipient" . store_word ] . filters_opt ]
The script recipient definition
| let ignore = flag_filters_opt "IGNORE"
The ignore recipient definition
| let format = kw_word_filters_opt "FORMAT"
The format recipient definition
| let repeat = kw_word_filters_opt "REPEAT"
The repeat recipient definition
| let unmatched = flag_filters_opt "UNMATCHED"
The unmatched recipient definition
| let stop = flag_filters_opt "STOP"
The stop recipient definition
| let macro = [ key /\$[^ =\t\n#\/]+/ . filters_opt ]
The macro recipient definition
| let recipient = mail | script | ignore | format | repeat | unmatched
| stop | macro
Recipients are made out of any of the above recipient definitions
| let rule = [ seq "rules" . filters . ws_or_eol . recipients . eol ]
Rules are made of rule_filter and then recipients sperarated by a whitespace
| let lns = ( rule | macrodefinition | include | empty | comment )*
The Xymon_Alerting lens