removed default thresholds

This commit is contained in:
Marius Pana 2018-09-14 18:27:05 +03:00
parent 448fd6438d
commit 24905106f0
2 changed files with 44 additions and 69 deletions

View File

@ -38,38 +38,19 @@
#x.x.x.x:/mount/name mounted on /data:
# ...
factory_settings["nfsiostat_default_levels"] = {
"op_s" : (2500000.00, 2600000.00),
"rpc_backlog" : (2500000.00, 2600000.00),
"read_ops" : (2500000.00, 2600000.00),
"read_b_s" : (2500000.00, 2600000.00),
"read_b_op" : (2500000.00, 2600000.00),
"read_retrans" : (2500000.0, 2600000.0),
"read_avg_rtt_ms" : (2500000.00, 2600000.00),
"read_avg_exe_ms" : (2500000.00, 2600000.00),
"write_ops_s" : (2500000.00, 2600000.00),
"write_b_s" : (2500000.00, 2600000.00),
"write_b_op" : (2500000.00, 2600000.00),
"write_retrans" : (2500000.0, 2600000.0),
"write_avg_rtt_ms" : (2500000.00, 2600000.00),
"write_avg_exe_ms" : (2500000.00, 2600000.0),
}
# we can convert once it is clear what the format/standards are
# count, (item (name), title, factor, fmt,)
param_name = {
"0" : ("op_s","Operations", 1, "%.2f/s"),
"1" : ("rpc_backlog", "RPC Backlog", 1, "%.2f"),
"2" : ("read_ops", "Read operations", 1, "%.3f/s"),
"3" : ("read_b_s", "Reads per second", 1000, "%.3fB/s"),
"4" : ("read_b_op", "Read bytes", 1000, "%.3fB/op"),
"2" : ("read_ops", "Read operations /s", 1, "%.3f/s"),
"3" : ("read_b_s", "Reads size /s", 1000, "%.3fB/s"),
"4" : ("read_b_op", "Read bytes per operation", 1000, "%.3fB/op"),
"5" : ("read_retrans", "Read Retransmission", 1, "%.1f%%"),
"6" : ("read_retrans", "Read Retransmission", 1, "%.1f%%"),
"7" : ("read_avg_rtt_ms", "Read average RTT", 1000, "%.3f/s",),
"8" : ("read_avg_exe_ms", "Read average EXE", 1000, "%.3f/s",),
"9" : ("write_ops_s", "Write operations", 1, "%.3f/s"),
"10" : ("write_b_s", "Writes per second", 1000, "%.3fkB/s"),
"11" : ("write_b_op", "Write bytes", 1000, "%.3fB/op"),
"9" : ("write_ops_s", "Write operations /s", 1, "%.3f/s"),
"10" : ("write_b_s", "Writes size /s", 1000, "%.3fkB/s"),
"11" : ("write_b_op", "Write bytes per operation", 1000, "%.3fB/op"),
"12" : ("write_retrans", "Write Retransmission", 1, "%.1f%%"),
"13" : ("write_retrans", "Write Retransmission", 1, "%.3f%%"),
"14" : ("write_avg_rtt_ms", "Write Average RTT", 1, "%.3f/ms"),
@ -91,7 +72,7 @@ def parse_nfsiostat(info):
def inventory_nfsiostat(parsed):
inventory = []
for mountname in parsed.keys():
yield mountname, "nfsiostat_default_levels"
yield mountname, {}
def check_nfsiostat(item, params, parsed):
@ -103,24 +84,20 @@ def check_nfsiostat(item, params, parsed):
factor = param_name[str(count)][2]
fmt = param_name[str(count)][3]
value = float(value)
crit = float(params[item][1])
warn = float(params[item][0])
# convert
value = factor * value
# match on item or fmt
if item == "read_ops":
# if fmt == "%.3f/s":
value = value / factor
if value >= crit:
perfdata = [ (item, value, warn, crit ) ]
return(2, "%s: %s" % (title, fmt % value), perfdata)
elif value >= warn:
perfdata = [ (item, value, warn, crit ) ]
return(1, "%s: %s" % (title, fmt % value), perfdata)
else:
perfdata = [ (item, value, warn, crit ) ]
return(0, "%s: %s" % (title, fmt % value), perfdata)
if params:
if params.get(item, 0):
crit = float(params[item][1])
warn = float(params[item][0])
if value >= crit:
perfdata = [ (item, value, warn, crit ) ]
return(2, "%s: %s" % (title, fmt % value), perfdata)
elif value >= warn:
perfdata = [ (item, value, warn, crit ) ]
return(1, "%s: %s" % (title, fmt % value), perfdata)
perfdata = [ (item, value ) ]
return(0, "%s: %s" % (title, fmt % value), perfdata)
for mountpoint, values in parsed.items():
# We have duplicate items at index 5 and 12. We exclude the dupes here
@ -138,7 +115,5 @@ check_info['nfsiostat'] = {
'check_function' : check_nfsiostat,
'service_description' : 'NFS IO stats %s',
'group' : 'nfsiostats',
'default_levels_variable': 'nfsiostat_default_levels',
'has_perfdata' : True,
#'includes' : ['size_trend.include', 'df.include']
}

View File

@ -10,75 +10,75 @@ register_check_parameters(
Tuple(
title=_("Operations"),
elements=[
Float(title=_("Warning at"), default_value=70.00, unit="1/s"),
Float(title=_("Critical at"), default_value=100.00, unit="1/s"),
Float(title=_("Warning at"), default_value=None, unit="1/s"),
Float(title=_("Critical at"), default_value=None, unit="1/s"),
])),
("rpc_backlog",
Tuple(
title=_("RPC Backlog"),
elements=[
Float(title=_("Warning below"), default_value=70.00, unit="queue"),
Float(title=_("Critical below"), default_value=100.00, unit="queue"),
Float(title=_("Warning below"), default_value=None, unit="queue"),
Float(title=_("Critical below"), default_value=None, unit="queue"),
])),
("read_ops",
Tuple(
title=_("Read Operations"),
title=_("Read Operations /s"),
elements=[
Float(title=_("Warning at"), default_value=150.000, unit="1/s"),
Float(title=_("Critical at"), default_value=200.000, unit="1/s"),
Float(title=_("Warning at"), default_value=None, unit="1/s"),
Float(title=_("Critical at"), default_value=None, unit="1/s"),
])),
("read_b_s",
Tuple(
title=_("Read Bytes"),
title=_("Reads size /s"),
elements=[
Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"),
Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"),
Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
])),
("read_b_op",
Tuple(
title=_("Read kB/op"),
title=_("Read bytes per operation"),
elements=[
Float(title=_("Warning at"), default_value=200.000, unit="bytes/op"),
Float(title=_("Critical at"), default_value=250.000, unit="bytes/op"),
Float(title=_("Warning at"), default_value=None, unit="bytes/op"),
Float(title=_("Critical at"), default_value=None, unit="bytes/op"),
])),
("read_retrans",
Tuple(
title=_("Read Retransmissions"),
elements=[
Percentage(title=_("Warning at"), default_value=10.0),
Percentage(title=_("Critical at"), default_value=20.0),
Percentage(title=_("Warning at"), default_value=None),
Percentage(title=_("Critical at"), default_value=None),
])),
("read_avg_rtt_ms",
Tuple(
title=_("Read Average RTT (ms)"),
elements=[
Float(title=_("Warning at"), default_value=150.000, unit="ms"),
Float(title=_("Critical at"), default_value=200.000, unit="ms"),
Float(title=_("Warning at"), default_value=None, unit="ms"),
Float(title=_("Critical at"), default_value=None, unit="ms"),
])),
("read_avg_exe_ms",
Tuple(
title=_("Read Average Executions (ms)"),
elements=[
Float(title=_("Warning at"), default_value=15.000, unit="ms"),
Float(title=_("Critical at"), default_value=16.000, unit="ms"),
Float(title=_("Warning at"), default_value=None, unit="ms"),
Float(title=_("Critical at"), default_value=None, unit="ms"),
])),
("write_ops_s",
Tuple(
title=_("Write Operations/s"),
elements=[
Float(title=_("Warning at"), default_value=15.000, unit="1/s"),
Float(title=_("Critical at"), default_value=16.000, unit="1/s"),
Float(title=_("Warning at"), default_value=None, unit="1/s"),
Float(title=_("Critical at"), default_value=None, unit="1/s"),
])),
("write_b_s",
Tuple(
title=_("Write Bytes"),
title=_("Write size /s"),
elements=[
Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"),
Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"),
])),
("write_b_op",
Tuple(
title=_("Write B/s"),
title=_("Write bytes per operation"),
elements=[
Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"),
Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"),