-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjuniper_chassis
47 lines (41 loc) · 1.7 KB
/
juniper_chassis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python
# OIDs used:
# JUNIPER-MIB::jnxOperatingDescr .1.3.6.1.4.1.2636.3.1.13.1.5
# JUNIPER-MIB::jnxOperatingState .1.3.6.1.4.1.2636.3.1.13.1.6
# JUNIPER-MIB::jnxBoxDescr .1.3.6.1.4.1.2636.3.1.2.0
# Scan function looks for 'Juniper' in jnxBoxDescr
# Author: Mike Julian - [email protected] - http://mikejulian.com
def inventory_juniper_chassis(info):
inventory = []
for line in info:
inventory.append((line[0], None))
return inventory
def check_juniper_chassis(item, _no_params, info):
for descr, state in info:
if item == descr:
status = int(state)
if status == 1:
return (1, "CRIT - Status: unknown")
elif status == 2:
return (0, "OK - Status: Running (active)")
elif status == 3:
return (0, "OK - Status: Ready (not active)")
elif status == 4:
return (2, "WARN - Status: Held in reset")
elif status == 5:
return (0, "WARN - Status: Running at full speed (fans only)")
elif status == 6:
return (1, "CRIT - Status: Down/Offline (PSUs only)")
elif status == 7:
return (0, "OK - Status: Standby")
else:
return (3, "UNKNOWN")
return (3, "UNKNOWN")
check_info["juniper_chassis"] = {
"check_function" : check_juniper_chassis,
"inventory_function" : inventory_juniper_chassis,
"service_description" : "Chassis: %s",
"has_perfdata" : False,
"snmp_scan_function" : lambda oid: "Juniper" in oid(".1.3.6.1.4.1.2636.3.1.2.0"),
"snmp_info" : ( ".1.3.6.1.4.1.2636.3.1.13.1", [5, 6]),
}