Module: check_mk
Branch: master
Commit: 2a992e1dd5b7fa84e35cd14e571271602043a78c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a992e1dd5b7fa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 28 20:29:42 2010 +0200
ps inventory: make %u optional on GRAB_USER
---
ChangeLog | 2 +-
LIESMICH.zutun | 3 +++
checkman/ps | 6 ++++--
checks/ps | 2 --
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b2d9a24..703bab6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,7 +12,7 @@
* 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
+ * ps: inventory with GRAB_USER: service description may contain
%u. That will be replaced with the user name and thus makes the
service description unique.
* win_dhcp_pools: better handle invalid agent output
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 3c11e35..cf4dadb 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -12,6 +12,9 @@ konsisten mit den übrigen werden sein.
--------------------------------------------------------------------------------
BUGS beheben ab 1.1.9i1
--------------------------------------------------------------------------------
+Wenn zwei Checks mit dem gleichen Namen existieren bei einem Host
+soll mit einem Fehler abgebrochen werden.
+
win_dhcp_pools sendet:
[['MIBCounts:'],
['Discovers', '=', '193.'],
diff --git a/checkman/ps b/checkman/ps
index 01fd674..8a28fee 100644
--- a/checkman/ps
+++ b/checkman/ps
@@ -55,8 +55,10 @@ inventory:
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 check. In that case if you put {%u} into the service description,
+ that will be replaced by the actual user name during inventory. You need
+ that if your rule might match for more than one user - your would create
+ duplicate services with the same description otherwise.
The {warning and critical levels} are simply copied to the created
checks.
diff --git a/checks/ps b/checks/ps
index bb7a163..946e2bf 100644
--- a/checks/ps
+++ b/checks/ps
@@ -80,8 +80,6 @@ def inventory_ps(check_name, info):
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