Rev 50 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 50 | Rev 53 | ||
---|---|---|---|
1 | // Put this file in /etc/icinga2/conf.d/... |
1 | // Put this file in /etc/icinga2/conf.d/... |
2 | 2 | ||
3 | // VNag - Nagios Framework for PHP |
3 | // VNag - Nagios Framework for PHP |
4 | // Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com> |
4 | // Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com> |
5 | // Licensed under the terms of the Apache 2.0 license |
5 | // Licensed under the terms of the Apache 2.0 license |
6 | // |
6 | // |
7 | // Revision 2022-05-12 |
7 | // Revision 2022-05-12 |
8 | 8 | ||
- | 9 | // ATTENTION! |
|
- | 10 | // To make this work, you need to add following to /etc/sudoers (adjust the paths) |
|
- | 11 | // nagios ALL=(root) NOPASSWD:/daten/vnag/plugins/smart/check_smart |
|
- | 12 | // You MUST make sure that the script check_hp_smartarray and all other VNag scripts are |
|
- | 13 | // owned by root, otherwise the owner could change the code, and it would be executed with |
|
- | 14 | // root privileges! |
|
- | 15 | ||
9 | object CheckCommand "vnag_smart" { |
16 | object CheckCommand "vnag_smart" { |
- | 17 | command = [ |
|
- | 18 | "/usr/bin/sudo", |
|
- | 19 | ||
10 | // PLEASE ADJUST THIS PATH |
20 | // PLEASE ADJUST THIS PATH |
11 | command = [ "/daten/vnag/plugins/smart/check_smart" ] |
21 | "/daten/vnag/plugins/smart/check_smart" |
- | 22 | ] |
|
12 | 23 | ||
13 | arguments = { |
24 | arguments = { |
14 | "-v" = { |
25 | "-v" = { |
15 | set_if = "$vnag_smart_verbose$" |
26 | set_if = "$vnag_smart_verbose$" |
16 | description = "Additionally list drives which are OK, not just the drives which have failed." |
27 | description = "Additionally list drives which are OK, not just the drives which have failed." |
17 | } |
28 | } |
18 | "-T" = { |
29 | "-T" = { |
19 | set_if = "$vnag_smart_type$" |
30 | set_if = "$vnag_smart_type$" |
20 | description = "Explicit drive type e.g. for RAID devices 'sat+cciss,0' for drive 0." |
31 | description = "Explicit drive type e.g. for RAID devices 'sat+cciss,0' for drive 0." |
21 | } |
32 | } |
22 | } |
33 | } |
23 | } |
34 | } |
24 | 35 | ||
25 | // Example usage: |
36 | // Example usage: |
26 | // |
37 | // |
27 | // apply Service "example_smart" { |
38 | // apply Service "example_smart" { |
28 | // import "generic-service" |
39 | // import "generic-service" |
29 | // check_command = "vnag_smart" |
40 | // check_command = "vnag_smart" |
30 | // vars = { |
41 | // vars = { |
31 | // vnag_smart_verbose = false |
42 | // vnag_smart_verbose = false |
32 | // } |
43 | // } |
33 | // assign where host.name == NodeName |
44 | // assign where host.name == NodeName |
34 | // } |
45 | // } |
35 | // |
46 | // |
36 | // apply Service "example_smart_raid" { |
47 | // apply Service "example_smart_raid" { |
37 | // import "generic-service" |
48 | // import "generic-service" |
38 | // check_command = "vnag_smart" |
49 | // check_command = "vnag_smart" |
39 | // vars = { |
50 | // vars = { |
40 | // vnag_smart_verbose = false |
51 | // vnag_smart_verbose = false |
41 | // vnag_smart_type = "sat+cciss,0" |
52 | // vnag_smart_type = "sat+cciss,0" |
42 | // } |
53 | // } |
43 | // assign where host.name == NodeName |
54 | // assign where host.name == NodeName |
44 | // } |
55 | // } |