2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2013 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.
28 # SYS5.OMVS.ALF0.HFS 720 92 504 16% /ALF0
29 # HFS, Read/Write, Device:2, ACLS=Y
30 # Filetag : T=off codeset=0
32 # SYS5.OMVS.SYSPLEX.ROOT 720 224 372 38% /
33 # HFS, Read Only, Device:1, ACLS=Y
34 # Filetag : T=off codeset=0
45 def parse_df_zos(info
):
52 if line
[0].startswith('#####'):
53 # Add item for filesystem
54 if fs
and usage
and options
:
55 parsed
.setdefault(fs
, {})
56 parsed
[fs
].setdefault('size', usage
)
57 parsed
[fs
].setdefault('options', options
)
62 elif line
[0].startswith('Filesystem'):
67 # First line: filesystem with usage information
71 # Second line: filesystem options
73 options
.append(option
.replace(',', ''))
74 if 'Read' in options
and 'Only' in options
:
75 options
.remove('Read')
76 options
.remove('Only')
77 options
.append('ReadOnly')
81 df_zos_exclude_list
= ['AUTOMNT', 'TFS', 'NFS']
84 def inventory_df_zos(parsed
):
87 for item
in parsed
.keys():
91 # Check filesystem options
92 for option
in parsed
[item
]['options']:
93 # Check if filesystem is rw
94 if option
== 'Read/Write':
97 # Check if filesystem is excluded
98 if option
in df_zos_exclude_list
:
101 if fs_rw
and not fs_ex
:
103 return df_inventory(mplist
)
106 def check_df_zos(item
, params
, parsed
):
109 for filesystem
in parsed
.keys():
110 (size_mb
, used_mb
, avail_mb
) = map(float, parsed
[filesystem
]['size'][0:3])
114 fslist
.append((filesystem
, size_mb
, avail_mb
, 0))
116 return df_check_filesystem_list(item
, params
, fslist
)
119 check_info
['df_zos'] = {
120 'parse_function': parse_df_zos
,
121 'check_function': check_df_zos
,
122 'inventory_function': inventory_df_zos
,
123 'service_description': "Filesystem %s",
124 'has_perfdata': True,
125 'group': 'filesystem',
126 'default_levels_variable': "filesystem_default_levels",
127 'includes': ['size_trend.include', 'df.include'],