check_mk-check-nfsiostat/web/plugins/perfometer/nfsiostat.py

19 lines
532 B
Python
Raw Normal View History

2018-09-09 17:05:21 +03:00
#!/usr/bin/env python
def perfometer_nfsiostat(row, check_command, perf_data):
for pd in perf_data:
if pd[0] == u'op_s':
2018-09-09 17:18:43 +03:00
ops = float(pd[1])
2018-09-09 17:05:21 +03:00
warn = float(pd[3])
crit = float(pd[4])
2018-09-09 17:18:43 +03:00
if ops <= warn:
2018-09-09 17:05:21 +03:00
color = '#90ee90'
2018-09-09 17:18:43 +03:00
elif ops <= crit:
2018-09-09 17:05:21 +03:00
color = '#ffa500'
else:
color = '#ff6347'
2018-09-09 17:18:43 +03:00
return '%d op/s' % ops, perfometer_linear(ops, color)
2018-09-09 17:05:21 +03:00
2018-09-09 17:18:43 +03:00
perfometers["check_mk-nfsiostat"] = perfometer_nfsiostat