diff --git a/command_check_iperf3.conf b/command_check_iperf3.conf new file mode 100644 index 0000000..08a10fe --- /dev/null +++ b/command_check_iperf3.conf @@ -0,0 +1,54 @@ +object CheckCommand "iperf3" { + import "plugin-check-command" + + command = [ "/home/nagios/check_iperf3/check_iperf3.py" ] + + arguments = { + "--remote" = { + description = "iperf3 server to connect to" + value = "$check_iperf3_remote$" + required = true + } + "--port" = { + description = "iperf3 server port to connect to" + value = "$check_iperf3_port$" + } + "--downstream" = { + description = "measure downstream instead of upstream" + set_if = "$check_iperf3_downstream$" + } + "--bidir" = { + description = "test in both directions (normal and reverse), with both the client and server sending and receiving data simultaneously" + set_if = "$check_iperf3_bidir$" + } + "--udp" = { + description = "use UDP rather than TCP" + set_if = "$check_iperf3_udp$" + } + "--time" = { + description = "time in seconds to transmit for" + value = "$check_iperf3_time$" + } + "--bytes" = { + description = "number of bytes to transmit (instead of `time`)" + value = "$check_iperf3_bytes$" + } + + "--rate-warning" = { + description = "defines the transfer rate's warning threshold" + value = "$check_iperf3_rate_warning$" + } + "--rate-critical" = { + description = "defines the transfer rate's critical threshold" + value = "$check_iperf3_rate_critical$" + } + "--retransmission-warning" = { + description = "defines the transfer retransmission's warning threshold" + value = "$check_iperf3_retransmission_warning$" + } + "--retransmission-critical" = { + description = "defines the transfer retransmission's critical threshold" + value = "$check_iperf3_retransmission_critical$" + } + } +} diff --git a/service_check_iperf3.conf b/service_check_iperf3.conf new file mode 100644 index 0000000..1740f63 --- /dev/null +++ b/service_check_iperf3.conf @@ -0,0 +1,18 @@ +apply Service "iperf3" { + import "generic-service" + + check_command = "iperf3" + check_interval = 4h + retry_interval = 15m + vars.notification_interval = 1d + + for (k => v in host.vars.iperf3) { + if (match("_*", k)) { + vars[k.substr(1)] = v + } else { + vars["check_iperf3_" + k] = v + } + } + + assign where host.vars.iperf3 != null +}