This file is indexed.

/usr/share/check_mk/checks-man/df 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
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
title: Used space in filesystems
agents: linux, windows, aix, solaris, openvms, hpux, freebsd, netbsd, openbsd, macosx
catalog: os/storage
license: GPL
distribution: check_mk
description:
 This check measures the usage of filesystems. The usage
 is checked against a warning and a critical level, which
 can be specified in numerous ways.

 Beware: on Linux and UNIX systems the filesystem might reserve a certain
 amount for root (typical is 5%). This checks considers that reserved space
 as used. This is consistent with the percentage-column in the output of {df}
 on most distributions.  So your filesystem might be at 100% in a situation
 where root still has 5% free space available. On some distributions, {df}
 seems to use the user allocatable space instead of the total filesystem size
 as base for the percentage calculation, this might result in differences
 between the percentage values shown by that {df} version and the value
 shown in Check_MK. From our point of view, the calculation of Check_MK is
 more accurate.

 {Trends:} This checks supports filesystem {trends}. This means that the {df} check
 is able to compute the {change} of the used space over the time and can
 make a forecast into the future. It can estimate the time when
 the filesystem will be full.

 In the default configuration the check will compute the trend based on the
 data of the last 24 hours using a logarithmic average that gives more recent
 data a higher weight. Also data beyond the 24 hours will to some small degree be
 reflected in the computation. The advantage of this algorithm is a more
 precise prediction and a simpler implementation, which does not need any
 access to any RRDs or similar storage.

 Please note that when a filesystem is started to be monitored,
 the trend of the past is unknown and is assumed to be {zero}.
 It will take at least one trend range of time until the trend
 approximately reflects the reality.

 {Grouping:} In some situations you do not want to monitor a single
 filesystem but a group of filesystems forming a pool.
 Only the total usage of the pool is of interest. The {df} check supports pools
 by defining groups. For each group you specify a name and a list
 of globbing patterns (path patterns containing {*} and {?}). The name
 is being used as the check item. All filesystems that match one of
 the patterns are part of the pool.

 When using inventory you specify the groups with the ruleset
 {filesystem_groups}. When configuring manual checks, you specify
 the list of patterns in the check parameter {"patterns"}.

item:
 The mount point of the filesystem (UNIX) or the drive
 letter in upper case followed by a colon (Windows). For groups
 the item is the name of the group.

examples:
 # Set default levels for all filesystems to 90/95 (simple way)
 filesystem_default_levels = (90.0, 95.0)

 # alternative: Set default levels via new dictionary method:
 filesystem_default_levels = {
    "levels"         : (80.0, 90.0),  # levels in percent
    "magic"          : 0.8,       # magic factor
    "magic_normsize" : 20,        # normsize in GB
    "levels_low"     : (50.0, 60.0),  # magic never lowers levels below this (percent)
    "trend_range"    : 48,        # hours
    "trend_mb"       : (10, 20),  # MB of change during trend_range
    "trend_perc"     : (1, 2),    # Percent change during trend_range
    "trend_timeleft" : (72, 48),  # run time left in hours until full
    "trend_perfdata" : False      # no performance data for trends
 }

 # alternative[2]: Just change the default partially
 filesystem_default_levels["magic"] = 0.8

 # Disable trend performance data (beware of exsting RRDs)
 filesystem_default_levels["trend_perfdata"] = False

 # Override warning/critical levels for all checks where
 # levels are "filesystem_default_levels"
 check_parameters = [
    # Hosts with tag "vms" get 85/95
    ( (85.0, 95.0), ["vms"], ALL_HOSTS, [ "fs_" ] ),
    # all /sapdata partitions will never be critical
    ( (101.0, 101.0), ALL_HOSTS, [ "fs_/sapdata$" ] ),
    # Partitions below "/var" get 80/90 with magic factor 0.5
    ( (80.0, 90.0, 0.5), ALL_HOSTS, [ "fs_/var" ] ),
    # /usr and /opt on hosts zlnx01 and zlnx02
    ( (98.0, 99.0), [ "zlnx01", "zlnx02" ], [ "fs_/usr$", "fs_/opt$" ] ),
    # All filesystems on clusters get 80/95
    ( (80.0, 95.0), CLUSTERS_HOSTS, [ "fs_" ] ),
    # Complex parameters in dictionary form
    ( {"levels":(80.0,90.0), "trend_range":48, "trend_mb":(20,40)},
      [ "windows" ], ALL_HOSTS, [ "fs_" ]),
 ]

 # Exclude temporary backup from inventory
 inventory_df_exclude_mountpoints = [ "/mnt/backup" ]

 # Exclude certain filesystems from being inventorized at all
 inventory_df_exclude_fs = [ "iso9660", "romfs" ]

 # Define filesystem groups that should be monitored like
 # one big filesystem
 filesystem_groups = [
   # The group Proxypool contains filesystems beginning with /var/cache
   ( [ ('Proxypool', '/var/cache/*') ],                [], ALL_HOSTS),

   # The group GOA/MUMU contains all filesystems beginning with either
   # /goa or /mumu
   ( [ ('GOA/MUMU', '/goa*'), ('GOA/MUMU', '/mumu*')], [], ALL_HOSTS),

   # The group SAP contains filesystems containing SAP or sap, but only
   # on hosts with the tags "sap" and "linux":
   ( [('SAP', '*SAP*'), ('SAP', '*sap*')], [ 'sap', 'linux' ], ALL_HOSTS),
 ]



