-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new treasure for creating customized Tactical Overview snapins
- Loading branch information
1 parent
fbb7004
commit 100bee7
Showing
2 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/python | ||
# -*- encoding: utf-8; py-indent-offset: 4 -*- | ||
|
||
# Put this into local/share/check_mk/web/plugins/sidebar. And you will get | ||
# additional versions of "Tactical Overview" for hosts having a certain | ||
# tag. | ||
|
||
def create_tactical_overview_snapin(title, tag_group, tag_name): | ||
def create_render_function(tag_group, tag_name): | ||
return lambda: render_tactical_overview( | ||
extra_filter_headers = "Filter: host_custom_variables ~ TAGS (^|[ ])%s($|[ ])\n" % tag_name, | ||
extra_url_variables = [ | ||
( "host_tag_0_grp", tag_group ), | ||
( "host_tag_0_op", "is" ), | ||
( "host_tag_0_val", tag_name ), | ||
]) | ||
|
||
sidebar_snapins["tactical_overview_" + tag_name] = { | ||
"title" : title, | ||
"description" : _("Tactical overview of all hosts with the tag %s") % tag_name, | ||
"refresh" : True, | ||
"render" : create_render_function(tag_group, tag_name), | ||
"allowed" : [ "user", "admin", "guest" ], | ||
"styles" : snapin_tactical_overview_styles, | ||
} | ||
|
||
# Here you declare which copies of the snapin you wnat: | ||
create_tactical_overview_snapin(u"München", "stadt", "muc") | ||
create_tactical_overview_snapin(u"Göttingen", "stadt", "got") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters