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 # .1.3.6.1.2.1.1.1.0 Linux gateway1 2.6.18-92cp #1 SMP Tue Dec 4 21:44:22 IST 2012 i686
28 # .1.3.6.1.4.1.2620.1.1.4.0 131645
29 # .1.3.6.1.4.1.2620.1.1.5.0 0
30 # .1.3.6.1.4.1.2620.1.1.6.0 1495
31 # .1.3.6.1.4.1.2620.1.1.7.0 16297
33 factory_settings
["checkpoint_packets_default_levels"] = {
34 "accepted": (100000, 200000),
35 "rejected": (100000, 200000),
36 "dropped": (100000, 200000),
37 "logged": (100000, 200000),
38 "espencrypted": (100000, 200000),
39 "espdecrypted": (100000, 200000),
43 def inventory_checkpoint_packets(info
):
48 def check_checkpoint_packets(_no_item
, params
, info
):
51 value
["Accepted"] = int(info
[0][0][0])
52 value
["Rejected"] = int(info
[0][0][1])
53 value
["Dropped"] = int(info
[0][0][2])
54 value
["Logged"] = int(info
[0][0][3])
55 value
["EspEncrypted"] = int(info
[1][0][0])
56 value
["EspDecrypted"] = int(info
[1][0][1])
57 this_time
= time
.time()
60 if params
.get(key
) is None:
61 warn
, crit
= (None, None)
63 warn
, crit
= params
[key
]
65 rate
= get_rate(key
, this_time
, value
[name
])
66 infotext
= "%s: %.1f pkts/s" % (name
, rate
)
68 if crit
is not None and rate
>= crit
:
70 elif warn
is not None and rate
>= warn
:
73 infotext
+= " (warn/crit at %s/%s pkts/s)" % (warn
, crit
)
75 yield state
, infotext
, [(key
, rate
, warn
, crit
, 0)]
78 check_info
["checkpoint_packets"] = {
79 "check_function": check_checkpoint_packets
,
80 "inventory_function": inventory_checkpoint_packets
,
81 "service_description": "Packet Statistics",
83 "group": "checkpoint_packets",
84 "snmp_scan_function": scan_checkpoint
,
85 "default_levels_variable": "checkpoint_packets_default_levels",
88 ".1.3.6.1.4.1.2620.1.1",
96 ".1.3.6.1.4.1.2620.1.2.5.4",
98 5, # cpvIpsecEspEncPkts
99 6, # cpvIpsecEspDecPkts
102 "includes": ["checkpoint.include"],