Rev 80 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
80 | 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 2023-10-14 |
||
8 | |||
9 | object CheckCommand "vnag_last" { |
||
10 | // PLEASE ADJUST THIS PATH |
||
11 | command = [ "/daten/vnag/bin/last.phar" ] |
||
12 | |||
13 | arguments = { |
||
14 | "-u" = { |
||
15 | value = "$vnag_last_user$" |
||
16 | description = "The Linux username. If the argument is missing, all users will be checked." |
||
17 | } |
||
18 | "-R" = { |
||
19 | value = "$vnag_last_regex$" |
||
20 | 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" |
||
21 | } |
||
22 | "-v" = { |
||
23 | set_if = "$vnag_last_verbose$" |
||
24 | description = "Additionally list logins which are OK, not just the logins which are suspicious." |
||
25 | } |
||
26 | "-f" = { |
||
27 | value = "$vnag_last_wtmp_file_mask$" |
||
28 | description = "Filemask of the wtmp file (important if you use logrotate), e.g. '/var/log/wtmp*'" |
||
29 | } |
||
30 | "-e" = { |
||
31 | set_if = "$vnag_last_emptyok$" |
||
32 | description = "Treat an empty result (e.g. empty wtmp file after rotation) as success; otherwise treat it as status 'Unknown'" |
||
33 | } |
||
34 | "--ipInfoToken" = { |
||
35 | value = "$vnag_ipinfo_token$" |
||
36 | 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)" |
||
37 | } |
||
38 | } |
||
39 | } |
||
40 | |||
41 | // Example usage: |
||
42 | // |
||
43 | // apply Service "example_john_logins" { |
||
44 | // import "generic-service" |
||
45 | // check_command = "vnag_last" |
||
46 | // vars = { |
||
47 | // vnag_last_user = "john" |
||
48 | // vnag_last_regex = "/Telekom/ismU" |
||
49 | // vnag_last_wtmp_file_mask = "/var/log/wtmp*" |
||
50 | // vnag_last_emptyok = true |
||
51 | // } |
||
52 | // assign where host.name == NodeName |
||
53 | // } |
||
54 | // apply Service "example_mike_logins" { |
||
55 | // import "generic-service" |
||
56 | // check_command = "vnag_last" |
||
57 | // vars = { |
||
58 | // vnag_last_user = "mike" |
||
59 | // vnag_last_regex = "/\\.unitymediagroup\\.de/ismU" |
||
60 | // vnag_last_wtmp_file_mask = "/var/log/wtmp*" |
||
61 | // vnag_last_emptyok = false |
||
62 | // } |
||
63 | // assign where host.name == NodeName |
||
64 | // } |