internet_box_logger 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/bin/internet_box_logger +2 -7
- data/lib/internet_box_logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392bfee54def08775eba49ee699e8ca6be2c1c15
|
4
|
+
data.tar.gz: b8f847eff5ec8a64b41513847a1c9b2cced20937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30beb6ae14b11d89cabff73936e33d293f4d62a9358b6b3d1094f34a959904f55815ff5eb1a2d6647334dd084d5a6fe158382cab8b5b94a0e1985510eaad7774
|
7
|
+
data.tar.gz: df1da0de0bc8cf0e426e2f0681d611031b848c58862122fec4e7b24d990db14870bae2f326eebec30623044934ea3f52f3d7802acbc6eb8c2e2a772a830701da
|
data/README.md
CHANGED
@@ -6,6 +6,9 @@
|
|
6
6
|
## Overview
|
7
7
|
|
8
8
|
The goal of this [gem][IBL] is to provide an easy way to monitor your internet box status.
|
9
|
+
The idea is to gather as much data as you can about your box, and regularly store the metrics into an ElasticSearch
|
10
|
+
server/cluster in order to provide a Kibana dashboard on top to visualize the metrics.
|
11
|
+
|
9
12
|
It primarily targets the box I am using (the Freebox V5 from the '[Free]' french ISP).
|
10
13
|
|
11
14
|
Currently supported box:
|
@@ -222,14 +225,17 @@ Basically, to contribute you may want to:
|
|
222
225
|
The contract is pretty simple. Create a module to gather your box's data into the InternetBoxLogger::Parsers namespace
|
223
226
|
(module). This module should implement two methods:
|
224
227
|
|
225
|
-
* `get_box_data` that returns a hash of key-value pairs representing the data you
|
228
|
+
* `get_box_data` that returns a hash of key-value pairs representing the data you want to monitor from your box. The way you
|
226
229
|
get these is not important. In the case of the Freebox V5 the sole possibility is to parse a page returned by the
|
227
230
|
box itself and than contains a lot of metrics. But maybe your box provides a more sophisticated API, REST or
|
228
231
|
whatever.
|
229
|
-
* `as_es_documents` should return an array of documents in the ElasticSearch way of thinking. This should the
|
230
|
-
transformation of the data returned by `get_box_data`, organised as an array of documents. This way you can organize
|
232
|
+
* `as_es_documents` should return an array of documents (hashes) in the ElasticSearch way of thinking. This should be the
|
233
|
+
transformation of the data returned by `get_box_data`, and organised as an array of documents. This way you can organize
|
231
234
|
your data in a way that will allow you to query this data from Kibana to build your dashboards.
|
232
235
|
|
236
|
+
Then you have to specify this new parser in the configuration file using the `box_type` property (see the default value
|
237
|
+
in the upper part of this help to see how to do it).
|
238
|
+
|
233
239
|
### Tests
|
234
240
|
|
235
241
|
You should upgrade the test set to cover what you added.
|
data/bin/internet_box_logger
CHANGED
@@ -8,13 +8,14 @@ require 'tasks/internet_box_logger_tasks'
|
|
8
8
|
module InternetBoxLogger
|
9
9
|
class Script
|
10
10
|
include EasyAppHelper
|
11
|
-
|
11
|
+
include InternetBoxLogger::Tasks
|
12
12
|
APP_NAME = 'The Internet Box Logger'
|
13
13
|
DESCRIPTION = 'This application will log your Internet box metrics into ElasticSearch.'
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
# Providing this data is optional but brings better logging and online help
|
17
17
|
config.describes_application(app_name: APP_NAME, app_version: InternetBoxLogger::VERSION, app_description: DESCRIPTION)
|
18
|
+
config.script_filename = "#{ibl_gem_path}/config/internet_box_logger.conf"
|
18
19
|
end
|
19
20
|
|
20
21
|
def run
|
@@ -29,7 +30,6 @@ module InternetBoxLogger
|
|
29
30
|
raise msg
|
30
31
|
end
|
31
32
|
if config[:deploy_reports]
|
32
|
-
self.extend InternetBoxLogger::Tasks
|
33
33
|
self.extend InternetBoxLogger::Tasks::Kibana
|
34
34
|
kibana_info
|
35
35
|
deploy_reports
|
@@ -37,25 +37,21 @@ module InternetBoxLogger
|
|
37
37
|
end
|
38
38
|
|
39
39
|
if config[:cron_setup]
|
40
|
-
self.extend InternetBoxLogger::Tasks
|
41
40
|
self.extend InternetBoxLogger::Tasks::Cron
|
42
41
|
cron_setup
|
43
42
|
exit 0
|
44
43
|
end
|
45
44
|
if config[:cron_remove]
|
46
|
-
self.extend InternetBoxLogger::Tasks
|
47
45
|
self.extend InternetBoxLogger::Tasks::Cron
|
48
46
|
cron_remove
|
49
47
|
exit 0
|
50
48
|
end
|
51
49
|
if config[:es_start]
|
52
|
-
self.extend InternetBoxLogger::Tasks
|
53
50
|
self.extend InternetBoxLogger::Tasks::ElasticSearch
|
54
51
|
start_es_server
|
55
52
|
exit 0
|
56
53
|
end
|
57
54
|
if config[:es_stop]
|
58
|
-
self.extend InternetBoxLogger::Tasks
|
59
55
|
self.extend InternetBoxLogger::Tasks::ElasticSearch
|
60
56
|
stop_es_server
|
61
57
|
exit 0
|
@@ -63,7 +59,6 @@ module InternetBoxLogger
|
|
63
59
|
|
64
60
|
|
65
61
|
if config[:serve]
|
66
|
-
self.extend InternetBoxLogger::Tasks
|
67
62
|
self.extend InternetBoxLogger::Tasks::Kibana
|
68
63
|
kibana_info
|
69
64
|
serve_ui
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: internet_box_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent B
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|