handing over thresholds for packet loss to the plugin as integer (
as
expected by the nagios plugin)
Message-ID: <524ae7f8.QvofFEDkC7mVlGYC%bs(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: f624839de87ebfc059964a14e110f5d0650c70fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f624839de87ebf…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Oct 1 17:19:17 2013 +0200
check_icmp: adding check manpage; handing over thresholds for packet loss to the plugin as
integer (as expected by the nagios plugin)
---
checkman/check_icmp | 20 ++++++++++++++++++++
checks/check_icmp | 4 ++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/checkman/check_icmp b/checkman/check_icmp
new file mode 100644
index 0000000..c35db34
--- /dev/null
+++ b/checkman/check_icmp
@@ -0,0 +1,20 @@
+title: ICMP Echo Request (Ping)
+agents: active
+catalog: agentless
+license: GPL
+distribution: check_mk
+description:
+ This performs an active check with a ICMP Echo Request (Ping)
+
+ It can check round trip times against given thresholds. It can also check packet
+ loss against given thresholds.
+
+ Returns {WARN} or {CRIT} if round trip times or packet loss is above given levels.
+ Returns {CRIT} if receiving ICMP Host unreachable messages.
+
+ This check can be configured by Wato.
+
+perfdata:
+ Four values: The round trip time (average) in milliseconds, the packet loss in
+ percent, the maximum round trip time in milliseconds and the minimum round trip time
+ in milliseconds.
diff --git a/checks/check_icmp b/checks/check_icmp
index cd8eeee..aab3006 100644
--- a/checks/check_icmp
+++ b/checks/check_icmp
@@ -37,8 +37,8 @@ def check_icmp_arguments(params):
rta = value
elif key == "loss":
loss = value
- args.append("-w %.2f,%.2f%%" % (rta[0], loss[0]))
- args.append("-c %.2f,%.2f%%" % (rta[1], loss[1]))
+ args.append("-w %.2f,%d%%" % (rta[0], loss[0]))
+ args.append("-c %.2f,%d%%" % (rta[1], loss[1]))
args.append("'$HOSTADDRESS$'")
return " ".join(args)