Refactoring: Changed all check parameters starting with an 'o' to the new rulespec...
[check_mk.git] / checks / f5_bigip_cluster_v11
blob1f325d04e483351a6c6f3fd9552b3911ff213962
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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.
27 # Agent / MIB output
28 # see: .1.3.6.1.4.1.3375.2.1.14.1.1.0
29 # .1.3.6.1.4.1.3375.2.1.14.1.2.0
30 # F5-BIGIP-SYSTEM-MIB::sysCmSyncStatusId
31 # F5-BIGIP-SYSTEM-MIB::sysCmSyncStatusStatus
33 # F5 nodes need to be ntp synced otherwise status reports might be wrong.
35 factory_settings["f5_bigip_cluster_v11"] = {
36 '0': 3,
37 '1': 0,
38 '2': 1,
39 '3': 0,
40 '4': 2,
41 '5': 2,
42 '6': 2,
43 '7': 1,
44 '8': 2,
45 '9': 2,
49 def inventory_f5_bigip_cluster_v11(info):
50 if len(info) == 1:
51 return [(None, {})]
54 def check_f5_bigip_cluster_v11(_no_item, params, info):
56 status_names = {
57 '0': "Unknown",
58 '1': "Syncing",
59 '2': "Need Manual Sync",
60 '3': "In Sync",
61 '4': "Sync Failed",
62 '5': "Sync Disconnected",
63 '6': "Standalone",
64 '7': "Awaiting Initial Sync",
65 '8': "Incompatible Version",
66 '9': "Partial Sync",
69 status_id, status_txt = info[0]
71 status = params[status_id]
72 status_name = status_names[status_id]
74 infotext = status_name
75 if status_name != status_txt:
76 infotext += ' - ' + status_txt
77 return status, infotext
80 check_info["f5_bigip_cluster_v11"] = {
81 'default_levels_variable' : 'f5_bigip_cluster_v11',
82 'check_function' : check_f5_bigip_cluster_v11,
83 'inventory_function' : inventory_f5_bigip_cluster_v11,
84 'service_description' : 'Config Sync Status',
85 'snmp_info' : ('.1.3.6.1.4.1.3375.2.1.14.1', [
86 "1.0", # sysCmSyncStatusId
87 "2.0" # sysCmSyncStatusStatus
88 ]),
90 'snmp_scan_function' :
91 lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \
92 and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower() \
93 and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0]) >= 11,
94 'group' : 'f5_bigip_cluster_v11',