Go to most recent revision | Blame | Last modification | View Log | RSS feed
// Put this file in /etc/icinga2/conf.d/...
// VNag - Nagios Framework for PHP
// Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
// Licensed under the terms of the Apache 2.0 license
//
// Revision 2018-07-15
object CheckCommand "vnag_file_timestamp" {
command = [ "/daten/vnag/plugins/file_timestamp/check_file_timestamp" ]
arguments = {
"-f" = {
value = "$vnag_file_timestamp_file$"
description = "File or filemask to be checked. There are two possible checking modes: If you put a # in front of the file mask, only the youngest file of each group will be checked (use this mode e.g. if you want to check if a downloader is regularly downloading files into a download directory). Otherwise, all files of the file group are checked."
repeat_key = true
required = true
}
"-w" = {
value = "$vnag_file_timestamp_warn$"
description = "Max age of file (warning range). You must use a Nagios compatible unit of measure (i.e. seconds)."
}
"-c" = {
value = "$vnag_file_timestamp_crit$"
description = "Max age of file (critical range). You must use a Nagios compatible unit of measure (i.e. seconds)."
}
"-v" = {
set_if = "$vnag_file_timestamp_verbose$"
description = "Additionally list files which are OK, not just the files which are out of the time range."
}
}
}
// Example usage:
//
// apply Service "example_daily_backup_timestamp" {
// import "generic-service"
// check_command = "vnag_file_timestamp"
// vars = {
// vnag_file_timestamp_file = [ "/backup/automatic/timestamps/ts_daily_rsync", "/backup/automatic/timestamps/ts_daily_mysqldump" ]
// vnag_file_timestamp_warn = "86400s" // 24h
// vnag_file_timestamp_crit = "144000s" // 40h
// vnag_file_timestamp_verbose = false
// }
// assign where host.name == NodeName
// }
//
// apply Service "example_3month_backup_timestamp" {
// import "generic-service"
// check_command = "vnag_file_timestamp"
// vars = {
// vnag_file_timestamp_file = [ "/backup/automatic/timestamps/ts_raspberry_rsync" ]
// vnag_file_timestamp_warn = "7776000s" // 3 Months
// vnag_file_timestamp_crit = "15552000s" // 6 Months
// vnag_file_timestamp_verbose = false
// }
// assign where host.name == NodeName
// }
//
// apply Service "example_downloader_timestamp" {
// import "generic-service"
// check_command = "vnag_file_timestamp"
// // the prepending hashtag means 'check only the youngest file'
// vars = {
// vnag_file_timestamp_file = [ "#/home/test/my_downloader/downloaded_files/*.jpg" ]
// vnag_file_timestamp_warn = "86400s" // 24h
// vnag_file_timestamp_crit = "144000s" // 40h
// vnag_file_timestamp_verbose = false
// }
// assign where host.name == NodeName
// }