diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index bbd3e824b..81f771762 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -1725,6 +1725,19 @@ Name | Description users\_win\_warn | **Optional**. The warning threshold. users\_win\_crit | **Optional**. The critical threshold. +### file-age-windows + +Check command object for `check_file_age.cmd` command file and `check_file_age.cmd.ps1` plugin. + +Custom variables: + +Name | Description +:----------------|:------------ +file | **Required**. File name and location +warning | **Required**. The warning threshold of file age in seconds. +critical | **Required**. The critical threshold of file age in seconds. + +All variables are required and all variables are positional. The variable order is: file warning critical. ## Plugin Check Commands for NSClient++ diff --git a/itl/command-plugins-windows.conf b/itl/command-plugins-windows.conf index 22ab623b9..d7f7dc86a 100644 --- a/itl/command-plugins-windows.conf +++ b/itl/command-plugins-windows.conf @@ -317,3 +317,38 @@ object CheckCommand "users-windows" { } } } + +/* + * Icinga2 CheckCommand definition for a file age check for Windows + + check_file_age.cmd and check_file_age.cmd.ps1 files are available from here: + https://github.com/KAMI911/icinga2-basic/tree/master/plugins +*/ + +object CheckCommand "file-age-windows" { + command = [ PluginDir + "/check_file_age.cmd" ] + + arguments = { + "file" = { + skip_key = true + order = 0 + value = "$file_age_file$" + description = "File name and location" + required = true + } + "warning" = { + skip_key = true + order = 1 + value = "$file_age_warning$" + description = "Warning threshold of file age in seconds" + required = true + } + "critical" = { + skip_key = true + order = 2 + value = "$file_age_critical$" + description = "Critical threshold of file age in seconds" + required = true + } + } +}