Subversion Repositories vnag

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 1
// Put this file in /etc/icinga2/conf.d/...
2
 
3
// VNag - Nagios Framework for PHP
4
// Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
5
// Licensed under the terms of the Apache 2.0 license
6
//
7
// Revision 2018-07-15
8
 
9
object CheckCommand "vnag_file_timestamp" {
10
	command = [ "/daten/vnag/plugins/file_timestamp/check_file_timestamp" ]
11
 
12
	arguments = {
13
		"-f" = {
14
			value = "$vnag_file_timestamp_file$"
15
			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."
16
			repeat_key = true
17
			required = true
18
		}
19
		"-w" = {
20
			value = "$vnag_file_timestamp_warn$"
21
			description = "Max age of file (warning range). You must use a Nagios compatible unit of measure (i.e. seconds)."
22
		}
23
		"-c" = {
24
			value = "$vnag_file_timestamp_crit$"
25
			description = "Max age of file (critical range). You must use a Nagios compatible unit of measure (i.e. seconds)."
26
		}
27
		"-v" = {
28
			set_if = "$vnag_file_timestamp_verbose$"
29
			description = "Additionally list files which are OK, not just the files which are out of the time range."
30
		}
31
	}
32
}
33
 
34
// Example usage:
35
//
36
// apply Service "example_daily_backup_timestamp" {
37
//	import "generic-service"
38
//	check_command = "vnag_file_timestamp"
39
//	vars = {
40
//		vnag_file_timestamp_file = [ "/backup/automatic/timestamps/ts_daily_rsync", "/backup/automatic/timestamps/ts_daily_mysqldump" ]
41
//		vnag_file_timestamp_warn = "86400s"   // 24h
42
//		vnag_file_timestamp_crit = "144000s"  // 40h
43
//		vnag_file_timestamp_verbose = false
44
//	}
45
//	assign where host.name == NodeName
46
// }
47
//
48
// apply Service "example_3month_backup_timestamp" {
49
//	import "generic-service"
50
//	check_command = "vnag_file_timestamp"
51
//	vars = {
52
//		vnag_file_timestamp_file = [ "/backup/automatic/timestamps/ts_raspberry_rsync" ]
53
//		vnag_file_timestamp_warn = "7776000s"   // 3 Months
54
//		vnag_file_timestamp_crit = "15552000s"  // 6 Months
55
//		vnag_file_timestamp_verbose = false
56
//	}
57
//	assign where host.name == NodeName
58
// }
59
//
60
// apply Service "example_downloader_timestamp" {
61
//	import "generic-service"
62
//	check_command = "vnag_file_timestamp"
63
//	// the prepending hashtag means 'check only the youngest file'
64
//	vars = {
65
//		vnag_file_timestamp_file = [ "#/home/test/my_downloader/downloaded_files/*.jpg" ]
66
//		vnag_file_timestamp_warn = "86400s"   // 24h
67
//		vnag_file_timestamp_crit = "144000s"  // 40h
68
//		vnag_file_timestamp_verbose = false
69
//	}
70
//	assign where host.name == NodeName
71
// }