Module: check_mk
Branch: master
Commit: 98b2ea52436f2ad7cad71463b9fbfb7475dd8f4c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98b2ea52436f2a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 27 09:51:32 2016 +0200
3612 nfsmounts: now has performance data
---
.werks/3612 | 9 +++++++++
ChangeLog | 1 +
checks/network_fs.include | 35 ++++++++++++++++++++---------------
checks/nfsexports | 19 +++++++++++--------
checks/nfsmounts | 13 +++++++------
5 files changed, 48 insertions(+), 29 deletions(-)
diff --git a/.werks/3612 b/.werks/3612
new file mode 100644
index 0000000..750a21e
--- /dev/null
+++ b/.werks/3612
@@ -0,0 +1,9 @@
+Title: nfsmounts: now has performance data
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1464335441
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4f71cbf..fe219ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@
* 3137 linux and solaris agent: mrpe checks now support option to append the cache age to cached results...
* 3610 mk_oracle: linux plugin now available for solaris
* 3611 websphere_mq_queues: now age of messages not processed is configurable...
+ * 3612 nfsmounts: now has performance data
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/network_fs.include b/checks/network_fs.include
index c25f2f4..0dde3c1 100644
--- a/checks/network_fs.include
+++ b/checks/network_fs.include
@@ -24,45 +24,50 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# Example out from agent:
+
# <<<...mounts>>>
# /foobar hanging 0 0 0 0
# /with spaces ok 217492 123563 112515 524288
+
def inventory_network_fs_mounts(info):
return [ (" ".join(line[:-5]), None) for line in info ]
+
def check_network_fs_mounts(item, _no_params, info):
for line in info:
mountpoint = " ".join(line[:-5])
if mountpoint == item:
# On some operating systems there is no information about
- # used and free space, but just dahshes (e.g. AIX)
+ # used and free space, but just dashes (e.g. AIX)
if line[-4] == '-':
if line[-5] == 'ok':
return 0, "mount seems OK"
else:
return 2, "Server not responding"
-
size_blocks = int(line[-4])
free_blocks = int(line[-2]) # for non-root user
- blocksize = int(line[-1])
+ blocksize = int(line[-1])
if size_blocks <= 0 or free_blocks < 0 or blocksize > 1024*1024:
- return (2, "Stale fs handle")
+ return 2, "Stale fs handle"
+
+ size_bytes = size_blocks * blocksize
+ free_bytes = free_blocks * blocksize
+ used_bytes = size_bytes - free_bytes
+ used_perc = 100.0 * used_bytes / size_bytes
+ perfdata = [("fs_size", size_bytes), ("fs_used", used_bytes)]
if line[-5] == 'ok':
- gb = 1024 * 1024 * 1024.0
- size_gb = (size_blocks * blocksize) / gb
- if size_gb == 0:
- return (0, "server is responding")
+ if size_bytes == 0:
+ return 0, "server is responding", perfdata
+
+ return 0, "%.1f%% used (%s of %s)" % \
+ (used_perc, get_bytes_human_readable(used_bytes),
+ get_bytes_human_readable(size_bytes)), perfdata
- free_gb = (free_blocks * blocksize) / gb
- used_gb = size_gb - free_gb
- used_perc = 100.0 * used_gb / size_gb
- return (0, "%.1f%% used (%.1f of %.1f GB)" % (used_perc, used_gb, size_gb))
else:
- return (2, "server not responding")
- return (3, "not mounted")
+ return 2, "server not responding", perfdata
+ return 3, "not mounted"
diff --git a/checks/nfsexports b/checks/nfsexports
index 8203c35..4ac1874 100644
--- a/checks/nfsexports
+++ b/checks/nfsexports
@@ -24,12 +24,14 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
# This check verifies a given NFS export is registered with mountd.
# Optionally we can add tracking of allowed clients and filesystem ID.
# Agent info
# [['/mirrored/data/recording', '172.0.0.0/255.0.0.0']]
+
def inventory_nfsexports(checkname, info):
# reminder to self: inventorize the exported fs, and maybe even the fs id.
# but do not inventorize the allowed clients unless i'm really sure that
@@ -48,17 +50,18 @@ def check_nfsexports(item, _no_params, info):
# if the agent returned an empty list then it found entries in /etc/exports
# but apparently no daemons were running.
if len(info) == 0:
- return (2, "exports defined but no exports found in export list. Daemons might not be working")
+ return 2, "exports defined but no exports found in export list. Daemons might not be working"
# otherwise lets see if our export exists.
for line in info:
- exported_path = line[0]
- if exported_path == item:
- return (0, "export is active")
- return (2, "export not found in export list")
+ if item == line[0]:
+ return 0, "export is active"
+
+ return 2, "export not found in export list"
+
check_info["nfsexports"] = {
- 'check_function': check_nfsexports,
- 'inventory_function': inventory_nfsexports,
- 'service_description': 'NFS export %s',
+ 'check_function' : check_nfsexports,
+ 'inventory_function' : inventory_nfsexports,
+ 'service_description' : 'NFS export %s',
}
diff --git a/checks/nfsmounts b/checks/nfsmounts
index 7ed4f64..a9cc3eb 100644
--- a/checks/nfsmounts
+++ b/checks/nfsmounts
@@ -24,16 +24,17 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# Example out from agent:
+
# <<<nfsmounts>>>
# /foobar hanging 0 0 0 0
# /with spaces ok 217492 123563 112515 524288
check_info["nfsmounts"] = {
- 'check_function': check_network_fs_mounts,
- 'inventory_function': inventory_network_fs_mounts,
- 'service_description': 'NFS mount %s',
- 'group': 'network_fs',
- 'includes': [ 'network_fs.include' ],
+ 'check_function' : check_network_fs_mounts,
+ 'inventory_function' : inventory_network_fs_mounts,
+ 'service_description' : 'NFS mount %s',
+ 'has_perfdata' : True,
+ 'group' : 'network_fs',
+ 'includes' : [ 'network_fs.include' ],
}
Module: check_mk
Branch: master
Commit: 47c0c9171dd2c6551e2d6bd105d9705ca713311b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=47c0c9171dd2c6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed May 25 14:47:43 2016 +0200
3611 websphere_mq_queues: now age of messages not processed is configurable
To make this check work you have to install the <tt>websphere_mq</tt> plugin.
---
.werks/3611 | 9 ++
ChangeLog | 1 +
agents/plugins/websphere_mq | 187 ++++++++++++++++++++--------------
checks/websphere_mq_channels | 25 +++--
checks/websphere_mq_queues | 160 +++++++++++++++++++++--------
web/plugins/wato/check_parameters.py | 55 +++++++---
6 files changed, 293 insertions(+), 144 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=47c0c9171d…