Rev 50 | Go to most recent revision | Details | Compare with Previous | 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 | // |
||
50 | daniel-mar | 7 | // Revision 2022-05-12 |
2 | daniel-mar | 8 | |
53 | daniel-mar | 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 | |||
2 | daniel-mar | 16 | object CheckCommand "vnag_smart" { |
53 | daniel-mar | 17 | command = [ |
18 | "/usr/bin/sudo", |
||
2 | daniel-mar | 19 | |
53 | daniel-mar | 20 | // PLEASE ADJUST THIS PATH |
21 | "/daten/vnag/plugins/smart/check_smart" |
||
22 | ] |
||
23 | |||
2 | daniel-mar | 24 | arguments = { |
25 | "-v" = { |
||
26 | set_if = "$vnag_smart_verbose$" |
||
27 | description = "Additionally list drives which are OK, not just the drives which have failed." |
||
28 | } |
||
50 | daniel-mar | 29 | "-T" = { |
30 | set_if = "$vnag_smart_type$" |
||
31 | description = "Explicit drive type e.g. for RAID devices 'sat+cciss,0' for drive 0." |
||
32 | } |
||
2 | daniel-mar | 33 | } |
34 | } |
||
35 | |||
36 | // Example usage: |
||
37 | // |
||
38 | // apply Service "example_smart" { |
||
39 | // import "generic-service" |
||
40 | // check_command = "vnag_smart" |
||
41 | // vars = { |
||
42 | // vnag_smart_verbose = false |
||
43 | // } |
||
44 | // assign where host.name == NodeName |
||
45 | // } |
||
50 | daniel-mar | 46 | // |
47 | // apply Service "example_smart_raid" { |
||
48 | // import "generic-service" |
||
49 | // check_command = "vnag_smart" |
||
50 | // vars = { |
||
51 | // vnag_smart_verbose = false |
||
52 | // vnag_smart_type = "sat+cciss,0" |
||
53 | // } |
||
54 | // assign where host.name == NodeName |
||
55 | // } |