2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2018 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 # Nikolas Hagemann, comNET GmbH - nikolas.hagemann@comnetgmbh.com
30 #.1.3.6.1.4.1.12356.118.5.1.1.0 0
31 #.1.3.6.1.4.1.12356.118.5.1.2.0 0
32 #.1.3.6.1.4.1.12356.118.5.1.3.0 0
33 #.1.3.6.1.4.1.12356.118.5.1.4.0 0
34 #.1.3.6.1.4.1.12356.118.5.1.5.0 0
35 #.1.3.6.1.4.1.12356.118.5.1.6.0 0
36 #.1.3.6.1.4.1.12356.118.5.1.7.0 0
37 #.1.3.6.1.4.1.12356.118.5.1.8.0 0
38 #.1.3.6.1.4.1.12356.118.5.1.9.0 0
39 #.1.3.6.1.4.1.12356.118.5.1.10.0 0
40 #.1.3.6.1.4.1.12356.118.5.1.11.0 0
43 def parse_fortisandbox_queues(info
):
45 'Executable', 'PDF', 'Office', 'Flash', 'Web', 'Android', 'MAC', 'URL job', 'User defined',
46 'Non Sandboxing', 'Job Queue Assignment'
48 length
= map(int, info
[0])
49 parsed
= dict(zip(queues
, length
))
53 def inventory_fortisandbox_queues(parsed
):
54 for queue
in parsed
.keys():
58 def check_fortisandbox_queues(item
, params
, parsed
):
59 for queue
, length
in parsed
.iteritems():
61 warn
, crit
= params
.get('length', (None, None))
63 if crit
and length
>= crit
:
65 elif warn
and length
>= warn
:
67 perfdata
= [('queue', length
, warn
, crit
)]
68 infotext
= 'Queue length: %s' % length
70 infotext
+= ' (warn/crit at %s/%s)' % (warn
, crit
)
71 return state
, infotext
, perfdata
74 check_info
['fortisandbox_queues'] = {
75 'parse_function': parse_fortisandbox_queues
,
76 'inventory_function': inventory_fortisandbox_queues
,
77 'check_function': check_fortisandbox_queues
,
78 'service_description': 'Pending %s files',
80 'snmp_scan_function': lambda oid
: oid('.1.3.6.1.2.1.1.2.0') == '.1.3.6.1.4.1.12356.118.1.30006',
82 '.1.3.6.1.4.1.12356.118.5.1',
96 'group': 'fortisandbox_queues',