Module: check_mk
Branch: master
Commit: cc3a627966f5ca2cedc8fa68f0a9ae1b83abd62a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cc3a627966f5ca…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 26 15:22:53 2015 +0100
netapp_api checks: fixed incorrect saveint() / savefloat() calls
---
checks/netapp_api_aggr | 4 ++--
checks/netapp_api_cpu | 4 ++--
checks/netapp_api_disk | 2 +-
checks/netapp_api_protocol | 4 ++--
checks/netapp_api_temp | 10 +++++-----
checks/netapp_api_vf_stats | 4 ++--
checks/netapp_api_volumes | 6 +++---
7 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/checks/netapp_api_aggr b/checks/netapp_api_aggr
index c0e07d3..582894f 100644
--- a/checks/netapp_api_aggr
+++ b/checks/netapp_api_aggr
@@ -43,8 +43,8 @@ def check_netapp_api_aggr(item, params, parsed):
return (3, "Aggregation not found in agent output")
mega = 1024.0 * 1024.0
- size_total = saveint(aggr.get("size-total")) / mega
- size_avail = saveint(aggr.get("size-available")) / mega
+ size_total = int(aggr.get("size-total")) / mega
+ size_avail = int(aggr.get("size-available")) / mega
return df_check_filesystem_list(item, params, [(item, size_total, size_avail)])
check_info["netapp_api_aggr"] = {
diff --git a/checks/netapp_api_cpu b/checks/netapp_api_cpu
index 619b0ba..8f192d9 100644
--- a/checks/netapp_api_cpu
+++ b/checks/netapp_api_cpu
@@ -39,8 +39,8 @@ def check_netapp_api_cpu_utilization(item, params, info):
data = dict([line for line in info if len(line) == 2])
now = time.time()
- cpu_busy = saveint(data["cpu_busy"])
- num_cpus = saveint(data["num_processors"])
+ cpu_busy = int(data["cpu_busy"])
+ num_cpus = int(data["num_processors"])
timedif, ticks_per_sec = get_counter("netapp_api_cpu.utilization", now,
cpu_busy)
cpusecs_per_sec = ticks_per_sec / 1000000.0
used_perc = 100.0 * cpusecs_per_sec
diff --git a/checks/netapp_api_disk b/checks/netapp_api_disk
index ce96cac..19b154a 100644
--- a/checks/netapp_api_disk
+++ b/checks/netapp_api_disk
@@ -71,7 +71,7 @@ def check_netapp_api_disk_summary(_no_item, params, info):
if disk.get("raid-state") == "partner":
continue # Disk belongs to partner
- total_space += saveint(disk.get("used-space"))
+ total_space += int(disk.get("used-space"))
if disk.get("raid-state", "") == "broken":
broken_disks.append(disk)
diff --git a/checks/netapp_api_protocol b/checks/netapp_api_protocol
index 28d5a58..5aa6be1 100644
--- a/checks/netapp_api_protocol
+++ b/checks/netapp_api_protocol
@@ -58,10 +58,10 @@ def check_netapp_api_protocol(item, _no_params, parsed):
item = "nfsv3"
infotext = ""
- now = savefloat(time.time())
+ now = time.time()
for entry, text in [ ("read_ops", "Read OPS"),
("write_ops", "Write OPS") ]:
key = "%s_%s" % (item, entry)
- value = saveint(counter_data.get(entry, counter_data.get(key, "0")))
+ value = int(counter_data.get(entry, counter_data.get(key, "0")))
timedif, per_sec = get_counter("netapp_api_protocol.%s.%s" % (item,
entry), now, value)
yield 0, "%s %s" % (text, get_bytes_human_readable(per_sec, 1000, unit
= "")), [(entry, per_sec)]
diff --git a/checks/netapp_api_temp b/checks/netapp_api_temp
index e99b778..2da7dd2 100644
--- a/checks/netapp_api_temp
+++ b/checks/netapp_api_temp
@@ -53,16 +53,16 @@ def check_netapp_api_temp(item, _no_params, parsed):
continue
sensor_count += 1
- current_temp =
saveint(sensors["temp-sensor-current-temperature"][idx])
+ current_temp =
int(sensors["temp-sensor-current-temperature"][idx])
sum_temp.append(current_temp)
# Check built-in levels
if sensors["temp-sensor-is-error"][idx] == "true":
sensor_no = sensors["temp-sensor-element-no"][idx]
- warn_low = saveint(sensors["temp-sensor-low-warning"][idx])
- crit_low = saveint(sensors["temp-sensor-low-critical"][idx])
- warn_high = saveint(sensors["temp-sensor-hi-warning"][idx])
- crit_high = saveint(sensors["temp-sensor-hi-critical"][idx])
+ warn_low = int(sensors["temp-sensor-low-warning"][idx])
+ crit_low = int(sensors["temp-sensor-low-critical"][idx])
+ warn_high = int(sensors["temp-sensor-hi-warning"][idx])
+ crit_high = int(sensors["temp-sensor-hi-critical"][idx])
if current_temp >= crit_high:
sensor_errors.append((2, "Shelf %s(%s) too high (warn/crit at
%s/%s)" % (shelf, sensor_no, warn_high, crit_high)))
elif current_temp >= warn_high:
diff --git a/checks/netapp_api_vf_stats b/checks/netapp_api_vf_stats
index e9ea330..3be9a70 100644
--- a/checks/netapp_api_vf_stats
+++ b/checks/netapp_api_vf_stats
@@ -40,7 +40,7 @@ def check_netapp_api_vf_stats_cpu_util(item, params, info):
else:
now = time.time()
- cpu_busy = saveint(vf["vfiler_cpu_busy"])
+ cpu_busy = int(vf["vfiler_cpu_busy"])
timedif, ticks_per_sec = get_counter("netapp_api_vf_stats.cpu_util.%s"
% item, now, cpu_busy )
cpusecs_per_sec = ticks_per_sec / 1000.0 / 1000 / 10000
used_perc = 100.0 * cpusecs_per_sec
@@ -86,7 +86,7 @@ def check_netapp_api_vf_stats_traffic(item, params, info):
("net_data_sent", "Net
Data Sent", 1024.0, 1024, "B/s"),
("read_bytes",
"Read", 1024.0, 1024, "B/s"),
("write_bytes",
"Write", 1024.0, 1024, "B/s")]:
- traffic = saveint(vf["vfiler_" + entry]) * factor
+ traffic = int(vf["vfiler_" + entry]) * factor
timedif, ticks_per_sec =
get_counter("netapp_api_vf_stats.traffic.%s.%s" % (item, entry), now, traffic)
yield 0, "%s: %s" % (name, get_bytes_human_readable(ticks_per_sec,
base = base, unit = unit)), [(entry, ticks_per_sec)]
diff --git a/checks/netapp_api_volumes b/checks/netapp_api_volumes
index c5d6dfd..4aea4c4 100644
--- a/checks/netapp_api_volumes
+++ b/checks/netapp_api_volumes
@@ -65,8 +65,8 @@ def check_netapp_api_volumes(item, params, parsed):
return (3, "Volume not found in agent output")
mega = 1024.0 * 1024.0
- size_total = saveint(volume.get("size-total")) / mega
- size_avail = saveint(volume.get("size-available")) / mega
+ size_total = int(volume.get("size-total")) / mega
+ size_avail = int(volume.get("size-available")) / mega
state, info, perf = df_check_filesystem_list(item, params,
[(volume.get("name"), size_total, size_avail)])
counter_wrapped = False
@@ -80,7 +80,7 @@ def check_netapp_api_volumes(item, params, parsed):
for mode in ["read_", "write_", "other_"]:
for field, factor, format_text in [ ("data", None, None),
("latency", 10000.0, "%s: %.2f ms")]:
key = protocol + mode + field
- value = saveint(volume.get("counters", {}).get(key))
+ value = int(volume.get("counters", {}).get(key))
if value != None:
try:
timedif, delta = get_counter("netapp_api_volumes.%s.%s"
% (item, key), now, value)