]> granicus.if.org Git - icinga2/commitdiff
Add a check command for check_file_age.
authorDirk Goetz <dirk.goetz@netways.de>
Mon, 2 Nov 2015 12:24:14 +0000 (13:24 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 3 Aug 2016 09:32:41 +0000 (11:32 +0200)
Add a deprecation note for check_ldaps to check_ldap.

refs #6225

doc/7-icinga-template-library.md
itl/command-plugins.conf

index e42f3bdc726b3be9006dc017a89bc5f80863fa0d..83ed8aa768780f8476882065cb00b3a1bb5515e2 100644 (file)
@@ -295,6 +295,22 @@ dummy_state     | **Optional.** The state. Can be one of 0 (ok), 1 (warning), 2
 dummy_text      | **Optional.** Plugin output. Defaults to "Check was successful.".
 
 
+### <a id="plugin-check-command-file-age"></a> file_age
+
+Check command object for the `check_file_age` plugin.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                   | Description
+-----------------------|--------------------------------------------------------------------------------------------------------
+file_age_file          | **Required.** File to monitor.
+file_age_warning_time  | **Optional.** File must be no more than this many seconds old as warning threshold. Defaults to "240s".
+file_age_critical_time | **Optional.** File must be no more than this many seconds old as critical threshold. Defaults to "600s".
+file_age_warning_size  | **Optional.** File must be at least this many bytes long as warning threshold. No default given.
+file_age_critical_size | **Optional.** File must be at least this many bytes long as critical threshold. Defaults to "0B".
+file_age_ignoremissing | **Optional.** Return OK if the file does not exist. Defaults to false.
+
+
 ### <a id="plugin-check-command-fping4"></a> fping4
 
 Check command object for the `check_fping` plugin.
@@ -541,7 +557,7 @@ imap_ipv6             | **Optional.** Use IPv6 connection. Defaults to false.
 
 ### <a id="plugin-check-command-ldap"></a> ldap
 
-Check command object for the `check_ldap` plugin.
+Check command object for the `check_ldap` plugin. Use the plugin also for monitoring ldaps connections instead of the deprecated `check_ldaps`.
 
 Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
 
index 47e8e67a3e82bc5ce5b5393ca6c2b444fb424ca5..526fb7bf0f7aa0651cfb3e4f69c175c1caa858db 100644 (file)
@@ -2104,3 +2104,38 @@ object CheckCommand "negate" {
 
        vars.negate_timeout_result = "UNKNOWN"
 }
+
+object CheckCommand "file_age" {
+       import "plugin-check-command"
+
+       command = [ PluginDir + "/check_file_age" ]
+
+       arguments = {
+               "-w" = {
+                       value = "$file_age_warning_time$"
+                       description = "File must be no more than this many seconds old (default: 240s)"
+               }
+               "-c" = {
+                       value = "$file_age_critical_time$"
+                       description = "File must be no more than this many seconds old (default: 600s)"
+               }
+               "-W" = {
+                       value = "$file_age_warning_size$"
+                       description = "File must be at least this many bytes long"
+               }
+               "-C" = {
+                       value = "$file_age_critical_size$"
+                       description = "File must be at least this many bytes long (default: 0B)"
+               }
+               "-i" = {
+                       set_if = "$file_age_ignoremissing$"
+                       description = "return OK if the file does not exist"
+               }
+               "-f" = {
+                       value = "$file_age_file$"
+                       description = "File to monitor"
+               }
+       }
+
+       vars.file_age_ignoremissing = false
+}