From 8d1ecb9b36c4b1f5de146749b2d39d7b26364ba8 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Nov 2017 18:26:08 +0100 Subject: [PATCH] ITL: Add check_rpc --- doc/10-icinga-template-library.md | 16 ++++++++++++ itl/command-plugins.conf | 41 +++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 17bb38b71..bf73039eb 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -1098,6 +1098,22 @@ radius_expect | **Optional.** The response string to expect from the server radius_retries | **Optional.** The number of times to retry a failed connection. radius_timeout | **Optional.** The number of seconds before connection times out (default: 10). +### rpc + +The [check_rpc](https://www.monitoring-plugins.org/doc/man/check_rpc.html) +plugin tests if a service is registered and running using `rpcinfo -H host -C rpc_command`. + +Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--- | --- +rpc_address | **Optional.** The rpc host address. Defaults to "$address$ if the host `address` attribute is set, "$address6$" otherwise. +rpc_command | **Required.** The programm name (or number). +rpc_port | **Optional.** The port that should be checked. +rpc_version | **Optional.** The version you want to check for (one or more). +rpc_udp | **Optional.** Use UDP test. Defaults to false. +rpc_tcp | **Optional.** Use TCP test. Defaults to false. +rpc_verbose | **Optional.** Show verbose output. Defaults to false. ### simap diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index f4c01134c..0aca85b79 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -3109,3 +3109,44 @@ object CheckCommand "nscp_api" { vars.nscp_api_host = "$check_address$" } + +object CheckCommand "rpc" { + import "ipv4-or-ipv6" + + command = [ PluginDir + "/check_rpc" ] + + arguments = { + "-H" = { + value = "$rpc_address$" + description = "RPC host address" + required = true + } + "-C" = { + value = "$rpc_command$" + description = "Programm name (or number)" + required = true + } + "-p" = { + value = "$rpc_port$" + description = "RPC port" + } + "-c" = { + value = "$rpc_version$" + description = "The version to check" + } + "-u" = { + set_if = "$rpc_udp$" + description = "Test UDP" + } + "-t" = { + set_if = "$rpc_tcp$" + description = "Test TCP" + } + "-v" = { + set_if = "$rpc_verbose$" + description = "Show verbose details" + } + } + + vars.rpc_address = "$check_address$" +} -- 2.40.0