Cleanup config.nodes_of
[check_mk.git] / checks / datapower_tcp
blobecabeb9b4844862538491ef888b0795460f30455
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2015 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.4.1.14685.3.1.12.1.0 10 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryestablished.0
28 # .1.3.6.1.4.1.14685.3.1.12.2.0 2 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummarysynsent.0
29 # .1.3.6.1.4.1.14685.3.1.12.3.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummarysynreceived.0
30 # .1.3.6.1.4.1.14685.3.1.12.4.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryfinwait1.0
31 # .1.3.6.1.4.1.14685.3.1.12.5.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryfinwait2.0
32 # .1.3.6.1.4.1.14685.3.1.12.6.0 15 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummarytimewait.0
33 # .1.3.6.1.4.1.14685.3.1.12.7.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryclosed.0
34 # .1.3.6.1.4.1.14685.3.1.12.8.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryclosewait.0
35 # .1.3.6.1.4.1.14685.3.1.12.9.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummarylastack.0
36 # .1.3.6.1.4.1.14685.3.1.12.10.0 24 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummarylisten.0
37 # .1.3.6.1.4.1.14685.3.1.12.11.0 0 --> DATAPOWER-STATUS-MIB::dpStatusTCPSummaryclosing.0
40 def parse_datapower_tcp(info):
41 parsed = {}
42 for tcp_state, tcp_count in info:
43 parsed[int(tcp_state.split(".")[0])] = int(tcp_count)
44 return parsed
47 check_info['datapower_tcp'] = {
48 'parse_function': parse_datapower_tcp,
49 'inventory_function': inventory_tcp_connections,
50 'check_function': check_tcp_connections,
51 'service_description': 'TCP Connections',
52 'snmp_info': (
53 ".1.3.6.1.4.1.14685.3.1.12",
55 OID_END, # state of tcp connection
56 "", # number of tcp connections of this state
57 ]),
58 "snmp_scan_function": lambda oid: oid(".1.3.6.1.2.1.1.2.0") in
59 [".1.3.6.1.4.1.14685.1.7", ".1.3.6.1.4.1.14685.1.3"],
60 'has_perfdata': True,
61 'group': 'tcp_conn_stats',
62 'includes': ["tcp_connections.include"],