/usr/share/check_mk/checks-man/fileinfo is in check-mk-server 1.2.6p12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | title: Age and size of files
agents: windows, linux, freebsd, macosx, solaris
catalog: os/files
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 Windows, Linux, FREEBSD, MACOSX and Solaris
agents supports this type of check.
For windows, the 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.
For Linux, FREEBSD, MACOSX and Solaris the configuration
is done via {fileinfo.cfg} located in the {$MK_CONFDIR}
(usually {/etc/check_mk/fileinfo.cfg}). To add files to
the check, simply add one path pattern {/tmp/*.log} per line.
Wildcards or patterns can be used as usual on the console.
item:
The complete path name of the file is 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, [ "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 OK, if the file is not missing or if
the file is missing it is UNKNOWN.
{"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.
|