From 454a8c9a49a5a3b3149a892ebd06bf3b7f820174 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 19 Mar 2015 14:36:53 +0100 Subject: [PATCH] Add "random" CheckCommand for test and demo purposes fixes #8816 --- doc/7-icinga-template-library.md | 8 ++++++++ itl/command-icinga.conf | 3 +++ itl/command.conf | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 029842015..2f21a3700 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -58,6 +58,14 @@ Name | Description -------------|--------------- cluster_zone | **Optional.** The zone name. Defaults to "$host.name$". +### random + +Check command for the built-in `random` check. This check returns random states +and adds the check source to the check output. + +For test and demo purposes only. The `random` check command does not support +any vars. + # Plugin Check Commands The Plugin Check Commands provides example configuration for plugin check commands diff --git a/itl/command-icinga.conf b/itl/command-icinga.conf index 063e66ca8..a44fcc71b 100644 --- a/itl/command-icinga.conf +++ b/itl/command-icinga.conf @@ -31,3 +31,6 @@ object CheckCommand "cluster-zone" { vars.cluster_zone = "$host.name$" } +object CheckCommand "random" { + import "random-check-command" +} diff --git a/itl/command.conf b/itl/command.conf index f29e354c9..d04450f95 100644 --- a/itl/command.conf +++ b/itl/command.conf @@ -46,3 +46,7 @@ template NotificationCommand "plugin-notification-command" { template EventCommand "plugin-event-command" { execute = PluginEvent } + +template CheckCommand "random-check-command" { + execute = RandomCheck +}