Module: check_mk
Branch: master
Commit: b6e78726694f0ebd2b087c520d01d514fc4d049e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6e78726694f0e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 27 14:46:00 2014 +0100
#1193 ps: Manual Checks can now use RegEx for user matching
If you start the username with a tilde, the string will be interpreted as RegEx.
When using Wato just choice RegEx in the Dropdown.
---
.werks/1193 | 11 +++++++++++
ChangeLog | 1 +
checks/ps.include | 6 +++++-
web/plugins/wato/check_parameters.py | 26 +++++++++++++++++++++++---
4 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/.werks/1193 b/.werks/1193
new file mode 100644
index 0000000..1db3401
--- /dev/null
+++ b/.werks/1193
@@ -0,0 +1,11 @@
+Title: ps: Manual Checks can now use RegEx for user matching
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414417457
+Class: feature
+
+If you start the username with a tilde, the string will be interpreted as RegEx.
+When using Wato just choice RegEx in the Dropdown.
+
diff --git a/ChangeLog b/ChangeLog
index 82f1df8..ff01a77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 1190 statgrab_cpu: Check can now handle parameters
* 1191 Linux agent now also sends information about tmpfs...
* 1424 mknotifyd: now able to check if its still listening for telegrams...
+ * 1193 ps: Manual Checks can now use RegEx for user matching...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checks/ps.include b/checks/ps.include
index 22e5336..6b12e90 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -165,7 +165,11 @@ def process_matches(ps, procname, l_user):
if ps[0].startswith("(") and ps[0].endswith(")") and len(ps) > 1:
addinfo = ps[0][1:-1].split(",")
user = addinfo[0]
- if userspec and userspec != user:
+ if userspec and userspec.startswith('~'):
+ if not re.match(userspec[1:], user):
+ return False
+
+ elif userspec and userspec != user:
return False
l_user[0] = user # return actual user that way
ps = ps[1:]
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 6cc3199..800c8aa 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6034,10 +6034,30 @@ register_check_parameters(
title = _("Maximum number of matched process for WARNING state"),
default_value = 1,
)),
- ( "user", TextAscii(
+ ( "user", Alternative(
title = _("Name of operating system user"),
- help = _("Leave this empty, if the user does not matter"),
- none_is_empty = True,
+ style = "dropdown",
+ elements = [
+ TextAscii(
+ title = _("Exact name of the oeprating system user")
+ ),
+ Transform(
+ RegExp(size = 50),
+ title = _("Regular expression matching username"),
+ help = _("This regex must match the <i>beginning</i> of the complete "
+ "username"),
+ forth = lambda x: x[1:], # remove ~
+ back = lambda x: "~" + x, # prefix ~
+ ),
+ FixedValue(
+ None,
+ totext = "",
+ title = _("Match all users"),
+ )
+
+ ],
+ match = lambda x: (not x and 2) or (x[0] == '~' and 1 or 0)
+
)),
( "cpulevels",
Tuple(
Module: check_mk
Branch: master
Commit: f85e0d90366cb5a3d27f7f860b5ed81c1c538b97
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f85e0d90366cb5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Oct 27 13:48:29 2014 +0100
#1424 mknotifyd: now able to check if its still listening for telegrams
The mknotifyd server is now able to handle heartbeat telegrams.<br>
Just send an empty pickled python object to the server, like "N." (a pickled None)<br>
The mknotifyd will answer with an "OK".<br>
You can monitor this behaviour with the active check "Check connecting to a TCP port".
---
.werks/1424 | 12 ++++++++++++
ChangeLog | 1 +
doc/treasures/mknotifyd | 9 +++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/.werks/1424 b/.werks/1424
new file mode 100644
index 0000000..210763e
--- /dev/null
+++ b/.werks/1424
@@ -0,0 +1,12 @@
+Title: mknotifyd: now able to check if its still listening for telegrams
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414413785
+Class: feature
+
+The mknotifyd server is now able to handle heartbeat telegrams.<br>
+Just send an empty pickled python object to the server, like "N." (a pickled None)<br>
+The mknotifyd will answer with an "OK".<br>
+You can monitor this behaviour with the active check "Check connecting to a TCP port".
diff --git a/ChangeLog b/ChangeLog
index 29f7ac0..82f1df8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,6 +79,7 @@
* 1447 domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
* 1190 statgrab_cpu: Check can now handle parameters
* 1191 Linux agent now also sends information about tmpfs...
+ * 1424 mknotifyd: now able to check if its still listening for telegrams...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/doc/treasures/mknotifyd b/doc/treasures/mknotifyd
index 0a793d8..488af11 100755
--- a/doc/treasures/mknotifyd
+++ b/doc/treasures/mknotifyd
@@ -260,10 +260,11 @@ class TcpServer:
try:
content = pickle.loads(client_data)
- if not os.path.exists(g_spool_dir):
- os.makedirs(g_spool_dir)
- spoolfile = "%s/%s" % (g_spool_dir, uuid.uuid1())
- file(spoolfile,"w").write(pprint.pformat(content))
+ if content:
+ if not os.path.exists(g_spool_dir):
+ os.makedirs(g_spool_dir)
+ spoolfile = "%s/%s" % (g_spool_dir, uuid.uuid1())
+ file(spoolfile,"w").write(pprint.pformat(content))
verbose("client data processed - sending OK", 2)
client_socket.send("OK")
Module: check_mk
Branch: master
Commit: 6ff29d0bed06c8894e8742440b15ee3e36238892
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6ff29d0bed06c8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 27 12:12:03 2014 +0100
Allow --profile in combination with --keepalive
---
modules/check_mk.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index ba2c2b4..1781abc 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5560,6 +5560,10 @@ def do_check_keepalive():
(3, len(total_check_output), total_check_output))
keepalive_check_memory(num_checks, keepalive_fd)
+ # In case of profiling do just this one cycle and end afterwards
+ if g_profile:
+ output_profile()
+ sys.exit(0)
# Just one lines from stdin. But: make sure that
Module: check_mk
Branch: master
Commit: 4b1c022f9a3ca18f06cf3688c8a6485b0db67d56
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b1c022f9a3ca1…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 27 11:05:59 2014 +0100
corrected werk
---
.werks/1191 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/1191 b/.werks/1191
index 933642c..52e6ff0 100644
--- a/.werks/1191
+++ b/.werks/1191
@@ -8,5 +8,5 @@ Class: feature
By default, the behavior of the df check is to ignore this filesystems.
If you want to see the temp filsystems you have to overwrite the inventory_df_exclude_fs variable in main.mk in the
-following way: inventory_df_exclude_fs = [ 'tmpfs', 'nfs', 'smbfs', 'cifs', 'iso9660' ]
+following way: inventory_df_exclude_fs = [ 'nfs', 'smbfs', 'cifs', 'iso9660' ]
Module: check_mk
Branch: master
Commit: a4daaaa448f05b8f7b56c13310e24ba67599015d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4daaaa448f05b…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 27 11:05:30 2014 +0100
#1191 Linux agent now also sends information about tmpfs
By default, the behavior of the df check is to ignore this filesystems.
If you want to see the temp filsystems you have to overwrite the inventory_df_exclude_fs variable in main.mk in the
following way: inventory_df_exclude_fs = [ 'tmpfs', 'nfs', 'smbfs', 'cifs', 'iso9660' ]
---
.werks/1191 | 12 ++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 2 +-
checks/df.include | 2 +-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/1191 b/.werks/1191
new file mode 100644
index 0000000..933642c
--- /dev/null
+++ b/.werks/1191
@@ -0,0 +1,12 @@
+Title: Linux agent now also sends information about tmpfs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414403947
+Class: feature
+
+By default, the behavior of the df check is to ignore this filesystems.
+If you want to see the temp filsystems you have to overwrite the inventory_df_exclude_fs variable in main.mk in the
+following way: inventory_df_exclude_fs = [ 'tmpfs', 'nfs', 'smbfs', 'cifs', 'iso9660' ]
+
diff --git a/ChangeLog b/ChangeLog
index 5fa1a7d..611298f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -78,6 +78,7 @@
* 0664 domino_users: new check to monitor the number of users on a Domino Notes server
* 1447 domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
* 1190 statgrab_cpu: Check can now handle parameters
+ * 1191 Linux agent now also sends information about tmpfs...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index be11b02..bc1c7df 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -128,7 +128,7 @@ fi
echo '<<<df>>>'
# The exclusion list is getting a bit of a problem. -l should hide any remote FS but seems
# to be all but working.
-excludefs="-x smbfs -x tmpfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs"
+excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs"
df -PTlk $excludefs | sed 1d
# df inodes information
diff --git a/checks/df.include b/checks/df.include
index fe9eebf..2094985 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -31,7 +31,7 @@ filesystem_levels = [] # obsolete. Just here to check config and warn if
filesystem_default_levels = {} # can also be dropped some day in future
# Filesystems to ignore (shouldn't be sent by agent anyway)
-inventory_df_exclude_fs = [ 'nfs', 'smbfs', 'cifs', 'iso9660' ]
+inventory_df_exclude_fs = [ 'tmpfs', 'nfs', 'smbfs', 'cifs', 'iso9660' ]
inventory_df_exclude_mountpoints = [ '/dev' ]
# Grouping of filesystems into groups that are monitored as one entity