30 lines
978 B
Plaintext
30 lines
978 B
Plaintext
|
#!/usr/bin/python
|
||
|
|
||
|
def inventory_juniper_processes(info):
|
||
|
inventory = []
|
||
|
for line in info:
|
||
|
if line[0].startswith("mgd"):
|
||
|
continue
|
||
|
elif line[0].startswith("sshd"):
|
||
|
continue
|
||
|
else:
|
||
|
inventory.append((line[0], None))
|
||
|
return inventory
|
||
|
|
||
|
def check_juniper_processes(item, params, info):
|
||
|
for procName, procUsage in info:
|
||
|
if item == procName:
|
||
|
usage = int(procUsage) / 8
|
||
|
perfdata = [ ( "Memory (kB)", usage) ]
|
||
|
return (0, "OK: %s kB Used" % usage, perfdata)
|
||
|
return (3, "UNKNOWN")
|
||
|
|
||
|
check_info["juniper_processes"] = {
|
||
|
"check_function" : check_juniper_processes,
|
||
|
"inventory_function" : inventory_juniper_processes,
|
||
|
"service_description" : "Process",
|
||
|
"has_perfdata" : True,
|
||
|
"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.2.1.54.1.2.3.1", [7, 10]),
|
||
|
}
|