2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # Example output from agent:
29 # $1$DGA1122: TEST_WORK 1171743836 1102431184 0.00
30 # DSA1: SHAD_1 66048000 58815666 0.00
31 # DSA2: SHAD_2 66048000 47101824 0.07
32 # DSA3: SHAD_3 66048000 46137546 1.57
33 # DSA4: SHAD_4 66048000 36087093 0.00
34 # DSA5: SHAD_5 66048000 32449914 0.00
35 # $1$DGA1123: TEST_WORK 2171743836 1102431184 0.00
36 # $1$DGA1124: TEMP_02 3171743836 102431184 1.10
37 # $1$DGA1125: DATA_01 1171743836 202431184 0.20
40 def inventory_vms_diskstat_fs(info
):
41 return df_inventory([line
[1] for line
in info
])
44 def check_vms_diskstat_fs(item
, params
, info
):
47 _device
, _label
, size
, used
, _ios
= line
48 size_mb
= int(size
) * 512 / (1024.0 * 1024.0)
49 avail_mb
= int(used
) * 512 / (1024.0 * 1024.0)
50 return df_check_filesystem_single(item
, size_mb
, avail_mb
, 0, None, None, params
)
52 return (3, "no such disk")
55 check_info
['vms_diskstat.df'] = {
56 "check_function": check_vms_diskstat_fs
,
57 "inventory_function": inventory_vms_diskstat_fs
,
58 "service_description": "Filesystem %s",
60 "group": "filesystem",
61 "includes": ["size_trend.include", "df.include"],
62 "default_levels_variable": "filesystem_default_levels",