]> granicus.if.org Git - icinga2/blobdiff - itl/command-nscp-local.conf
Merge pull request #6657 from Icinga/feature/api-debug-log-request-body
[icinga2] / itl / command-nscp-local.conf
index 097fe525a6855d37ea777df26b1200de2a26c086..ca69ea2f281457c3c0517366ae4806c4dc1d2afa 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)  *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)  *
  *                                                                            *
  * This program is free software; you can redistribute it and/or              *
  * modify it under the terms of the GNU General Public License                *
@@ -25,8 +25,14 @@ object CheckCommand "nscp-local" {
        command = [ NscpPath + "\\nscp.exe", "client" ]
 
        arguments = {
-               "--log" = "$nscp_log_level$"
-               "--load-all" = { set_if ="$nscp_load_all$" }
+               "--log" = {
+                       value = "$nscp_log_level$"
+                       description = "The log level to use"
+               }
+               "--load-all" = {
+                       set_if ="$nscp_load_all$"
+                       description = "Load all plugins (currently only used with generate)"
+               }
                "--module" = {
                        value = "$nscp_modules$"
                        description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
@@ -34,19 +40,22 @@ object CheckCommand "nscp-local" {
                }
                "-q" = {
                        value = "$nscp_query$"
+                       description = "Run a query with a given name"
                        required = true
                }
                "-b" = {
                        set_if = "$nscp_boot$"
+                       description = "Boot the client before executing command (similar as running the command from test mode)"
                }
                "-a" = {
                        value = "$nscp_arguments$"
                        repeat_key = true
+                       description = "List of arguments (arguments gets -- prefixed automatically (--argument foo=bar is the same as setting '--foo bar')"
                }
                "--show-all" = {
                        set_if = "$nscp_showall$"
+                       description = ""
                }
-
        }
 
        vars.nscp_log_level = "critical"
@@ -63,6 +72,7 @@ object CheckCommand "nscp-local-cpu" {
                "--time" = {
                        value = "$nscp_cpu_time$"
                        repeat_key = true
+                       description = "The time to check"
                }
                "--warning" = {
                        value = "load>$nscp_cpu_warning$"
@@ -91,9 +101,11 @@ object CheckCommand "nscp-local-memory" {
        arguments += {
                "--type=committed" = {
                        set_if = "$nscp_memory_committed$"
+                       description = "Total memory (RAM+PAGE)"
                }
                "--type=physical" = {
                        set_if = "$nscp_memory_physical$"
+                       description = "Physical memory (RAM)"
                }
                "--warning" = {
                        value = "$nscp_memory_op$ $nscp_memory_warning$"
@@ -281,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"
+
+}