Module: check_mk
Branch: master
Commit: 96688c23fd9bb98ba266ffc2035abec2c6dddee4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96688c23fd9bb9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 13 10:48:08 2011 +0100
Added man-page for fileinfo
---
checkman/fileinfo | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/checkman/fileinfo b/checkman/fileinfo
new file mode 100644
index 0000000..c056c79
--- /dev/null
+++ b/checkman/fileinfo
@@ -0,0 +1,83 @@
+title: Check age and size of files
+agents: windows
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the size and age of specific files
+ in the target host's filesystem.
+ You can set lower and upper
+ limits on both the modification time and the size of
+ a file. When the file is missing then the check will go
+ {UNKNOWN}.
+
+ This check needs some configuration in the agent,
+ as the agent needs to know the information about
+ which files need to be sent.
+
+ Currently only the Windows agent supports this type
+ of check. Configuration is done in {check_mk.ini} in
+ the section {[fileinfo]}. Put one or more entries
+ of the format {path = C:\Some Dir\*.log} into this
+ section. The agent will send all files that match
+ the pattern. Wildcards are only allowed in the
+ filename part, not in the directory path.
+
+item:
+ The complete path name of the file as sent by
+ the agent (this is case sensitive even when monitoring
+ Windows).
+
+ Please note: when referring to the item in
+ {check_parameters}, make sure that backslashes
+ (contained in Windows paths) are properly
+ quoted. You need one escape level for the Python
+ string and one for the regular expression.
+ If you prefix the Python string with a {r}, then
+ just the regular expression needs its double
+ backslash (see examples). Without the {r} you
+ would need four backslashes in a row in order to
+ denote one backslash in the file's path.
+
+examples:
+ check_parameters += [
+ # Alert if backup files are too small
+ ( { "minsize" : (5000000, 10000000) },
+ ALL_HOSTS, [ r"File D:\\Backup\\.*.zip" ] ),
+
+ # Alert if snapshot file are too old
+ ( { "maxage" : (120, 180) },
+ ALL_HOSTS, [ "File.*snapshot" ] ),
+ ]
+
+perfdata:
+ Two values: the size of the file in bytes and the age
+ of the file in seconds (the time since the last
+ modification of the file).
+
+inventory:
+ For each file that the agent sends one service will
+ be created.
+
+[parameters]
+parameters (dict): This check uses dictionary based
+ parameters. Per default no parameters are set and
+ the check is always OK (unless the file is missing).
+
+
+ {"minage"}: A pair of integers for the warning and
+ critical level of the minimum file age in seconds.
+ A missing key or {None} disables the minimum age
+ checking. The borders itself always belong to the
+ better state, so {(60, 120)} will make the check
+ OK as long as the age of the file is not exceeding
+ 60 seconds and warning if the age is 120 seconds
+ or less.
+
+ {"maxage"}: Pair of integers for the maximum file
+ age in seconds.
+
+ {"minsize"}: The minimum size of the file in bytes (pair of
+ integers).
+
+ {"maxsize"}: The maximum size.