Module: check_mk
Branch: master
Commit: 6a858e36f7b92bfa732339cea1f6aadeb495560f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a858e36f7b92b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 21:07:06 2011 +0100
Internal file cleanup
---
LIESMICH.benutzer | 25 -------------------------
TODO | 31 -------------------------------
listtar => doc/helpers/listtar | 0
3 files changed, 0 insertions(+), 56 deletions(-)
diff --git a/LIESMICH.benutzer b/LIESMICH.benutzer
deleted file mode 100644
index b1152fe..0000000
--- a/LIESMICH.benutzer
+++ /dev/null
@@ -1,25 +0,0 @@
-Konzept für Verwaltung von Benutzern und Rollen
------------------------------------------------
-Was jetzt noch fehlt:
-MS5: Beim Löschen von Objekten Bezüge sicherstellen. Im config-Dialog
- könnte man darauf hinweisen, dass es Bezüge gibt und diese
- automatisch entfernen. Oder soll man eher sperren? Das wäre einfacher.
- * Das Löschen von Rollen ist schon entsprechend Umgesetzt
- * Löschen von Kontaktgruppen. Diese haben Bezüge zu Hosts, Services
- Foldern und Usern. An allen vier Stellen muss gelöscht werden.
- * Löschen von Timeperiods. Entsprechende Regeln müssen bearbeitet werden.
-MS6: Login-Maske für Multisite - diese optional machen (Default is
- HTTP-Auth). In OMD per Config einen Schalter dafür einbauen.
-MS6: NagVis und PNP so erweitern, dass eine zentral Auth funktioniert.
-MS6: Spracheinstellung pro Benutzer
-MS5: custom_links Snapin muss evtl. repariert werden.
-MS5/6: Email-Notifikation einrichten. Da sollte ein Befehl in die
- Standardtemplates von Check_MK rein. Am besten wäre wahrscheinlich
- ein cmk --notify, das als Argument Service und Host und Contact bekommt und
- evtl. noch ein paar Variablen und dann den Rest per Livestatus rauszieht?
- Eigentlich sollte das gehen, da ja der Notifizieren auch in einer Multisite-
- Umgebung immer lokal erfolgt. Die Rechte hat man auch immer, weil man ja
- von Nagios aufgerufen wird.
- cmk --notify zieht sich dann alles per Livestatus raus und packt nach
- Belieben alles in die Mail rein, bis zu Auszügen aus Logwatch und PNP-Graphen.
-
diff --git a/TODO b/TODO
deleted file mode 100644
index 777913c..0000000
--- a/TODO
+++ /dev/null
@@ -1,31 +0,0 @@
-Zu tun bei wato-ng:
-
-[modules]
-* checkgroup ausgeben bei cmk -L, cmk -M.
-* cmk -M soll Check-Parameterbeschreibungen automatisch auslesen
-
-[web]
-* Diagnosefunktion: wenn man eine Regelkette sieht kann man diese
- per Knopfdruck durchrechnen lassen und sieht dann, welche
- hosts von welcher Regel erfasst werden.
-* Verlinkung von Service zu Regelkette, Knopf für "Ausnahme für diesen
- Service erstellen"
-* class Alternative: Die Radiobuttons sollen <div>s unsichtbar werden
- lassen von den nicht genutzten Alternativen.
-* Konfiguration von Timeperiods
-* Value-Editor für die Auswahl einer Timeperiod.
-* Wie bekomme ich es hin, dass man keine TP löschen kann, die noch in
- einer Regel benannt wird?
-
-[decl]
-* Alle Checkgruppen deklarieren, die für LC-Checks gebraucht werden.
-
-[optional]
-* Auch multisite.mk-Variablen steuerbar machen
-* (nur OMD): auch ausgewählte Nagios-Variablen configurierbar machen
-
-Ganz ferne Zukunft (Brauch LC und DK nicht):
-===================
-- Explizite Checks (checks += )
-- Cluster
-- Host Tags
diff --git a/listtar b/doc/helpers/listtar
similarity index 100%
rename from listtar
rename to doc/helpers/listtar
Module: check_mk
Branch: master
Commit: 50791ed352d60dc4214930996f46839f23001f60
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50791ed352d60d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 19:58:19 2011 +0100
Updated bug entries #0027, #0490, #0155
---
.bugs/155 | 8 ++++++--
.bugs/27 | 8 ++++++--
.bugs/490 | 7 +++++--
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/.bugs/155 b/.bugs/155
index 85eac66..04bbf0b 100644
--- a/.bugs/155
+++ b/.bugs/155
@@ -1,11 +1,15 @@
Title: check_mk -I should accept tags
Component: core
+State: done
+Class: feature
Benefit: 2
-State: open
Cost: 1
Date: 2011-02-21 17:42:12
-Class: feature
+Targetversion: future
When doing a cmk -I(I), one should be possible to
specify tags instead of specific hosts. The same feature
could be usefull for -N, -C, -D and maybe other commands as well.
+
+2011-12-19 19:58:09: changed state open -> done
+Implemented for -I and -II.
diff --git a/.bugs/27 b/.bugs/27
index f4321e4..d0c27f6 100644
--- a/.bugs/27
+++ b/.bugs/27
@@ -1,12 +1,16 @@
Title: windows agent: Startmodus von Dienstens ausgeben
Component: checks
+State: done
+Class: feature
Benefit: 2
-State: open
Cost: 2
Date: 2010-12-21 16:40:20
-Class: feature
+Targetversion: future
So kann die Inventur z.B. automatisch alle Dienste
überwachen, welche auf 'automatisch' stehen. Oder man macht
nur einen einzigen Check für alle Dienste, der prüft, das
alle auf automatisch stehenden Dinge auch gestartet sind.
+
+2011-12-19 19:56:44: changed state open -> done
+Ist schon länger umgesetzt.
diff --git a/.bugs/490 b/.bugs/490
index f586de8..0fafc7e 100644
--- a/.bugs/490
+++ b/.bugs/490
@@ -1,11 +1,14 @@
Title: cmk -I on cluster should work
Component: core
+State: done
+Class: feature
Benefit: 1
-State: open
Cost: 1
Date: 2011-12-09 14:27:05
Targetversion: future
-Class: feature
When doing inventory on a cluster we could simply
replace the cluster name by the node names.
+
+2011-12-19 19:57:02: changed state open -> done
+Done in current GIT version
Module: check_mk
Branch: master
Commit: f849146331fe0dec4a90af9a8cee0fff0ff57796
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f849146331fe0d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 19:22:08 2011 +0100
cmk -I: allow tag combinations
---
modules/check_mk.py | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1b3d591..de2dc5e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1112,14 +1112,16 @@ def parse_hostname_list(args):
else:
if arg[0] == '@':
arg = arg[1:]
+ tagspec = arg.split(',')
+
num_found = 0
- for host in valid_hosts:
- if arg in hosttags[host]:
- hostlist.append(host)
+ for hostname in valid_hosts:
+ if hosttags_match_taglist(tags_of_host(hostname), tagspec):
+ hostlist.append(hostname)
num_found += 1
if num_found == 0:
- sys.stderr.write("No host or tag with the name '%s' is defined in "
- "all_hosts or clusters.\n" % (arg))
+ sys.stderr.write("Hostname or tag specification '%s' does "
+ "not match any host.\n" % arg)
sys.exit(1)
return hostlist
@@ -1934,8 +1936,6 @@ def do_snmp_scan(hostnamelist, check_only=False, include_state=False):
result = []
for hostname in hostnamelist:
if not is_snmp_host(hostname):
- if opt_verbose:
- sys.stdout.write("Skipping %s, not an snmp host\n" % hostname)
continue
try:
ipaddress = lookup_ipaddress(hostname)
@@ -4450,6 +4450,12 @@ if __name__ == "__main__":
hostnames = list(set([ h for h in hostnames if not is_cluster(h) ]))
hostnames.sort()
+ if opt_verbose:
+ if len(hostnames) > 0:
+ sys.stdout.write("Inventorizing %s.\n" % ", ".join(hostnames))
+ else:
+ sys.stdout.write("Inventorizing all hosts.\n")
+
if inventory_checks:
checknames = inventory_checks.split(",")
Module: check_mk
Branch: master
Commit: 2676ae5fa08bfe3f5971e2e9d73131f4d1f61fde
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2676ae5fa08bfe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 19:08:36 2011 +0100
cmk -I: accept host tags and cluster names
Unknown hostnames are considered to be tags and will be replaced
by all hosts with that tag. Prefixing @ forces interpretation as
tag. Cluster names are also allowed now and will be replaced by
the list of nodes.
---
ChangeLog | 4 ++++
modules/check_mk.py | 34 +++++++++++++++++++++++++++++++++-
2 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 87bcaf1..ac58691 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.1.13i2
+ Core, Setup, etc.:
+ * cmk -I: accept host tags and cluster names
+
Checks & Agents:
* linux agent - ipmi: Creating directory of cache file if not exists
* dell_powerconnect_cpu: renamed service from CPU to "CPU utilization", in
@@ -65,6 +68,7 @@
to set number of processes. Nagios will not fork() anymore for check exection.
* New columns num_hosts and num_services in status table
* New aggregation functions suminv and avginv (see Documentation)
+
Core, Setup, etc.:
* New configuration variable static_checks[] (used by WATO)
* New configuration variable checkgroup_parameters (mainly for WATO)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1b8e426..1b3d591 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1103,6 +1103,25 @@ def host_is_member_of_site(hostname, site):
# hosts without a site: tag belong to all sites
return True
+def parse_hostname_list(args):
+ valid_hosts = all_active_hosts() + all_active_clusters()
+ hostlist = []
+ for arg in args:
+ if arg[0] != '@' and arg in valid_hosts:
+ hostlist.append(arg)
+ else:
+ if arg[0] == '@':
+ arg = arg[1:]
+ num_found = 0
+ for host in valid_hosts:
+ if arg in hosttags[host]:
+ hostlist.append(host)
+ num_found += 1
+ if num_found == 0:
+ sys.stderr.write("No host or tag with the name '%s' is defined in "
+ "all_hosts or clusters.\n" % (arg))
+ sys.exit(1)
+ return hostlist
def hostgroups_of(hostname):
@@ -4419,7 +4438,18 @@ if __name__ == "__main__":
if not done and seen_I > 0:
- hostnames = args
+ hostnames = parse_hostname_list(args)
+ # For clusters add their nodes to the list
+ nodes = []
+ for h in hostnames:
+ nodes = nodes_of(h)
+ if nodes:
+ hostnames += nodes
+
+ # Then remove clusters and make list unique
+ hostnames = list(set([ h for h in hostnames if not is_cluster(h) ]))
+ hostnames.sort()
+
if inventory_checks:
checknames = inventory_checks.split(",")
@@ -4428,6 +4458,8 @@ if __name__ == "__main__":
if inventory_checks == None:
checknames = inventorable_checktypes("all")
if len(hostnames) > 0:
+ # Entries in hostnames that are either prefixed with @
+ # or are no valid hostnames are considered to be tags.
for host in hostnames:
remove_autochecks_of(host, checknames)
clust = cluster_of(host)