Refactored snapin server_time to new snapin API
[check_mk.git] / checks / ups_modulys_outphase
blob1d0f730023fdc1e83027563faa8f3e93eaed8810
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 factory_settings['ups_modulys_outphase_default_levels'] = {
30 def parse_ups_modulys_outphase(info):
31 parsed = {}
32 parsed["Phase 1"] = {
33 "frequency" : int(info[0][1]) / 10.0,
34 "voltage" : int(info[0][3]) / 10.0,
35 "current" : int(info[0][4]) / 10.0,
36 "power" : int(info[0][5]),
37 "output_load" : int(info[0][6]),
40 if info[0][2] == '3':
41 parsed["Phase 2"] = {
42 "frequency" : int(info[0][1]) / 10.0,
43 "voltage" : int(info[0][7]) / 10.0,
44 "current" : int(info[0][8]) / 10.0,
45 "power" : int(info[0][9]),
46 "output_load" : int(info[0][10]),
49 parsed["Phase 3"] = {
50 "frequency" : int(info[0][1]) / 10.0,
51 "voltage" : int(info[0][11]) / 10.0,
52 "current" : int(info[0][12]) / 10.0,
53 "power" : int(info[0][13]),
54 "output_load" : int(info[0][14]),
57 return parsed
60 check_info['ups_modulys_outphase'] = {
61 'parse_function' : parse_ups_modulys_outphase,
62 'inventory_function' : inventory_elphase,
63 'check_function' : check_elphase,
64 'service_description' : 'Output %s',
65 'has_perfdata' : True,
66 'default_levels_variable' : 'ups_modulys_outphase_default_levels',
67 'includes' : [ "elphase.include", ],
68 'group' : 'ups_outphase',
69 'snmp_info' : (".1.3.6.1.4.1.2254.2.4.5", [
70 "1", # dupsOutputSource
71 "2", # dupsOutputFrequency
72 "3", # dupsOutputNumLines
73 "4", # dupsOutputVoltage1
74 "5", # dupsOutputCurrent1
75 "6", # dupsOutputPower1
76 "7", # dupsOutputLoad1
77 "8", # dupsOutputVoltage2
78 "9", # dupsOutputCurrent2
79 "10", # dupsOutputPower2
80 "11", # dupsOutputLoad2
81 "12", # dupsOutputVoltage3
82 "13", # dupsOutputCurrent3
83 "14", # dupsOutputPower3
84 "15", # dupsOutputLoad3
85 ]),
86 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.2254.2.4",