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-10-01
8
 
9
object CheckCommand "vnag_last" {
10
	command = [ "/daten/vnag/plugins/last/check_last" ]
11
 
12
	arguments = {
13
		"-u" = {
14
			value = "$vnag_last_user$"
15
			description = "The Linux username. If the argument is missing, all users will be checked."		
16
		}
17
		"-R" = {
18
			value = "$vnag_last_regex$"
19
			description = "The regular expression (in PHP: preg_match) which is applied on IP, Hostname, Country, AS number or ISP name. If the regular expression matches, the login will be accepted, otherweise an alert will be triggered. Example: /^DE$/ismU or /Telekom/ismU"		
20
		}
21
		"-v" = {
22
			set_if = "$vnag_last_verbose$"
23
			description = "Additionally list logins which are OK, not just the logins which are suspicious."
24
		}
25
		"-f" = {
26
			value = "$vnag_last_wtmp_file_mask$"
27
			description = "Filemask of the wtmp file (important if you use logrotate), e.g. '/var/log/wtmp*'"
28
		}
29
		"-e" = {
30
			set_if = "$vnag_last_emptyok$"
31
			description = "Treat an empty result (e.g. empty wtmp file after rotation) as success; otherwise treat it as status 'Unknown'"
32
		}
33
		"--ipInfoToken" = {
34
			value = "$vnag_ipinfo_token$"
35
			description = "If you have a token for ipinfo.io, please enter it here. Without token, you can query the service approx 1,000 times per day (which should be enough)"
36
		}
37
	}
38
}
39
 
40
// Example usage:
41
//
42
// apply Service "example_john_logins" {
43
//	import "generic-service"
44
//	check_command = "vnag_last"
45
//	vars = {
46
//		vnag_last_user = "john"
47
//		vnag_last_regex = "/Telekom/ismU"
48
//		vnag_last_wtmp_file_mask = "/var/log/wtmp*"
49
//              vnag_last_emptyok = true
50
//	}
51
//	assign where host.name == NodeName
52
// }
53
// apply Service "example_mike_logins" {
54
//	import "generic-service"
55
//	check_command = "vnag_last"
56
//	vars = {
57
//		vnag_last_user = "mike"
58
//		vnag_last_regex = "/\\.unitymediagroup\\.de/ismU"
59
//		vnag_last_wtmp_file_mask = "/var/log/wtmp*"
60
//              vnag_last_emptyok = false
61
//	}
62
//	assign where host.name == NodeName
63
// }