Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / df_netscaler
blob04bf248e059244c7d8b5f1707aa61f4c364a8371
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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:
28 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.1.4.47.118.97.114 "/var"
29 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.1.6.47.102.108.97.115.104 "/flash"
30 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.2.4.47.118.97.114 96133
31 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.2.6.47.102.108.97.115.104 7976
32 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.3.4.47.118.97.114 87418
33 # .1.3.6.1.4.1.5951.4.1.1.41.8.1.3.6.47.102.108.97.115.104 7256
36 def inventory_df_netscaler(info):
37 mplist = []
38 for mp, size_mb, _avail_mb in info:
39 if int(size_mb) > 0 and mp not in inventory_df_exclude_mountpoints:
40 mplist.append(mp)
41 return df_inventory(mplist)
44 def check_df_netscaler(item, params, info):
45 fslist = []
46 for mp, size_mb, avail_mb in info:
47 if "patterns" in params or item == mp:
48 fslist.append((mp, int(size_mb), int(avail_mb), 0))
49 return df_check_filesystem_list(item, params, fslist)
52 check_info["df_netscaler"] = {
53 "check_function": check_df_netscaler,
54 "inventory_function": inventory_df_netscaler,
55 "default_levels_variable": "filesystem_default_levels",
56 "service_description": "Filesystem %s",
57 "has_perfdata": True,
58 "group": "filesystem",
59 "includes": ["size_trend.include", "df.include"],
60 "snmp_info": (
61 ".1.3.6.1.4.1.5951.4.1.1.41.8.1",
63 1, # sysHealthDiskName
64 2, # sysHealthDiskSize
65 3, # sysHealthDiskAvail
66 ]),
67 "snmp_scan_function": lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),