Add command and service definition for icinga2
This commit is contained in:
parent
9f08367de6
commit
479312ad5e
2 changed files with 72 additions and 0 deletions
54
command_check_iperf3.conf
Normal file
54
command_check_iperf3.conf
Normal file
|
@ -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$"
|
||||
}
|
||||
}
|
||||
}
|
18
service_check_iperf3.conf
Normal file
18
service_check_iperf3.conf
Normal file
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue