Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions checks/apc_ats_status
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def inventory_apc_ats_status(info):


def check_apc_ats_status(_no_item, source, info):
comstatus, selected_source, redundancy, overcurrent, ps5, ps24 = map(saveint, info[0])
comstatus, selected_source, redundancy, overcurrent, ps5, ps24, ps3, ps1 = map(saveint, info[0])
state = 0
messages = []

Expand Down Expand Up @@ -52,7 +52,7 @@ def check_apc_ats_status(_no_item, source, info):
messages.append("exceedet ouput current threshold(!!)")

# 5Volt power supply
if ps5 != 2:
if ps5 and ps5 != 2:
state = 2
messages.append("5V power supply failed(!!)")

Expand All @@ -61,14 +61,28 @@ def check_apc_ats_status(_no_item, source, info):
state = 2
messages.append("24V power suppy failed(!!)")

# 3.3Volt power supply
if ps3 and ps3 != 2:
state = 2
messages.append("3.3V power supply failed(!!)")

# 1Volt power supply
if ps1 and ps1 != 2:
state = 2
messages.append("1V power supply failed(!!)")

return state, ", ".join(messages)


check_info["apc_ats_status"] = {
"check_function": check_apc_ats_status,
"inventory_function": inventory_apc_ats_status,
"service_description": "ATS Status",
"snmp_scan_function": lambda oid: ".1.3.6.1.4.1.318.1.3.11" in oid(".1.3.6.1.2.1.1.2.0"),
"snmp_scan_function": lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [
".1.3.6.1.4.1.318.1.3.11",
".1.3.6.1.4.1.318.1.3.32",
],
"snmp_info": (
".1.3.6.1.4.1.318.1.1.8.5.1",
[
Expand All @@ -78,6 +92,8 @@ check_info["apc_ats_status"] = {
"4.0", # atsStatusOverCurrentState
"5.0", # atsStatus5VPowerSupply
"6.0", # atsStatus24VPowerSupply
"17.0", # atsStatus3dot3VPowerSupply
"18.0", # atsStatus1Dot0VPowerSupply
],
),
}