Module: check_mk
Branch: master
Commit: a77796445a80b07135b9f11174b804c5ec3b5d15
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a77796445a80b0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 22:38:30 2010 +0200
Updated internal doku
---
LIESMICH.zutun | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 4561976..815e2f4 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -3,9 +3,6 @@ BUGS beheben bis => 1.1.8
--------------------------------------------------------------------------------
CHECK_MK:
-Clusters mit IP-Adressen: Der Host-Check soll die IP-Adresse verwenden,
-wenn sie vorhanden ist.
-
--------------------------------------------------------------------------------
BUGS beheben ab 1.1.9i1
--------------------------------------------------------------------------------
@@ -66,16 +63,15 @@ geloggt wird nur das Starten und Beenden (was ja im Hauptthread läuft).
Windows-Agent: Memory-Check neu machen. Swap stimmt nicht. Evtl. zwei
getrennte Checks für Memory and Pagefile.
---snmpwalk: Braucht man das translaten noch? Ich arbeite doch jetzt eh
-nur noch ohne MIB-Dateien. Das würde das ganze deutlich vereinfachen!
-
-
-------------------------------------------------------------------------------
ab 1.1.9i1:
--------------------------------------------------------------------------------
check_mk -X erzwingen. Das -R soll nur noch klappen, wenn kein Configfehler
auftritt.
+--snmpwalk: Braucht man das translaten noch? Ich arbeite doch jetzt eh
+nur noch ohne MIB-Dateien. Das würde das ganze deutlich vereinfachen!
+
filesystem_levels rausnehmen. Hinweis, dass check_parameters verwendet
werden soll.
Module: check_mk
Branch: master
Commit: d97b434e1149382ec7a0307e84f21a7a491e81a9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d97b434e114938…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 21:23:17 2010 +0200
install_nagios.sh: add note to OMD
---
scripts/install_nagios.sh | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/scripts/install_nagios.sh b/scripts/install_nagios.sh
index 7d2bb94..c122e7c 100644
--- a/scripts/install_nagios.sh
+++ b/scripts/install_nagios.sh
@@ -23,6 +23,26 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+cat <<EOF
+
+ NOTE
+ ----------------------------------------------------------
+ This is the last version of this script. There is a better
+ alternative for installing and maintaining Nagios plus
+ Addons now:
+
+ OMD - The Open Monitoring Distribution
+
+ Please visit OMD at http://omdistro.org/
+
+ OMD has been invented and founded by Mathias Kettner and is
+ developed by a team of many well-known monitoring experts.
+ ----------------------------------------------------------
+
+Press enter to continue...
+EOF
+read
+
# Make sure, /usr/local/bin is in the PATH, since we install
Module: check_mk
Branch: master
Commit: b684fe5f1b75e5f2d63fa8bcef5543c3e7e9d82d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b684fe5f1b75e5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 19:27:42 2010 +0200
Updated internal doku
---
LIESMICH.zutun | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index f5527da..4561976 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -1,25 +1,20 @@
--------------------------------------------------------------------------------
-UMLAUTPROBLEME (alle gemeinsam angehen)
---------------------------------------------------------------------------------
-Noch ein Problem mit Umlauten: Ein Drucker sendet per SNMP Latin1
-kodierte Wert, z.B. Resttonerbehälter. Daraus baut Check_MK eine
-Servicedesription, die in nagios/conf.d/check_mk_objects.cfg ein
-Latin1-Zeichen enthält. Hier sollte unbedingt UTF-8 verwendet
-werden. Nur: woher kennen wir die Kodierung vom Drucker??
-
---------------------------------------------------------------------------------
BUGS beheben bis => 1.1.8
--------------------------------------------------------------------------------
CHECK_MK:
-doc/ aufräumen und komplett 1:1 installieren.
-
Clusters mit IP-Adressen: Der Host-Check soll die IP-Adresse verwenden,
wenn sie vorhanden ist.
--------------------------------------------------------------------------------
BUGS beheben ab 1.1.9i1
--------------------------------------------------------------------------------
+Noch ein Problem mit Umlauten: Ein Drucker sendet per SNMP Latin1
+kodierte Wert, z.B. Resttonerbehälter. Daraus baut Check_MK eine
+Servicedesription, die in nagios/conf.d/check_mk_objects.cfg ein
+Latin1-Zeichen enthält. Hier sollte unbedingt UTF-8 verwendet
+werden. Nur: woher kennen wir die Kodierung vom Drucker??
+
Livestatus: bestimmte UTF-8 Zeichen werden nicht korrekt kodiert, z.B. "€".
Um das umzustellen, muss man wahrscheinlich einfach UTF-8 generell
annehmen.
@@ -68,8 +63,6 @@ Logfile schreiben. Wir machen das ohne Rotation. Man muss einfach selbst
aufpassen, dass es nicht zu groß wird. Default ist eh aus. Ins Nagios
geloggt wird nur das Starten und Beenden (was ja im Hauptthread läuft).
-Windows-Agent: Eventlogeinträge nach UTF-8 kodieren.
-
Windows-Agent: Memory-Check neu machen. Swap stimmt nicht. Evtl. zwei
getrennte Checks für Memory and Pagefile.
@@ -141,6 +134,8 @@ es ja fuer binaere Hostlisten das NEGATE (=> Doku). In 1.2 einbauen.
--------------------------------------------------------------------------------
IDEEN & VERBESSERUNGEN
--------------------------------------------------------------------------------
+Windows-Agent: Eventlogeinträge nach UTF-8 kodieren.
+
Multisite: Ein Link vom Detail-Host zum Summary-Host (umgekehrt ist er doch
schon da, oder?)
Module: check_mk
Branch: master
Commit: 08109beb12c45921dbba287b2e66f17aa645a71a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08109beb12c459…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 19:15:55 2010 +0200
ps: inventory with GRAB_USER replaces %u in service desc
---
ChangeLog | 3 +++
LIESMICH.zutun | 4 ----
checkman/ps | 31 +++++++++++++++++--------------
checks/ps | 17 ++++++++++++-----
4 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c2c1892..834a353 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
* logwatch: Fixed typo in 'too many unacknowledged logs' error message
* ps: fix bug: inventory with fixed user name now correctly puts
that user name into the resulting check - not None.
+ * ps: inventory with GRAB_USER: require service description to contain
+ %u. That will be replaced with the user name and thus makes the
+ service description unique.
Livestatus:
* Prohibit { and } in regular expressions. This avoids a segmentation
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 17a17bc..9b25838 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -12,10 +12,6 @@ BUGS beheben bis => 1.1.8
--------------------------------------------------------------------------------
CHECK_MK:
-inventory_processes: Wenn man mit GRAB_USER arbeitet und sich die
-Prozesse nur im Benutzer unterscheiden, dann muss der Benutzer in
-der Servicedescription auftauchen, sonst heissen alle Services gleich.
-
akcp_sensor_temp -> Man-Page ist kaputt
doc/ aufräumen und komplett 1:1 installieren.
diff --git a/checkman/ps b/checkman/ps
index d1a43a1..01fd674 100644
--- a/checkman/ps
+++ b/checkman/ps
@@ -44,17 +44,19 @@ inventory:
are used for the service descriptions. The matched substrings corresponding
to the remaining groups are copied into the regular expression, nevertheless.
- Wildcards not enclosed by brackets are simply copied verbatim to the
- created checks. Please refer to the examples for more details.
-
+ Wildcards not enclosed by brackets are simply copied verbatim to the created
+ checks. Please refer to the examples for more details.
+
The {user specification} can either be a user name (string). The inventory
- will then trigger only if that user matches the user the process
- is running as and the resulting check will require that user.
- Alternatively you can specify {ANY_USER} or {GRAB_USER}.
- If you specify {ANY_USER} then the user field will simply be ignored.
- The created check will not check for a specific user. Specifying {GRAB_USER}
- makes the created check expect the process to run as the same user as
- during inventory: the user name will be hardcoded into the check.
+ will then trigger only if that user matches the user the process is running as
+ and the resulting check will require that user. Alternatively you can specify
+ {ANY_USER} or {GRAB_USER}. If you specify {ANY_USER} then the user field
+ will simply be ignored. The created check will not check for a specific user.
+
+ Specifying {GRAB_USER} makes the created check expect the process to run
+ as the same user as during inventory: the user name will be hardcoded into
+ the check. In that case you need to put {%u} into the service description,
+ which will be replace by the actual user name during inventory.
The {warning and critical levels} are simply copied to the created
checks.
@@ -100,7 +102,7 @@ examples:
# alternative(3): do the same, but make sure, ntpd is always
# running as the user under which we found it first:
- ( "NTPD2", "/usr/sbin/ntpd", GRAB_USER, 1, 1, 1, 1),
+ ( "NTPD2 %u", "/usr/sbin/ntpd", GRAB_USER, 1, 1, 1, 1),
# if we find Apache2, monitor it and make sure it's running
# as the user 'www-data'! Make also sure, that the number
@@ -112,10 +114,11 @@ examples:
# For each NIC there might by one dhclient. We monitor the
# processes separately for each NIC at which we find a dhclient
# running.
- ( "DHCP-Client NIC %s", "~dhclient.* ([a-z]+[0-9]-*)$", GRAB_USER, 1, 1, 1, 1) ,
+ ( "DHCP-Client NIC %s", "~dhclient.* ([a-z]+[0-9]-*)$", ANY_USER, 1, 1, 1, 1) ,
- # SAP: Search for SAP processes, extract three components
- ( "SCS %s/%s/%s", "~(..)\.sap(...)_SCS([0-9]+) pf=", ANY_USER, 1, 1, 1, 1 ),
+ # SAP: Search for SAP processes, extract three components, add the
+ # user name the process was running as to the service description
+ ( "SCS %s/%s/%s %u", "~(..)\.sap(...)_SCS([0-9]+) pf=", GRAB_USER, 1, 1, 1, 1 ),
]
[configuration]
inventory_processes (list): A list of 7-tuples. See {INVENTORY} for details.
diff --git a/checks/ps b/checks/ps
index 7b13972..bb7a163 100644
--- a/checks/ps
+++ b/checks/ps
@@ -77,18 +77,25 @@ def inventory_ps(check_name, info):
raise MKGeneralException("Invalid entry in inventory_processes: service description '%s' contains "
"%d times '%%s', but regular expression '%s' contains only %d subexpression(s)." % \
(servicedesc, num_perc_s, pattern, len(matches)))
- # It is allowed (1.1.4) that the pattern contains more subexpressions then the
- # service description. In that case only the first subexpressions are used as
- # item.
- i_servicedesc = servicedesc % (matches[:num_perc_s])
+
if userspec == GRAB_USER:
i_userspec = l_user[0]
+ if '%u' not in servicedesc:
+ raise MKGeneralException("Invalid entry in inventory_processes: if you use GRAB_USER, you need to put %%u into the service description. Your description is '%s'" % servicedesc)
+ i_servicedesc = servicedesc.replace("%u", l_user[0])
else:
i_userspec = userspec
+ i_servicedesc = servicedesc
+
+ # It is allowed (1.1.4) that the pattern contains more subexpressions then the
+ # service description. In that case only the first subexpressions are used as
+ # item.
+ i_servicedesc = i_servicedesc % (matches[:num_perc_s])
+
# Problem here: We need to instantiate all subexpressions
# with their actual values of the found process.
i_pattern = instantiate_regex_pattern(pattern, matches)
- inv = ( i_servicedesc, "matched by \"%s\"" % pattern, ( i_pattern, i_userspec, warnmin, okmin, okmax, warnmax ) )
+ inv = ( i_servicedesc, ( i_pattern, i_userspec, warnmin, okmin, okmax, warnmax ) )
if inv not in inventory:
inventory.append(inv)
Module: check_mk
Branch: master
Commit: 3d0ea0f9309c836caccef134a2787403b95d06e8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d0ea0f9309c83…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 24 19:03:16 2010 +0200
ps: inventory on fixed user now correctly sets target user
---
ChangeLog | 2 ++
LIESMICH.zutun | 3 ---
checkman/ps | 3 ++-
checks/ps | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d1f8bbb..c2c1892 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@
* hr_fs: inventory now ignores filesystem with size 0,
check does not longer crash on filesystems with size 0
* logwatch: Fixed typo in 'too many unacknowledged logs' error message
+ * ps: fix bug: inventory with fixed user name now correctly puts
+ that user name into the resulting check - not None.
Livestatus:
* Prohibit { and } in regular expressions. This avoids a segmentation
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 1ede43a..17a17bc 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -12,9 +12,6 @@ BUGS beheben bis => 1.1.8
--------------------------------------------------------------------------------
CHECK_MK:
-inventory_processes: wenn man hier einen Benuter fest angibt, dann
-wird der nicht übernommen, sondern None fest kodiert.
-
inventory_processes: Wenn man mit GRAB_USER arbeitet und sich die
Prozesse nur im Benutzer unterscheiden, dann muss der Benutzer in
der Servicedescription auftauchen, sonst heissen alle Services gleich.
diff --git a/checkman/ps b/checkman/ps
index d0af038..d1a43a1 100644
--- a/checkman/ps
+++ b/checkman/ps
@@ -49,7 +49,8 @@ inventory:
The {user specification} can either be a user name (string). The inventory
will then trigger only if that user matches the user the process
- is running as. Alternatively you can specify {ANY_USER} or {GRAB_USER}.
+ is running as and the resulting check will require that user.
+ Alternatively you can specify {ANY_USER} or {GRAB_USER}.
If you specify {ANY_USER} then the user field will simply be ignored.
The created check will not check for a specific user. Specifying {GRAB_USER}
makes the created check expect the process to run as the same user as
diff --git a/checks/ps b/checks/ps
index e900d89..7b13972 100644
--- a/checks/ps
+++ b/checks/ps
@@ -84,7 +84,7 @@ def inventory_ps(check_name, info):
if userspec == GRAB_USER:
i_userspec = l_user[0]
else:
- i_userspec = ANY_USER
+ i_userspec = userspec
# Problem here: We need to instantiate all subexpressions
# with their actual values of the found process.
i_pattern = instantiate_regex_pattern(pattern, matches)