logstash-input-attunity-metrics 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/attunity_metrics.rb +35 -39
- data/logstash-input-attunity-metrics.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 921b36c6e48d0e28feb55d4745f9b7a010da58ee3485dc8a31ba9420875459b7
|
4
|
+
data.tar.gz: 14f4088a4ff7b8a238343e17cc458c2016e60f3617b7e33eb026f7b989a28fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b91328928a2745d1313a9c855d2136f164c0be580ae14ff01de84fe96deb05c43bf6dc5effcb81b38db79f3d1a6511df3a7f9df4253e96b0a231a96660e37c
|
7
|
+
data.tar.gz: 79720ae65f80531392bf1d0dec68a138b89a8602d41e07ea474c2cbb414ffd21017478f906a955a5b315c480641eb1e013828ee90d111979ce465f0ed70b1890
|
@@ -22,17 +22,8 @@ class LogStash::Inputs::Attunity_Metrics < LogStash::Inputs::Base
|
|
22
22
|
|
23
23
|
config: verify_ssl, :validate => :bool, :default => true
|
24
24
|
|
25
|
-
# The message string to use in the event.
|
26
|
-
config :message, :validate => :string, :default => "Hello World!"
|
27
|
-
|
28
|
-
# Set how frequently messages should be sent.
|
29
|
-
#
|
30
|
-
# The default, `1`, means send a message every second.
|
31
|
-
config :interval, :validate => :number, :default => 1
|
32
|
-
|
33
25
|
public
|
34
26
|
def register
|
35
|
-
@host = Socket.gethostname
|
36
27
|
|
37
28
|
@header = {
|
38
29
|
:content_type => "application/json",
|
@@ -40,21 +31,26 @@ class LogStash::Inputs::Attunity_Metrics < LogStash::Inputs::Base
|
|
40
31
|
:password => @password
|
41
32
|
}
|
42
33
|
|
43
|
-
@client = resource = RestClient::Resource.new
|
44
|
-
|
34
|
+
@client = resource = RestClient::Resource.new(
|
35
|
+
@url,
|
36
|
+
:verify_ssl => OpenSSL::SSL::VERIFY_NONE
|
37
|
+
)
|
38
|
+
|
39
|
+
@logger.info("Registering attunity_metrics", :url => @url, :user => @username, :password => @password, :verify_ssl => @verify_ssl)
|
40
|
+
end
|
45
41
|
|
46
42
|
def run(queue)
|
47
43
|
# we can abort the loop if stop? becomes true
|
48
|
-
while !stop?
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end # loop
|
44
|
+
# while !stop?
|
45
|
+
# event = LogStash::Event.new("message" => @message, "host" => @host)
|
46
|
+
# decorate(event)
|
47
|
+
# queue << event
|
48
|
+
# # because the sleep interval can be big, when shutdown happens
|
49
|
+
# # we want to be able to abort the sleep
|
50
|
+
# # Stud.stoppable_sleep will frequently evaluate the given block
|
51
|
+
# # and abort the sleep(@interval) if the return value is true
|
52
|
+
# Stud.stoppable_sleep(@interval) { stop? }
|
53
|
+
# end # loop
|
58
54
|
|
59
55
|
login()
|
60
56
|
|
@@ -86,51 +82,51 @@ class LogStash::Inputs::Attunity_Metrics < LogStash::Inputs::Base
|
|
86
82
|
|
87
83
|
private
|
88
84
|
def login()
|
89
|
-
response =
|
90
|
-
|
91
|
-
|
85
|
+
response = @client["api/v1/login"].get(
|
86
|
+
:header => @header
|
87
|
+
)
|
92
88
|
|
93
89
|
@header[:'EnterpriseManager.APISessionID'] = response.header[:'EnterpriseManager.APISessionID']
|
94
90
|
end
|
95
91
|
|
96
92
|
private
|
97
93
|
def logout()
|
98
|
-
response =
|
99
|
-
|
100
|
-
|
94
|
+
response = @client["api/v1/logout"].get(
|
95
|
+
:header => @header
|
96
|
+
)
|
101
97
|
|
102
98
|
@header[:'EnterpriseManager.APISessionID'] = ""
|
103
99
|
end
|
104
100
|
|
105
101
|
private
|
106
102
|
def get_servers()
|
107
|
-
response =
|
108
|
-
|
109
|
-
|
103
|
+
response = @client["api/v1/servers"].get(
|
104
|
+
:header => @header
|
105
|
+
)
|
110
106
|
return response.body.serverList
|
111
107
|
end
|
112
108
|
|
113
109
|
private
|
114
110
|
def get_server_details(server)
|
115
|
-
response =
|
116
|
-
|
117
|
-
|
111
|
+
response = @client["api/v1/servers/#{server}"].get(
|
112
|
+
:header => @header
|
113
|
+
)
|
118
114
|
return response.body.server_details
|
119
115
|
end
|
120
116
|
|
121
117
|
private
|
122
118
|
def get_tasks(server)
|
123
|
-
response =
|
124
|
-
|
125
|
-
|
119
|
+
response = @client["api/v1/servers/#{server}/tasks"].get(
|
120
|
+
:header => @header
|
121
|
+
)
|
126
122
|
return response.body.taskList
|
127
123
|
end
|
128
124
|
|
129
125
|
private
|
130
126
|
def get_task_details(server, task)
|
131
|
-
response =
|
132
|
-
|
133
|
-
|
127
|
+
response = @client["api/v1/servers/#{server}/tasks/#{task}"].get(
|
128
|
+
:header => @header
|
129
|
+
)
|
134
130
|
return response.body
|
135
131
|
end
|
136
132
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-attunity-metrics'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.1'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "This example input streams a string at a definable interval."
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-attunity-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|