-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
First things first, I had an issue with having the checks work with an extension. I removed the extension from a10_memory and a10_cpu then the checks worked fine.
I added a percentage to the output of the a10_memory (math is probably wrong)
diff NEW OLD
18,19d17
< prct_used = used_mb / total_mb * 100
<
40c38
< infotext = "%.1fMB%s of %.1fMB used (%.1f%% used)" % (used_mb, label, total_mb, prct_used)
---
> infotext = "%.1fMB%s of %.1fMB used" % (used_mb, label, total_mb)
then I wrote an a10_memory.py perfometer addon web/plugins/perfometer/a10_memory.py
Thought these additions might be of use to you or somebody else.
a10_memory.py
def perfometer_check_a10_memory(row, check_command, perf_data):
used = float(perf_data[0][1])
warn = float(perf_data[0][3])
crit = float(perf_data[0][4])
maxim= float(perf_data[0][6])
usedp = used / maxim * 100
warnp = warn / maxim * 100
critp = crit / maxim * 100
if usedp >= critp:
color = "#ff0000"
elif usedp >= warnp:
color = "#ffff00"
else:
color = "#00ff00"
return "%.0f%% " % usedp, perfometer_linear(usedp, color)
#Uncomment to test columns.
#used = float(perf_data[0][4])
#color = "#00ff00"
#return "%.0f%%" % used, perfometer_linear(used, color)
perfometers["check_mk-a10_memory"] = perfometer_check_a10_memory
Metadata
Metadata
Assignees
Labels
No labels