equal
deleted
inserted
replaced
37 In this example, we've created a resource node under an existing host, like so: |
37 In this example, we've created a resource node under an existing host, like so: |
38 |
38 |
39 Arborist::Host( 'example' ) do |
39 Arborist::Host( 'example' ) do |
40 description "Example host" |
40 description "Example host" |
41 address '10.6.0.169' |
41 address '10.6.0.169' |
42 resource 'load', description: 'machine load' do |
42 resource 'load', description: 'machine load' |
43 config load_error_at: 5 |
43 resource 'disk' do |
|
44 include: [ '/', '/mnt' ] |
44 end |
45 end |
45 end |
46 end |
46 |
47 |
47 |
48 |
48 From a monitor file, require this library, and create an snmp instance. |
49 From a monitor file, require this library, and create an snmp instance. |
54 every 30.seconds |
55 every 30.seconds |
55 match type: 'resource', category: 'load' |
56 match type: 'resource', category: 'load' |
56 include_down true |
57 include_down true |
57 use :addresses |
58 use :addresses |
58 |
59 |
59 snmp = Arborist::Monitor::SNMP.new( mode: 'load', load_error_at: 10 ) |
60 snmp = Arborist::Monitor::SNMP::Load( error_at: 10 ) |
60 exec( snmp ) |
61 exec( snmp ) |
61 end |
62 end |
|
63 |
|
64 Arborist::Monitor 'mount capacity check' do |
|
65 every 30.seconds |
|
66 match type: 'resource', category: 'load' |
|
67 include_down true |
|
68 use :addresses, :config |
|
69 |
|
70 exec( Arborist::Monitor::SNMP::Disk ) |
|
71 end |
|
72 |
62 |
73 |
63 Please see the rdoc for all the mode types and error_at options. Per |
74 Please see the rdoc for all the mode types and error_at options. Per |
64 node "config" vars override global defaults when instantiating the |
75 node "config" vars override global defaults when instantiating the |
65 monitor. |
76 monitor. |
|
77 |
66 |
78 |
67 |
79 |
68 ## License |
80 ## License |
69 |
81 |
70 Copyright (c) 2016, Michael Granger and Mahlon E. Smith |
82 Copyright (c) 2016, Michael Granger and Mahlon E. Smith |