perfdata:
 One or three values: The first value is the used space of the filesystem
 in MB. Also the minimum (0 MB), maximum (size of the filesystem) and the warning and critical
 levels in MB are provided. If you set the parameter {"trend_perfdata" : True}, then
 two additional values are output: the change of the usage in MB per range
 since the last check (e.g. in MB per 24 hours) and the averaged change (so called trend),
 also in MB per range. Please note, that as of version 1.1.11i3, performance data for
 trends is enabled per default. You can globally disable that in {main.mk}
 with {filesystem_default_levels["trend_perfdata"] = False}.

 Please note that - until you use the storage type {MULTIPLE} in PNP4Nagios -
 changing the parameter {"trend_perfdata"} will stop all updates to
 your existing filesystem RRDs. You need either to delete or convert your RRDs
 if you want to change.

inventory:
 df supports inventory. All filesystem the agent reports
 will be inventorized except mount points listed in
 {inventory_df_exclude_mountpoints} and filesystem types
 listed in {inventory_df_exclude_fs}. The Windows agent
 only reports fixed disks. The Linux agent reports filesystems
 that have a size and are not of type smbfs, tmpfs, cifs or nfs.

 When {filesystem_groups} is defined and a found filesystem
 is matching one of the patterns of a group, then instead of a
 service of the single filesystem a check for the group is being
 created. The check item is the name of that group in that
 case.

[parameters]
parameters (dict): This check supports two types of parameters. The
 new version supports trends and is a dictionary with the following
 keys:

 {"levels"}: Warning and critical level of filesystem usage. You need to
 supply two numbers. Depending of the type of number you can choose
 different kinds of levels as follows: Positive integers denote the
 amount of used space in megabytes. Positive floating point numbers
 denote the amount of used space in percent. Negative numbers impose
 limits on the amount of space available, again with the possibility
 to specify integers or floats to denote values in megabytes of precent.
 The default is {(80.0, 90.0)}, meaning 80% and 90%.

 {"inodes_levels"}: Warning and critical level for the remaining inodes
 on the filesystem. Depending of the number type you can choose
 different kinds of levels as follows: Integers denote the amount
 of available inodes. Floating point numbers denote the amount of
 available inodes in percent.

 {"magic"}: The magic number, which scales the levels according to the
 filesystem size. Default
 is a factor of 1.0, which does no adaptation. A factor less than 1.0 raises
 the levels for large filesystems and lowers them for small ones. Please
 have a look at the online documentation for more details about the magic factor.

 {"magic_normsize"}: Norm size of a filesystem for the magic computation.
 The default for this is {20}. It is measured in GB.

 {"levels_low"}: When applying the magic factor the warn/crit levels
 will never drop below these numbers. The default is preset to
 {(50.0,60.0)} meaning 50% and 60%.

 {"trend_range"}: The time range over that trends are computed. This
 is in hours and preset to {24} (i.e. one day). If you set this to
 {None} then trend computing is disabled and the check outputs only
 one performance data value.

 {"trend_mb"}: A pair of numbers specifying the maximum number of
 megabytes the usage is allowed to grow within the time range if not
 triggering warning/critical. If you set this to {(10,20)} then
 the check will warn if the size grows by more than 10 MB per {trend_range}
 hours and critical if it grows more than 20 MB. Per default no levels
 are applied.

 {"trend_perc"}: This is similar to trend_mb but here you specify
 the allowed growth in percentages of the filesystem size. Fractional
 values are allowed. This may be used in parallel with trend_mb.

 {"trend_timeleft"}: A pair of numbers that specifies the minimum
 hours of time left until the filesystem gets full. If you set this
 to {(48,24)} then the check will warn if the estimated time until
 the disk is full is 48 hours or less. It will get critical if only
 24 hours are assumed to be left.

 {"trend_perfdata"}: If this is set to {True}, then the check will
 output two further performance data values: the current growth
 and the trend.

 {"patterns"}: If this is contained in the dictionary then it
 must be a list of path patterns (using * and ?).  Instead of a
 single filesystem all filesystems matching one of the patterns
 are taken into consideration and their sizes and usages are
 summed up.

 It is still possible to specify a pair or triple of numbers
 {instead} of a dictionary:

warning (int or float): The amount of used space that triggers
 WARNING state
critical (int or float): The amount of used space that triggers
 CRITICAL space
magic_factor (float): Optional: Magic factor that adapts the levels
 according to the size of the filesystem. Default
 is a factor of 1.0, which does no adaptation. A factor
 less than 1.0 raises the levels for large filesystems
 and lowers them for small ones. Please look at online
 documentation for more details about the magic factor.

[configuration]
inventory_df_exclude_fs (list of strings): Lists of filesystem types to exclude from inventory
inventory_df_exclude_mountpoints (list of strings): List of mount points to exclude from inventory
filesystem_default_levels: Default levels for filesystem detected by inventory.
 This variable is preset to {{ "levels" : (80.0, 90.0), "magic_normsize"  : 20,
 "levels_low" : (50.0, 60.0), "trend_range" : 24 }}
filesystem_groups (ruleset): A ruleset for defining filesystem groups. The value of each
 rule is a pair of (groupname, patterns), where patterns is a list of strings (path
 patterns). During inventory filesystems that match one of the patterns are handled
 as member of the group.