opsview_rest 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +67 -0
- data/.travis.yml +1 -6
- data/Gemfile +0 -2
- data/Rakefile +3 -3
- data/lib/opsview_rest.rb +29 -34
- data/lib/opsview_rest/attribute.rb +10 -12
- data/lib/opsview_rest/contact.rb +45 -47
- data/lib/opsview_rest/host.rb +52 -54
- data/lib/opsview_rest/hostcheckcommand.rb +9 -11
- data/lib/opsview_rest/hostgroup.rb +7 -9
- data/lib/opsview_rest/hosttemplate.rb +7 -9
- data/lib/opsview_rest/keyword.rb +17 -19
- data/lib/opsview_rest/mixin.rb +8 -10
- data/lib/opsview_rest/monitoringserver.rb +11 -13
- data/lib/opsview_rest/notificationmethod.rb +9 -11
- data/lib/opsview_rest/role.rb +19 -21
- data/lib/opsview_rest/servicecheck.rb +31 -33
- data/lib/opsview_rest/servicegroup.rb +5 -7
- data/lib/opsview_rest/timeperiod.rb +19 -21
- data/opsview_rest.gemspec +16 -16
- data/spec/opsview_rest_spec.rb +42 -27
- data/spec/spec_helper.rb +2 -2
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c47caceb6cf6996f1ada216cbb64020cd89e2bf7
|
4
|
+
data.tar.gz: e5e4436ee08118e4817fca3a22a7f3ce2c6dbe09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c084a5bb41b5a44f3201d9de19d9ece0775dc6678a0adb73479eac5427026147436953273aa4b6ec5b4edc04158f4c887e6c9e9c2ec237f5c60a17347d6782
|
7
|
+
data.tar.gz: da10bb0f01385b8b2a19c9fb63ee067fc6439b607bbc7993bdda4404d1f523f4a252ea20b343cbb088d2d4d25640ae7008153e022e7e91585e5c62916a8d4e68
|
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2016-11-05 11:16:12 +0000 using RuboCop version 0.39.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Lint/UnreachableCode:
|
11
|
+
Exclude:
|
12
|
+
- 'lib/opsview_rest.rb'
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
Lint/UselessAssignment:
|
16
|
+
Exclude:
|
17
|
+
- 'spec/opsview_rest_spec.rb'
|
18
|
+
|
19
|
+
# Offense count: 7
|
20
|
+
Metrics/AbcSize:
|
21
|
+
Max: 31
|
22
|
+
|
23
|
+
# Offense count: 1
|
24
|
+
# Configuration parameters: CountComments.
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Max: 144
|
27
|
+
|
28
|
+
# Offense count: 3
|
29
|
+
Metrics/CyclomaticComplexity:
|
30
|
+
Max: 14
|
31
|
+
|
32
|
+
# Offense count: 39
|
33
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
34
|
+
# URISchemes: http, https
|
35
|
+
Metrics/LineLength:
|
36
|
+
Max: 190
|
37
|
+
|
38
|
+
# Offense count: 15
|
39
|
+
# Configuration parameters: CountComments.
|
40
|
+
Metrics/MethodLength:
|
41
|
+
Max: 57
|
42
|
+
|
43
|
+
# Offense count: 5
|
44
|
+
Metrics/PerceivedComplexity:
|
45
|
+
Max: 14
|
46
|
+
|
47
|
+
# Offense count: 15
|
48
|
+
Style/Documentation:
|
49
|
+
Exclude:
|
50
|
+
- 'spec/**/*'
|
51
|
+
- 'test/**/*'
|
52
|
+
- 'lib/opsview_rest.rb'
|
53
|
+
- 'lib/opsview_rest/attribute.rb'
|
54
|
+
- 'lib/opsview_rest/contact.rb'
|
55
|
+
- 'lib/opsview_rest/host.rb'
|
56
|
+
- 'lib/opsview_rest/hostcheckcommand.rb'
|
57
|
+
- 'lib/opsview_rest/hostgroup.rb'
|
58
|
+
- 'lib/opsview_rest/hosttemplate.rb'
|
59
|
+
- 'lib/opsview_rest/keyword.rb'
|
60
|
+
- 'lib/opsview_rest/mixin.rb'
|
61
|
+
- 'lib/opsview_rest/monitoringserver.rb'
|
62
|
+
- 'lib/opsview_rest/notificationmethod.rb'
|
63
|
+
- 'lib/opsview_rest/role.rb'
|
64
|
+
- 'lib/opsview_rest/servicecheck.rb'
|
65
|
+
- 'lib/opsview_rest/servicegroup.rb'
|
66
|
+
- 'lib/opsview_rest/timeperiod.rb'
|
67
|
+
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
3
|
|
4
|
-
#encoding: utf-8
|
4
|
+
# encoding: utf-8
|
5
5
|
require 'rubygems'
|
6
6
|
require 'bundler'
|
7
7
|
Bundler.setup
|
@@ -10,13 +10,13 @@ Bundler::GemHelper.install_tasks
|
|
10
10
|
require 'rspec/core/rake_task'
|
11
11
|
RSpec::Core::RakeTask.new(:spec)
|
12
12
|
|
13
|
-
task :
|
13
|
+
task default: :spec
|
14
14
|
|
15
15
|
begin
|
16
16
|
require 'yard'
|
17
17
|
YARD::Rake::YardocTask.new
|
18
18
|
rescue LoadError
|
19
19
|
task :yardoc do
|
20
|
-
abort
|
20
|
+
abort 'YARD is not available. In order to run yardoc, you must: sudo gem install yard'
|
21
21
|
end
|
22
22
|
end
|
data/lib/opsview_rest.rb
CHANGED
@@ -2,26 +2,25 @@ require 'rest-client'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
class OpsviewRest
|
5
|
-
|
6
5
|
attr_accessor :url, :username, :password, :rest
|
7
6
|
|
8
7
|
def initialize(url, options = {})
|
9
8
|
options = {
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
9
|
+
username: 'api',
|
10
|
+
password: 'changeme',
|
11
|
+
connect: true
|
13
12
|
}.update options
|
14
13
|
|
15
14
|
@url = url
|
16
15
|
@username = options[:username]
|
17
16
|
@password = options[:password]
|
18
|
-
@rest = RestClient::Resource.new("#{@url}/rest/", :
|
17
|
+
@rest = RestClient::Resource.new("#{@url}/rest/", headers: { content_type: 'application/json' })
|
19
18
|
|
20
19
|
login if options[:connect]
|
21
20
|
end
|
22
21
|
|
23
22
|
def login
|
24
|
-
response = post('login',
|
23
|
+
response = post('login', 'username' => @username, 'password' => @password)
|
25
24
|
@rest.headers[:x_opsview_token] = response['token']
|
26
25
|
@rest.headers[:x_opsview_username] = @username
|
27
26
|
response
|
@@ -73,40 +72,38 @@ class OpsviewRest
|
|
73
72
|
require 'opsview_rest/timeperiod'
|
74
73
|
OpsviewRest::Timeperiod.new(self, options)
|
75
74
|
else
|
76
|
-
raise
|
75
|
+
raise 'Type not implemented yet.'
|
77
76
|
end
|
78
77
|
end
|
79
78
|
|
80
79
|
def list(options = {})
|
81
80
|
options = {
|
82
|
-
:
|
83
|
-
:
|
81
|
+
type: 'host',
|
82
|
+
rows: 'all'
|
84
83
|
}.update options
|
85
84
|
|
86
85
|
get("config/#{options[:type]}?rows=#{options[:rows]}")
|
87
86
|
end
|
88
87
|
|
89
88
|
def reload
|
90
|
-
get(
|
89
|
+
get('reload')
|
91
90
|
end
|
92
91
|
|
93
92
|
def initiate_reload
|
94
|
-
post(
|
93
|
+
post('reload', {})
|
95
94
|
end
|
96
95
|
|
97
96
|
def find(options = {})
|
98
97
|
options = {
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
98
|
+
type: nil,
|
99
|
+
rows: 'all',
|
100
|
+
searchattribute: nil
|
102
101
|
}.update options
|
103
102
|
|
104
|
-
if options[:searchattribute].nil?
|
105
|
-
|
106
|
-
end
|
107
|
-
|
103
|
+
options[:searchattribute] = 'name' if options[:searchattribute].nil?
|
104
|
+
|
108
105
|
if options[:name].nil?
|
109
|
-
raise ArgumentError,
|
106
|
+
raise ArgumentError, 'Need to specify the name of the object.'
|
110
107
|
else
|
111
108
|
get("config/#{options[:type]}?s.#{options[:searchattribute]}=#{options[:name]}&rows=#{options[:rows]}")
|
112
109
|
end
|
@@ -114,14 +111,14 @@ class OpsviewRest
|
|
114
111
|
|
115
112
|
def purge(options = {})
|
116
113
|
options = {
|
117
|
-
:
|
118
|
-
:
|
114
|
+
type: 'host',
|
115
|
+
name: nil
|
119
116
|
}.update options
|
120
117
|
|
121
118
|
if options[:name].nil?
|
122
|
-
raise ArgumentError,
|
119
|
+
raise ArgumentError, 'Need to specify the name of the object.'
|
123
120
|
else
|
124
|
-
id = find(:
|
121
|
+
id = find(type: options[:type], name: options[:name])[0]['id']
|
125
122
|
delete("config/#{options[:type]}/#{id}")
|
126
123
|
end
|
127
124
|
end
|
@@ -142,15 +139,13 @@ class OpsviewRest
|
|
142
139
|
api_request { @rest[path_part].put(payload.to_json, additional_headers, &block) }
|
143
140
|
end
|
144
141
|
|
145
|
-
def api_request
|
142
|
+
def api_request
|
146
143
|
response_body = begin
|
147
|
-
response =
|
144
|
+
response = yield
|
148
145
|
response.body
|
149
146
|
rescue RestClient::Exception => e
|
150
147
|
raise "I have #{e.inspect} with #{e.http_code}"
|
151
|
-
if e.http_code == 307
|
152
|
-
get(e.response)
|
153
|
-
end
|
148
|
+
get(e.response) if e.http_code == 307
|
154
149
|
e.response
|
155
150
|
end
|
156
151
|
parse_response(JSON.parse(response_body))
|
@@ -159,16 +154,16 @@ class OpsviewRest
|
|
159
154
|
def parse_response(response)
|
160
155
|
# We've got an error if there's "message" and "detail" fields
|
161
156
|
# in the response
|
162
|
-
if response[
|
163
|
-
raise Opsview::Exceptions::RequestFailed, "Request failed: #{response[
|
157
|
+
if response['message'] && response['detail']
|
158
|
+
raise Opsview::Exceptions::RequestFailed, "Request failed: #{response['message']}, detail: #{response['detail']}"
|
164
159
|
# If we have a token, return that:
|
165
|
-
elsif response[
|
160
|
+
elsif response['token']
|
166
161
|
response
|
167
162
|
# If we have a list of objects, return the list:
|
168
|
-
elsif response[
|
169
|
-
response[
|
163
|
+
elsif response['list']
|
164
|
+
response['list']
|
170
165
|
else
|
171
|
-
response[
|
166
|
+
response['object']
|
172
167
|
end
|
173
168
|
end
|
174
169
|
end
|
@@ -2,31 +2,29 @@ require 'opsview_rest/mixin'
|
|
2
2
|
|
3
3
|
class OpsviewRest
|
4
4
|
class Attribute
|
5
|
-
|
6
5
|
include OpsviewRest::Mixin
|
7
6
|
|
8
7
|
attr_accessor :options, :opsview, :resource_type
|
9
8
|
|
10
9
|
def initialize(opsview, options = {})
|
11
10
|
@options = {
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
11
|
+
name: 'PROCESSES',
|
12
|
+
arg1: '',
|
13
|
+
arg2: '',
|
14
|
+
arg3: '',
|
15
|
+
arg4: '',
|
16
|
+
value: '',
|
17
|
+
servicechecks: [],
|
18
|
+
save: true,
|
19
|
+
replace: false
|
21
20
|
}.update options
|
22
21
|
|
23
22
|
@opsview = opsview
|
24
23
|
@resource_type = @options[:type]
|
25
24
|
|
26
|
-
@options[:servicechecks] = @options[:servicechecks].map { |x| {
|
25
|
+
@options[:servicechecks] = @options[:servicechecks].map { |x| { 'name' => x } }
|
27
26
|
|
28
27
|
save(@options[:replace]) if @options[:save]
|
29
28
|
end
|
30
|
-
|
31
29
|
end
|
32
30
|
end
|
data/lib/opsview_rest/contact.rb
CHANGED
@@ -2,70 +2,68 @@ require 'opsview_rest/mixin'
|
|
2
2
|
|
3
3
|
class OpsviewRest
|
4
4
|
class Contact
|
5
|
-
|
6
5
|
include OpsviewRest::Mixin
|
7
6
|
|
8
7
|
attr_accessor :options, :opsview, :resource_type
|
9
8
|
|
10
9
|
def initialize(opsview, options = {})
|
11
10
|
@options = {
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
{ :
|
21
|
-
{ :
|
22
|
-
{ :
|
23
|
-
{ :
|
11
|
+
name: 'foobar',
|
12
|
+
fullname: '',
|
13
|
+
description: '',
|
14
|
+
encrypted_password: '$apr1$HTQogYE7$09TNcZWa/WzoBXdUF6Iyr1',
|
15
|
+
realm: 'local',
|
16
|
+
language: '',
|
17
|
+
role: 'View all, change none',
|
18
|
+
variables: [
|
19
|
+
{ value: '', name: 'EMAIL' },
|
20
|
+
{ value: 1, name: 'RSS_COLLAPSED' },
|
21
|
+
{ value: 1440, name: 'RSS_MAXIMUM_AGE' },
|
22
|
+
{ value: 30, name: 'RSS_MAXIMUM_ITEMS' }
|
24
23
|
],
|
25
|
-
:
|
26
|
-
{ :
|
27
|
-
:
|
28
|
-
:
|
29
|
-
{ :
|
24
|
+
notificationprofiles: [
|
25
|
+
{ name: '24x7',
|
26
|
+
host_notification_options: 'u,d,r,f',
|
27
|
+
notificationmethods: [
|
28
|
+
{ name: 'Email' }
|
30
29
|
],
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
{ :
|
40
|
-
:
|
41
|
-
:
|
42
|
-
{ :
|
30
|
+
servicegroups: [],
|
31
|
+
all_servicegroups: 1,
|
32
|
+
all_hostgroups: 0,
|
33
|
+
keywords: [],
|
34
|
+
service_notification_options: 'w,c,r,u,f',
|
35
|
+
hostgroups: [],
|
36
|
+
notification_level: 1,
|
37
|
+
notification_period: { name: '24x7' } },
|
38
|
+
{ name: '8x5',
|
39
|
+
host_notification_options: 'u,d,r,f',
|
40
|
+
notificationmethods: [
|
41
|
+
{ name: 'Email' }
|
43
42
|
],
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
43
|
+
servicegroups: [],
|
44
|
+
all_servicegroups: 1,
|
45
|
+
all_hostgroups: 0,
|
46
|
+
keywords: [],
|
47
|
+
service_notification_options: 'w,c,r,u,f',
|
48
|
+
hostgroups: [],
|
49
|
+
notification_level: 1,
|
50
|
+
notification_period: { name: 'workhours' } }
|
52
51
|
],
|
53
|
-
:
|
54
|
-
:
|
52
|
+
save: true,
|
53
|
+
replace: false
|
55
54
|
}.update options
|
56
55
|
|
57
56
|
@opsview = opsview
|
58
57
|
@resource_type = @options[:type]
|
59
58
|
|
60
|
-
@options[:all_servicegroups] =
|
61
|
-
@options[:all_hostgroups] =
|
62
|
-
@options[:servicegroups] = @options[:servicegroups].map { |x| {
|
63
|
-
@options[:keywords] = @options[:keywords].map { |x| {
|
64
|
-
@options[:hostgroups] = @options[:hostgroups].map { |x| {
|
65
|
-
@options[:role] = {
|
59
|
+
@options[:all_servicegroups] = (@options[:all_servicegroups] ? 1 : 0)
|
60
|
+
@options[:all_hostgroups] = (@options[:all_hostgroups] ? 1 : 0)
|
61
|
+
@options[:servicegroups] = @options[:servicegroups].map { |x| { 'name' => x } } unless @options[:servicegroups].nil?
|
62
|
+
@options[:keywords] = @options[:keywords].map { |x| { 'name' => x } } unless @options[:keywords].nil?
|
63
|
+
@options[:hostgroups] = @options[:hostgroups].map { |x| { 'name' => x } } unless @options[:hostgroups].nil?
|
64
|
+
@options[:role] = { 'name' => @options[:role] }
|
66
65
|
|
67
66
|
save(@options[:replace]) if @options[:save]
|
68
67
|
end
|
69
|
-
|
70
68
|
end
|
71
69
|
end
|
data/lib/opsview_rest/host.rb
CHANGED
@@ -2,7 +2,6 @@ require 'opsview_rest/mixin'
|
|
2
2
|
|
3
3
|
class OpsviewRest
|
4
4
|
class Host
|
5
|
-
|
6
5
|
include OpsviewRest::Mixin
|
7
6
|
|
8
7
|
attr_accessor :options, :opsview, :resource_type
|
@@ -10,46 +9,46 @@ class OpsviewRest
|
|
10
9
|
def initialize(opsview, options = {})
|
11
10
|
# Default set of attributes to send to Opsview:
|
12
11
|
@options = {
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
12
|
+
flap_detection_enabled: false,
|
13
|
+
snmpv3_privprotocol: nil,
|
14
|
+
hosttemplates: [],
|
15
|
+
keywords: [],
|
16
|
+
check_period: '24x7',
|
17
|
+
hostattributes: [],
|
18
|
+
notification_period: '24x7',
|
19
|
+
name: 'unknown',
|
20
|
+
rancid_vendor: nil,
|
21
|
+
snmp_community: 'public',
|
22
|
+
hostgroup: 'Unknown',
|
23
|
+
enable_snmp: false,
|
24
|
+
monitored_by: 'Master Monitoring Server',
|
25
|
+
alias: 'Managed Host',
|
26
|
+
uncommitted: false,
|
27
|
+
parents: [],
|
28
|
+
icon: { 'name' => 'LOGO - Opsview' },
|
29
|
+
retry_check_interval: 1,
|
30
|
+
ip: 'localhost',
|
31
|
+
use_mrtg: false,
|
32
|
+
servicechecks: [],
|
33
|
+
use_rancid: false,
|
34
|
+
nmis_node_type: 'router',
|
35
|
+
snmp_version: '2c',
|
36
|
+
snmp_authpassword: '',
|
37
|
+
use_nmis: false,
|
38
|
+
rancid_connection_type: 'ssh',
|
39
|
+
snmpv3_authprotocol: nil,
|
40
|
+
rancid_username: nil,
|
41
|
+
rancid_password: nil,
|
42
|
+
check_command: 'ping',
|
43
|
+
check_attempts: 2,
|
44
|
+
check_interval: 0,
|
45
|
+
notification_interval: 60,
|
46
|
+
snmp_port: 161,
|
47
|
+
snmpv3_username: '',
|
48
|
+
snmpv3_privpassword: '',
|
49
|
+
other_addresses: '',
|
50
|
+
save: true,
|
51
|
+
replace: false
|
53
52
|
}.update options
|
54
53
|
|
55
54
|
@opsview = opsview
|
@@ -57,21 +56,20 @@ class OpsviewRest
|
|
57
56
|
|
58
57
|
# Add any weird exceptions here (like hostgroups having to be mapped
|
59
58
|
# to "name" => hostgroup, etc.):
|
60
|
-
@options[:flap_detection_enabled] =
|
61
|
-
@options[:enable_snmp] =
|
62
|
-
@options[:use_mrtg] =
|
63
|
-
@options[:use_rancid] =
|
64
|
-
@options[:use_nmis] =
|
65
|
-
@options[:uncommitted] =
|
66
|
-
@options[:check_period] = {
|
67
|
-
@options[:hostgroup] = {
|
68
|
-
@options[:notification_period] = {
|
69
|
-
@options[:monitored_by] = {
|
70
|
-
@options[:servicechecks] = @options[:servicechecks].map { |x| {
|
71
|
-
@options[:check_command] = {
|
59
|
+
@options[:flap_detection_enabled] = (@options[:flap_detection_enabled] ? 1 : 0)
|
60
|
+
@options[:enable_snmp] = (@options[:enable_snmp] ? 1 : 0)
|
61
|
+
@options[:use_mrtg] = (@options[:use_mrtg] ? 1 : 0)
|
62
|
+
@options[:use_rancid] = (@options[:use_rancid] ? 1 : 0)
|
63
|
+
@options[:use_nmis] = (@options[:use_nmis] ? 1 : 0)
|
64
|
+
@options[:uncommitted] = (@options[:uncommitted] ? 1 : 0)
|
65
|
+
@options[:check_period] = { 'name' => @options[:check_period] }
|
66
|
+
@options[:hostgroup] = { 'name' => @options[:hostgroup] }
|
67
|
+
@options[:notification_period] = { 'name' => @options[:notification_period] }
|
68
|
+
@options[:monitored_by] = { 'name' => @options[:monitored_by] }
|
69
|
+
@options[:servicechecks] = @options[:servicechecks].map { |x| { 'name' => x } }
|
70
|
+
@options[:check_command] = { 'name' => @options[:check_command] }
|
72
71
|
|
73
72
|
save(@options[:replace]) if @options[:save]
|
74
73
|
end
|
75
|
-
|
76
74
|
end
|
77
75
|
end
|