GUI CSS: Removed snapin styles from py modules and added a _snapins.scss for the...
[check_mk.git] / checks / if64_tplink
blob54eaa790e1d4a6fdec7f95fb1654490cb00a2781
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.
28 @network_interface_scan_registry.register
29 def snmp_scan_function_if64_tplink(oid):
30 return ".4.1.11863." in oid(".1.3.6.1.2.1.1.2.0") and has_ifHCInOctets(oid)
33 def parse_if64_tplink(info):
34 parsed = []
35 for line in info:
36 parsed.append(line[:3] + [str(int(line[3]) * 1000000)] + line[4:])
37 return parsed
40 def inventory_if64_tplink(parsed):
41 return inventory_if_common(parsed)
44 check_info["if64_tplink"] = {
45 'parse_function': parse_if64_tplink,
46 'check_function': check_if_common,
47 'inventory_function': inventory_if64_tplink,
48 'service_description': 'Interface %s',
49 'has_perfdata': True,
50 'includes': ['if.include'],
51 'snmp_info': (
52 ".1.3.6.1",
54 "2.1.2.2.1.1", # ifIndex 0
55 "2.1.2.2.1.2", # ifDescr 1
56 "2.1.2.2.1.3", # ifType 2
57 "2.1.31.1.1.1.15", # ifHighSpeed .. 1000 means 1Gbit
58 "2.1.2.2.1.8", # ifOperStatus 4
59 "2.1.31.1.1.1.6", # ifHCInOctets 5
60 "2.1.31.1.1.1.7", # ifHCInUcastPkts 6
61 "2.1.31.1.1.1.8", # ifHCInMulticastPkts 7
62 "2.1.31.1.1.1.9", # ifHCInBroadcastPkts 8
63 "2.1.2.2.1.13", # ifInDiscards 9
64 "2.1.2.2.1.14", # ifInErrors 10
65 "2.1.31.1.1.1.10", # ifHCOutOctets 11
66 "2.1.31.1.1.1.11", # ifHCOutUcastPkts 12
67 "2.1.31.1.1.1.12", # ifHCOutMulticastPkts 13
68 "2.1.31.1.1.1.13", # ifHCOutBroadcastPkts 14
69 "2.1.2.2.1.19", # ifOutDiscards 15
70 "2.1.2.2.1.20", # ifOutErrors 16
71 "2.1.2.2.1.21", # ifOutQLen 17
72 "4.1.11863.1.1.3.2.1.1.1.1.2", # special for TP Link
73 BINARY("2.1.2.2.1.6"), # ifPhysAddress 19
74 ]),
75 'snmp_scan_function': snmp_scan_function_if64_tplink,
76 'group': 'if',
77 'default_levels_variable': 'if_default_levels',