2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
4 factory_settings
["poseidon_temp_default_levels"] = {}
7 def parse_poseidon_temp(info
):
11 for name
, state
, value_string
in info
:
13 temp
= float(value_string
.replace('C', ''))
16 parsed
[name
] = {'temp': temp
, 'status': state
}
21 def check_poseidon_temp(item
, params
, data
):
28 sensor_state_value
= data
.get('status')
29 sensor_state_txt
= sensor_states
.get(sensor_state_value
)
31 if sensor_state_value
!= '1':
33 yield mk_status
, "Sensor %s, State %s" % (item
, sensor_state_txt
)
35 temp
= data
.get('temp')
37 yield check_temperature(temp
, params
, "poseidon_temp_%s" % item
.replace(" ", "_"))
39 yield 3, "No data for Sensor %s found" % item
42 check_info
["poseidon_temp"] = {
43 "parse_function": parse_poseidon_temp
,
44 "check_function": check_poseidon_temp
,
45 "inventory_function": discover(),
46 "service_description": "Temperatur: %s",
48 "group": "temperature",
49 "snmp_scan_function": lambda oid
: oid(".1.3.6.1.2.1.1.2.0").startswith('.1.3.6.1.4.1.21796.3'),
50 "snmp_info": (".1.3.6.1.4.1.21796.3.3.3.1", ['2', '4', '5']),
51 "includes": ["temperature.include"],
52 "default_levels_variable": "poseidon_temp_default_levels",