Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xymon.aug: Add group-sorted to definitions #462

Merged
merged 1 commit into from
May 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lenses/tests/test_xymon.aug
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ group group1
3.3.3.3 host1 #
4.4.4.4 host2 #

group-sorted group2
5.5.5.5 host3 # conn
6.6.6.6 host4 # ssh

subparent page1 page2 This is after page 1
10.0.0.1 router1.loni.org #
10.0.0.2 sw1.localdomain #
Expand Down Expand Up @@ -77,6 +81,19 @@ test Xymon.lns get conf =
}
{ }
}
{ "group-sorted" = "group2"
{ "host"
{ "ip" = "5.5.5.5" }
{ "fqdn" = "host3" }
{ "tag" = "conn" }
}
{ "host"
{ "ip" = "6.6.6.6" }
{ "fqdn" = "host4" }
{ "tag" = "ssh" }
}
{ }
}
}
{ "subparent" = "page2"
{ "parent" = "page1" }
Expand Down
5 changes: 3 additions & 2 deletions lenses/xymon.aug
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let host = [ label "host" . host_ip . del space " " . host_hostname . host_colon
let group_extra = del_ws_spc . value_to_eol . eol_no_spc . (comment | empty | host | title)*
let group = [ key "group" . group_extra ]
let group_compress = [ key "group-compress" . group_extra ]
let group_sorted = [ key "group-sorted" . group_extra ]

let group_only_col = [ label "col" . store Rx.word ]
let group_only_cols = del_ws_spc . group_only_col . ( Util.del_str "|" . group_only_col )*
Expand All @@ -39,15 +40,15 @@ let group_only = [ key "group-only" . group_only_cols . group_extra ]
let page_name = store word
let page_title = [ label "pagetitle" . del_ws_spc . value_to_eol . eol_no_spc ]
let page_extra = del_ws_spc . page_name . (page_title | eol_no_spc) . (comment | empty | title | include | host)*
. (group | group_compress | group_only)*
. (group | group_compress | group_sorted | group_only)*
let page = [ key /page|subpage/ . page_extra ]

let subparent_parent = [ label "parent" . store word ]
let subparent = [ key "subparent" . del_ws_spc . subparent_parent . page_extra ]

let ospage = [ key "ospage" . del_ws_spc . store word . del_ws_spc . [ label "ospagetitle" . value_to_eol . eol_no_spc ] ]

let lns = (empty | comment | include | host | title | ospage )* . (group | group_compress | group_only)* . (page | subparent)*
let lns = (empty | comment | include | host | title | ospage )* . (group | group_compress | group_sorted | group_only)* . (page | subparent)*

let filter = incl "/etc/xymon/hosts.cfg" . incl "/etc/xymon/pages.cfg"

Expand Down