From ffc9e13965bc0c5f289e6a660a650f32a9d8a006 Mon Sep 17 00:00:00 2001 From: Carsten Koebke Date: Tue, 19 Jun 2018 15:03:18 +0200 Subject: [PATCH 1/3] New ITL command nscp-local-tasksched --- itl/command-nscp-local.conf | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/itl/command-nscp-local.conf b/itl/command-nscp-local.conf index 33677fccd..ca69ea2f2 100644 --- a/itl/command-nscp-local.conf +++ b/itl/command-nscp-local.conf @@ -293,3 +293,68 @@ object CheckCommand "nscp-local-counter" { vars.nscp_counter_less = false vars.nscp_counter_perfsyntax = "$nscp_counter_name$" } + +object CheckCommand "nscp-local-tasksched" { + import "nscp-local" + + arguments += { + "--filter" = { + set_if = {{ + var scheduler_name = macro("$nscp_tasksched_name$") + if (len(scheduler_name) > 0 ) { + return true + } else { + return false + } + }} + value = "title='$nscp_tasksched_name$'" + description = "Name of the task to check." + } + "--folder" = { + value = "$nscp_tasksched_folder$" + description = "The folder in which the tasks to check reside." + } + "--hidden" = { + set_if = "$nscp_tasksched_hidden$" + description = "Look for hidden tasks." + } + "--recursive" = { + value = "$nscp_tasksched_recursive$" + description = "Recurse sub folder (defaults to true)." + } + "--warning" = { + value = "$nscp_tasksched_warning$" + description = "Filter which marks items which generates a warning state." + } + "--critical" = { + value = "$nscp_tasksched_critical$" + description = "Filter which marks items which generates a critical state." + } + "--empty-state" = { + value = "$nscp_tasksched_emptystate$" + description = "Return status to use when nothing matched filter." + } + "--perf-syntax" = { + value = "$nscp_tasksched_perfsyntax$" + description = "Performance alias syntax." + } + "--detail-syntax" = { + value = "$nscp_tasksched_detailsyntax$" + description = "Detail level syntax." + } + "-a" = { + value = "$nscp_tasksched_arguments$" + repeat_key = true + } + } + + vars.nscp_modules = "CheckTaskSched" + vars.nscp_query = "check_tasksched" + vars.nscp_showall = "$nscp_tasksched_showall$" + vars.nscp_tasksched_recursive = true + vars.nscp_tasksched_perfsyntax = "%(title)" + vars.nscp_tasksched_detailsyntax = "%(folder)/%(title): %(exit_code) != 0" + vars.nscp_tasksched_warning = "exit_code != 0" + vars.nscp_tasksched_critical = "exit_code < 0" + +} From f24342d4ff0055c7939588fbe0910a5fbaa597e8 Mon Sep 17 00:00:00 2001 From: Carsten Koebke Date: Mon, 25 Jun 2018 07:05:49 +0200 Subject: [PATCH 2/3] Add missing docs for nscp-local-tasksched --- doc/10-icinga-template-library.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 0da925058..18b555e24 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -1893,6 +1893,25 @@ nscp_counter_arguments | **Optional.** Additional arguments. nscp_counter_showall | **Optional.** Shows more details in plugin output, default to false. nscp_counter_perfsyntax | **Optional.** Apply performance data label, e.g. `Total Processor Time` to avoid special character problems. Defaults to `nscp_counter_name`. +### nscp-local-tasksched + +Check Command object for the `check_tasksched` NSClient++ plugin. +You can check for a single task or for a complete folder (and sub folders) of tasks. + +Name | Description +-----------------------|------------------ +nscp_tasksched_name | **Optional.** Name of the task to check. +nscp_tasksched_folder | **Optional.** The folder in which the tasks to check reside. +nscp_tasksched_recursive | **Optional.** Recurse sub folder, defaults to true. +nscp_tasksched_hidden | **Optional.** Look for hidden tasks, defaults to false. +nscp_tasksched_warning | **Optional.** Filter which marks items which generates a warning state, defaults to `exit_code != 0`. +nscp_tasksched_critical | **Optional.** Filter which marks items which generates a critical state, defaults to `exit_code < 0`. +nscp_tasksched_emptystate | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckDisk" ]`. +nscp_tasksched_perfsyntax | **Optional.** Performance alias syntax., defaults to `%(title)` +nscp_tasksched_detailsyntax | **Optional.** Detail level syntax, defaults to `%(folder)/%(title): %(exit_code) != 0` +nscp_tasksched_arguments | **Optional.** Additional arguments. +nscp_tasksched_showall | **Optional.** Shows more details in plugin output, default to false. +nscp_modules | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckTaskSched" ]`. ## Plugin Check Commands for Manubulon SNMP From 0ba86c0a261697f8fb360c2d7f5a206292e475ef Mon Sep 17 00:00:00 2001 From: Carsten Koebke Date: Mon, 25 Jun 2018 07:10:35 +0200 Subject: [PATCH 3/3] Change wrong text for emptystate --- doc/10-icinga-template-library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 18b555e24..a31ab9445 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -1906,7 +1906,7 @@ nscp_tasksched_recursive | **Optional.** Recurse sub folder, defaults to true nscp_tasksched_hidden | **Optional.** Look for hidden tasks, defaults to false. nscp_tasksched_warning | **Optional.** Filter which marks items which generates a warning state, defaults to `exit_code != 0`. nscp_tasksched_critical | **Optional.** Filter which marks items which generates a critical state, defaults to `exit_code < 0`. -nscp_tasksched_emptystate | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckDisk" ]`. +nscp_tasksched_emptystate | **Optional.** Return status to use when nothing matched filter, defaults to warning. nscp_tasksched_perfsyntax | **Optional.** Performance alias syntax., defaults to `%(title)` nscp_tasksched_detailsyntax | **Optional.** Detail level syntax, defaults to `%(folder)/%(title): %(exit_code) != 0` nscp_tasksched_arguments | **Optional.** Additional arguments.