Module: check_mk
Branch: master
Commit: 66782542ab85321fe498a17c9fa29a2a58755a20
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66782542ab8532…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 17 08:36:42 2010 +0100
Always add tags "webconf" and filename
---
LIESMICH.webconf | 23 +++++++++++++++++++++++
web/htdocs/webconf.py | 7 ++++---
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/LIESMICH.webconf b/LIESMICH.webconf
new file mode 100644
index 0000000..cf1e5a0
--- /dev/null
+++ b/LIESMICH.webconf
@@ -0,0 +1,23 @@
+* Integration mit Multisite:
+ - Bei einem Host muss es einen Kontextknopf zur Konfig-GUI geben, falls
+ dieser host per webconf erstellt wurde.
+ - Link von Webconf auf den Host in Nagios. Dazu muss ich die lokale
+ Site wissen (konfigurieren in multisite.mk)
+
+* Evtl. sollte man den Hosts Tags verpassen: 'webconf' und 'hirni.mk',
+ also die Datei, aus der der Host kommt. Das würde auch die GUI-Links
+ leichter machen.
+
+* Es fehlt noch SNMP. Keine Ahnung, wie ich das am besten umsetze
+
+* Knopf zum Löschen eines Hosts auch in Detailmaske
+
+* Arbeitsfluss besser umsetzen. Kann/soll man so eine Art Wizard
+ machen?
+
+* Eine Flagdatei, welche klarmacht, dass Änderungen gemacht, aber
+Nagios nicht neugestartet wurde. Evtl. kann man diese als Art
+Logdatei aufbauen - ein Audit-log. Falls ja, sollte es beim Neustarten
+umgeschoben werden in ein generelles Log.
+
+* Doku
diff --git a/web/htdocs/webconf.py b/web/htdocs/webconf.py
index d4caa78..33ec323 100644
--- a/web/htdocs/webconf.py
+++ b/web/htdocs/webconf.py
@@ -41,7 +41,7 @@ def read_configuration_file(filename):
for h in variables["all_hosts"]:
parts = h.split('|')
hostname = parts[0]
- tags = parts[1:]
+ tags = [ tag for tag in parts[1:] if tag != 'webconf' and not tag.endswith('.mk') ]
ipaddress = variables["ipaddresses"].get(hostname)
aliases = host_extra_conf(hostname, variables["extra_host_conf"]["alias"])
if len(aliases) > 0:
@@ -64,7 +64,7 @@ def write_configuration_file(filename, hosts):
alias, ipaddress, tags = hosts[hostname]
if alias:
aliases.append((alias, [hostname]))
- all_hosts.append("|".join([hostname] + tags))
+ all_hosts.append("|".join([hostname] + tags + [ filename, 'webconf' ]))
if ipaddress:
ipaddresses[hostname] = ipaddress
@@ -75,7 +75,8 @@ def write_configuration_file(filename, hosts):
out.write("all_hosts += ")
out.write(pprint.pformat(all_hosts))
if len(aliases) > 0:
- out.write("\n\nif 'alias' not in extra_host_conf:\n extra_host_conf['alias'] = []\n")
+ out.write("\n\nif 'alias' not in extra_host_conf:\n"
+ " extra_host_conf['alias'] = []\n")
out.write("\nextra_host_conf['alias'] += ")
out.write(pprint.pformat(aliases))
if len(ipaddresses) > 0: