Module: check_mk
Branch: master
Commit: fe3238c26a4a257b872e5736b9834446b2bb65a9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe3238c26a4a25…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 11:28:53 2012 +0100
Default config: add contact group 'all' and put all hosts into it
---
ChangeLog | 3 ++-
web/htdocs/wato.py | 43 ++++++++++++++++++++++++++++++++-----------
2 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ea48465..aef65b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,7 +48,6 @@
users using the form based authentication with LDAP. It is also possible
to synchronize some attributes like mail addresses, names and roles from
LDAP into multisite.
- * Modularized the authentication and user management code in WATO
* Restructured cookie auth cookies (all auth cookies will be invalid
after update -> all users have to login again)
* Modularized login and cookie validation
@@ -76,6 +75,8 @@
* FIX: Persisting changing of folder titles when only the title has changed
* Add: Creating a new rule immediately opens its edit formular
* The rules formular now uses POST as transaction method
+ * Modularized the authentication and user management code
+ * Default config: add contact group 'all' and put all hosts into it
Event Console:
* FIX: fix exception in rules that use facility local7
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 08cb129..f8e0342 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5653,7 +5653,8 @@ def mode_groups(phase, what):
global_buttons()
html.context_button(_("New group"), make_link([("mode", "edit_%s_group" % what)]), "new")
if what == "contact":
- pass
+ html.context_button(_("Rules"), make_link([("mode", "rulesets"),
+ ("filled_in", "search"), ("search", "contact group")]), "rulesets")
else:
varname = what + "_groups"
html.context_button(_("Rules"), make_link([("mode", "edit_ruleset"), ("varname", varname)]), "rulesets")
@@ -10950,14 +10951,22 @@ def page_user_profile():
# | Functions for creating an example configuration |
# '----------------------------------------------------------------------'
-# Create a very basic sample configuration, but only if no host tags
-# or rules have been defined *ever*.
+# Create a very basic sample configuration, but only if none of the
+# files that we will create already exists. That is e.g. the case
+# after an update from an older version where no sample config had
+# been created.
def create_sample_config():
if os.path.exists(multisite_dir + "hosttags.mk") \
- or os.path.exists(root_dir + "rules.mk"):
+ or os.path.exists(root_dir + "rules.mk") \
+ or os.path.exists(root_dir + "groups.mk"):
return
- # Example values for host tags
+ # A contact group where everyone is member of
+ groups = {
+ "contact" : { 'all', u'Everybody' },
+ }
+
+ # Basic setting of host tags
wato_host_tags = \
[('agent',
u'Agent type',
@@ -10984,17 +10993,29 @@ def create_sample_config():
save_hosttags(wato_host_tags, wato_aux_tags)
- # Example values for rules
+ # Rules that match the upper host tag definition
rulesets = {
+ # Make the tag 'offline' remove hosts from the monitoring
'only_hosts': [
- (['!offline'], ['@all'])],
- 'ping_levels': [
+ (['!offline'], ['@all'],
+ {'comment': u'Do not monitor hosts with the tag "offline"'})],
+
+ # Rule for WAN hosts with adapted PING levels
+ 'ping_levels': [
({'loss': (80.0, 100.0),
'packets': 6,
'rta': (1500.0, 3000.0),
- 'timeout': 20}, ['wan'], ['@all'])],
- 'bulkwalk_hosts': [
- (['!snmp-v1'], ['@all'])],
+ 'timeout': 20}, ['wan'], ['@all'],
+ {'comment': u'Allow longer round trip times when pinging WAN hosts'})],
+
+ # All hosts should use SNMP v2c if not specially tagged
+ 'bulkwalk_hosts': [
+ (['!snmp-v1'], ['@all'], {'comment': u'Hosts with the tag "snmp-v1" must not use bulkwalk'})],
+
+ # Put all hosts and the contact group 'all'
+ 'host_contactgroups': [
+ ('all', [], ALL_HOSTS, {'comment': u'Put all hosts into the contact group "all"'} ),
+ ]
}
save_rulesets(g_root_folder, rulesets)
Module: check_mk
Branch: master
Commit: 0b6b8004d58cf66de4e9cb20b5d55243b70518a1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0b6b8004d58cf6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 11:48:12 2012 +0100
Disable notification per default for new users
Now you can edit and save omdadmin without an error message or
changing something of the status quo
---
web/htdocs/wato.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index aa84a62..a7a229a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8148,7 +8148,7 @@ def mode_edit_user(phase):
forms.header(_("Notifications"), isopen=False)
forms.section(_("Enabling"), simple=True)
- html.checkbox("notifications_enabled", user.get("notifications_enabled", True),
+ html.checkbox("notifications_enabled", user.get("notifications_enabled", False),
label = _("enable notifications"))
html.help(_("Notifications are sent out "
"when the status of a host or service changes."))