GUI CSS: Deployed view styles for layouts (CMK-1171)
[check_mk.git] / checks / ups_capacity
blob8b78b259a4e7f30f9e8b1bd61e556570ee785918
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.
27 # SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "GE"
28 # SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "SitePro"
29 # SNMPv2-SMI::mib-2.33.1.1.3.0 = STRING: "2.12"
30 # SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GEDE CP5 SNMP/Web Interface Ver.1.0 (2008/05/09)"
31 # SNMPv2-SMI::mib-2.33.1.1.5.0 = STRING: "GEDE_SNMP_UPS_Interface"
32 # SNMPv2-SMI::mib-2.33.1.1.6.0 = STRING: "UPS attached device"
33 # SNMPv2-SMI::mib-2.33.1.2.1.0 = INTEGER: 2
34 # SNMPv2-SMI::mib-2.33.1.2.2.0 = INTEGER: 0
35 # ==> Remaining capacity in estimated minutes
36 # SNMPv2-SMI::mib-2.33.1.2.3.0 = INTEGER: 150
37 # SNMPv2-SMI::mib-2.33.1.2.4.0 = INTEGER: 100 <-- Battery percentages
38 # SNMPv2-SMI::mib-2.33.1.2.5.0 = INTEGER: 4080
39 # SNMPv2-SMI::mib-2.33.1.2.6.0 = INTEGER: 0
40 # SNMPv2-SMI::mib-2.33.1.2.7.0 = INTEGER: 23
41 # SNMPv2-SMI::mib-2.33.1.3.1.0 = Counter32: 13
42 # SNMPv2-SMI::mib-2.33.1.3.2.0 = INTEGER: 3
44 #ups_capacity_defaul_levels = (0, 0)
45 ups_capacity_default_levels = {'battime': (0, 0), 'capacity': (95, 90)}
48 def inventory_ups_capacity(info):
49 if len(info) > 0:
50 return [(None, 'ups_capacity_default_levels')]
53 check_info["ups_capacity"] = {
54 "check_function": check_ups_capacity,
55 "inventory_function": inventory_ups_capacity,
56 "service_description": "Battery capacity",
57 "has_perfdata": True,
58 "group": "ups_capacity",
59 "includes": ["ups_capacity.include", "ups_generic.include"],
60 "snmp_info": (".1.3.6.1.2.1.33.1.2", ["2.0", "3.0", "4.0"]),
61 "snmp_scan_function": ups_generic_scan_function,