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' |
42 resource 'load', description: 'machine load' do |
|
43 config load_error_at: 5 |
|
44 end |
43 end |
45 end |
44 |
46 |
45 |
47 |
46 From a monitor file, require this library, and create an snmp instance. |
48 From a monitor file, require this library, and create an snmp instance. |
47 You can reuse a single instance, or create individual ones per monitor. |
49 You can reuse a single instance, or create individual ones per monitor. |
48 |
|
49 |
50 |
50 require 'arborist/monitor/snmp' |
51 require 'arborist/monitor/snmp' |
51 |
52 |
52 Arborist::Monitor '5 minute load average check' do |
53 Arborist::Monitor '5 minute load average check' do |
53 every 30.seconds |
54 every 30.seconds |
57 |
58 |
58 snmp = Arborist::Monitor::SNMP.new( mode: 'load', load_error_at: 10 ) |
59 snmp = Arborist::Monitor::SNMP.new( mode: 'load', load_error_at: 10 ) |
59 exec( snmp ) |
60 exec( snmp ) |
60 end |
61 end |
61 |
62 |
62 Please see the rdoc for all the mode types and error_at options. |
63 Please see the rdoc for all the mode types and error_at options. Per |
|
64 node "config" vars override global defaults when instantiating the |
|
65 monitor. |
63 |
66 |
64 |
67 |
65 ## License |
68 ## License |
66 |
69 |
67 Copyright (c) 2016, Michael Granger and Mahlon E. Smith |
70 Copyright (c) 2016, Michael Granger and Mahlon E. Smith |