prometheus-splash 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +44 -0
- data/README.md +58 -60
- data/bin/splash +3 -0
- data/config/splash.yml +77 -7
- data/lib/splash/backends.rb +6 -0
- data/lib/splash/backends/file.rb +40 -0
- data/lib/splash/backends/redis.rb +47 -4
- data/lib/splash/cli.rb +18 -5
- data/lib/splash/cli/commands.rb +26 -18
- data/lib/splash/cli/config.rb +16 -2
- data/lib/splash/cli/daemon.rb +10 -3
- data/lib/splash/cli/documentation.rb +5 -2
- data/lib/splash/cli/logs.rb +25 -16
- data/lib/splash/cli/process.rb +103 -0
- data/lib/splash/cli/sequences.rb +114 -0
- data/lib/splash/cli/webadmin.rb +46 -0
- data/lib/splash/commands.rb +146 -122
- data/lib/splash/config.rb +166 -14
- data/lib/splash/config/flush.rb +30 -0
- data/lib/splash/config/sanitycheck.rb +7 -2
- data/lib/splash/config/service.rb +8 -1
- data/lib/splash/config/setup.rb +8 -3
- data/lib/splash/constants.rb +37 -8
- data/lib/splash/daemon.rb +6 -0
- data/lib/splash/{controller.rb → daemon/controller.rb} +34 -14
- data/lib/splash/daemon/metrics.rb +103 -0
- data/lib/splash/daemon/orchestrator.rb +182 -0
- data/lib/splash/daemon/orchestrator/grammar.rb +76 -0
- data/lib/splash/daemon/orchestrator/hooks.rb +28 -0
- data/lib/splash/dependencies.rb +16 -2
- data/lib/splash/exiter.rb +14 -0
- data/lib/splash/helpers.rb +84 -48
- data/lib/splash/loggers.rb +40 -13
- data/lib/splash/loggers/cli.rb +18 -3
- data/lib/splash/loggers/daemon.rb +14 -3
- data/lib/splash/loggers/dual.rb +35 -2
- data/lib/splash/loggers/web.rb +51 -0
- data/lib/splash/logs.rb +67 -54
- data/lib/splash/processes.rb +83 -0
- data/lib/splash/sequences.rb +105 -0
- data/lib/splash/templates.rb +10 -0
- data/lib/splash/transports.rb +9 -0
- data/lib/splash/transports/rabbitmq.rb +33 -4
- data/lib/splash/webadmin.rb +122 -0
- data/lib/splash/webadmin/api/routes/commands.rb +28 -0
- data/lib/splash/webadmin/api/routes/config.rb +10 -0
- data/lib/splash/webadmin/api/routes/init.rb +2 -0
- data/lib/splash/webadmin/api/routes/logs.rb +59 -0
- data/lib/splash/webadmin/api/routes/process.rb +60 -0
- data/lib/splash/webadmin/api/routes/sequences.rb +28 -0
- data/lib/splash/webadmin/main.rb +26 -0
- data/lib/splash/webadmin/portal/controllers/commands.rb +7 -0
- data/lib/splash/webadmin/portal/controllers/documentation.rb +6 -0
- data/lib/splash/webadmin/portal/controllers/home.rb +12 -0
- data/lib/splash/webadmin/portal/controllers/logs.rb +14 -0
- data/lib/splash/webadmin/portal/controllers/notfound.rb +5 -0
- data/lib/splash/webadmin/portal/controllers/processes.rb +14 -0
- data/lib/splash/webadmin/portal/controllers/proxy.rb +28 -0
- data/lib/splash/webadmin/portal/controllers/restclient.rb +19 -0
- data/lib/splash/webadmin/portal/controllers/sequences.rb +7 -0
- data/lib/splash/webadmin/portal/init.rb +11 -0
- data/lib/splash/webadmin/portal/public/css/ultragreen.css +8544 -0
- data/lib/splash/webadmin/portal/public/fonts/FontAwesome.otf +0 -0
- data/lib/splash/webadmin/portal/public/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/splash/webadmin/portal/public/fonts/fontawesome-webfont.woff +0 -0
- data/lib/splash/webadmin/portal/public/fonts/fontawesome-webfont.woff2 +0 -0
- data/lib/splash/webadmin/portal/public/images/logo_splash.png +0 -0
- data/lib/splash/webadmin/portal/public/images/logo_splash_reduce.png +0 -0
- data/lib/splash/webadmin/portal/public/images/logo_splash_tiny.png +0 -0
- data/lib/splash/webadmin/portal/views/commands.slim +49 -0
- data/lib/splash/webadmin/portal/views/documentation.slim +3 -0
- data/lib/splash/webadmin/portal/views/home.slim +78 -0
- data/lib/splash/webadmin/portal/views/layout.slim +43 -0
- data/lib/splash/webadmin/portal/views/logs.slim +32 -0
- data/lib/splash/webadmin/portal/views/nav.slim +17 -0
- data/lib/splash/webadmin/portal/views/not_found.slim +3 -0
- data/lib/splash/webadmin/portal/views/processes.slim +29 -0
- data/lib/splash/webadmin/portal/views/proxy.slim +13 -0
- data/lib/splash/webadmin/portal/views/restclient.slim +41 -0
- data/lib/splash/webadmin/portal/views/restclient_result.slim +29 -0
- data/lib/splash/webadmin/portal/views/sequences.slim +50 -0
- data/prometheus-splash.gemspec +7 -1
- data/spec/helpers_spec.rb +119 -0
- data/templates/ansible-splash/roles/splash/handlers/main.yml +4 -0
- data/templates/ansible-splash/roles/splash/tasks/main.yml +24 -1
- data/templates/ansible-splash/roles/splash/templates/logrotate.splash.j2 +11 -0
- data/templates/ansible-splash/roles/splash/templates/splash.yml.j2 +1 -1
- metadata +145 -10
- data/lib/splash/orchestrator.rb +0 -100
- data/lib/splash/orchestrator/grammar.rb +0 -54
- data/lib/splash/orchestrator/hooks.rb +0 -16
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,49 @@
|
|
1
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Commands configured in Splash
|
2
|
+
|
3
|
+
div.uk-width-medium-1-1
|
4
|
+
div.uk-panel.uk-panel-box
|
5
|
+
span.uk-text-large.uk-text-bold List of commands availables
|
6
|
+
br
|
7
|
+
|
8
|
+
div.uk-accordion(data-uk-accordion)
|
9
|
+
- @data.each do |command,content|
|
10
|
+
h3.uk-accordion-title <b>Name</b> : #{command}
|
11
|
+
div.uk-accordion-content
|
12
|
+
table.uk-table.uk-table-hover.uk-table-striped
|
13
|
+
thead
|
14
|
+
tr
|
15
|
+
th Definition
|
16
|
+
th Actions
|
17
|
+
tbody
|
18
|
+
tr
|
19
|
+
td
|
20
|
+
dl.uk-description-list-horizontal
|
21
|
+
dt <i class="uk-icon-th-list"></i> Description
|
22
|
+
dd #{content[:desc]}
|
23
|
+
- if content[:command]
|
24
|
+
dt <i class="uk-icon-cog"></i> Command Line
|
25
|
+
dd #{content[:command]}
|
26
|
+
- if content[:schedule]
|
27
|
+
dt <i class="uk-icon-calendar"></i> Schedule
|
28
|
+
dd
|
29
|
+
<ul>
|
30
|
+
<li> <b><i>Type</b></i> : #{content[:schedule].keys.first}</li>
|
31
|
+
<li> <b><i>Value</b></i> : #{content[:schedule].values.first}</li>
|
32
|
+
</ul>
|
33
|
+
- if content[:on_success]
|
34
|
+
dt <i class="uk-icon-check"></i> Execute on success
|
35
|
+
dd #{content[:on_success]}
|
36
|
+
- if content[:on_failure]
|
37
|
+
dt <i class="uk-icon-bolt"></i> Execute on failure
|
38
|
+
dd #{content[:on_failure]}
|
39
|
+
- if content[:user]
|
40
|
+
dt <i class="uk-icon-user"></i> become user
|
41
|
+
dd #{content[:user]}
|
42
|
+
- if content[:delegate_to]
|
43
|
+
dt <i class="uk-icon-chevron-circle-right"></i> Remote delegation
|
44
|
+
dd
|
45
|
+
<ul>
|
46
|
+
<li> <i><b>Host</b></i> : #{content[:delegate_to][:host]}</li>
|
47
|
+
<li> <b><i>Remote Command</b></i> : #{content[:delegate_to][:remote_command]}</li>
|
48
|
+
</ul>
|
49
|
+
td
|
@@ -0,0 +1,78 @@
|
|
1
|
+
h2 This is Splash
|
2
|
+
p Choose a activity in the main menu
|
3
|
+
|
4
|
+
|
5
|
+
div.uk-grid
|
6
|
+
div.uk-width-medium-1-2
|
7
|
+
div.uk-panel.uk-panel-box
|
8
|
+
span.uk-text-large.uk-text-bold Global Configuration
|
9
|
+
br
|
10
|
+
br
|
11
|
+
span.uk-text-bold <i>Logger and display</i> :
|
12
|
+
ul
|
13
|
+
li <b>Level:</b> #{@data[:loggers][:level]}
|
14
|
+
li <b>Daemon log filename:</b> #{@data[:loggers][:daemon][:file]}
|
15
|
+
li <b>Web log filename:</b> #{@data[:loggers][:web][:file]}
|
16
|
+
li <b>Emoji in CLI:</b> #{@data[:loggers][:cli][:emoji]}
|
17
|
+
li <b>Color in CLI:</b> #{@data[:loggers][:cli][:color]}
|
18
|
+
span.uk-text-bold <i>Templates</i> :
|
19
|
+
ul
|
20
|
+
li <b>Execution Report Template file:</b> #{@data[:execution_template_path]}
|
21
|
+
|
22
|
+
div.uk-width-medium-1-2
|
23
|
+
div.uk-panel.uk-panel-box
|
24
|
+
span.uk-text-large.uk-text-bold Transport and Backend
|
25
|
+
br
|
26
|
+
br
|
27
|
+
span.uk-text-bold <i>Backend</i> :
|
28
|
+
ul
|
29
|
+
li <b>Backend type:</b> #{@data[:backends][:stores][:execution_trace][:type]}
|
30
|
+
- if @data[:backends][:stores][:execution_trace][:type] == :file
|
31
|
+
li <b>Path:</b> #{@data[:backends][:stores][:execution_trace][:path]}
|
32
|
+
- else
|
33
|
+
li <b>Host:</b> #{@data[:backends][:stores][:execution_trace][:host]}
|
34
|
+
li <b>Port:</b> #{@data[:backends][:stores][:execution_trace][:port]}
|
35
|
+
li <b>base:</b> #{@data[:backends][:stores][:execution_trace][:base]}
|
36
|
+
- unless @data[:backends][:stores][:execution_trace][:auth].nil?
|
37
|
+
li <b>Authentification:</b> Active (see config file)
|
38
|
+
span.uk-text-bold <i>Transport</i> :
|
39
|
+
ul
|
40
|
+
li <b>Transport:</b> #{@data[:transports][:active]}
|
41
|
+
- if @data[:transports][:active] == :rabbitmq
|
42
|
+
li <b>Host:</b> #{@data[:transports][:rabbitmq][:host]}
|
43
|
+
li <b>Port:</b> #{@data[:transports][:rabbitmq][:port]}
|
44
|
+
li <b>Vhost:</b> #{@data[:transports][:rabbitmq][:vhost]}
|
45
|
+
- unless @data[:transports][:rabbitmq][:user].nil?
|
46
|
+
li <b>Authentification:</b> Active (see config file)
|
47
|
+
|
48
|
+
div.uk-grid
|
49
|
+
div.uk-width-medium-1-2
|
50
|
+
div.uk-panel.uk-panel-box
|
51
|
+
span.uk-text-large.uk-text-bold Daemon
|
52
|
+
br
|
53
|
+
ul
|
54
|
+
li <b>Logs monitoring scheduling: </b> #{@data[:daemon_logmon_scheduling]}
|
55
|
+
li <b>Processes monitoring scheduling: </b> #{@data[:daemon_process_scheduling]}
|
56
|
+
li <b>Splash metrics monitoring scheduling: </b> #{@data[:daemon_metrics_scheduling]}
|
57
|
+
li <b>Splash daemon process name: </b> #{@data[:daemon_process_name]}
|
58
|
+
li <b>Splash daemon PID file path: </b> #{@data[:pid_path]}
|
59
|
+
li <b>Splash daemon PID file : </b> #{@data[:pid_file]}
|
60
|
+
li <b>Splash daemon trace path: </b> #{@data[:trace_path]}
|
61
|
+
li <b>Splash daemon trace STDOUT file: </b> #{@data[:stdout_trace]}
|
62
|
+
li <b>Splash daemon trace STDERR: </b> #{@data[:stderr_trace]}
|
63
|
+
|
64
|
+
|
65
|
+
div.uk-width-medium-1-2
|
66
|
+
div.uk-panel.uk-panel-box
|
67
|
+
span.uk-text-large.uk-text-bold Web UI
|
68
|
+
br
|
69
|
+
br
|
70
|
+
span.uk-text-bold <i>Webadmin</i> :
|
71
|
+
ul
|
72
|
+
li <b>IP:</b> #{@data[:webadmin_ip]}
|
73
|
+
li <b>Port:</b> #{@data[:webadmin_port]}
|
74
|
+
|
75
|
+
span.uk-text-bold <i>Prometheus PushGateway</i> :
|
76
|
+
ul
|
77
|
+
li <b>Host:</b> #{@data[:prometheus_pushgateway_host]}
|
78
|
+
li <b>Port:</b> #{@data[:prometheus_pushgateway_port]}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
doctype 5
|
2
|
+
html lang="fr-fr" dir="ltr"
|
3
|
+
head
|
4
|
+
title== "Splash : Orchestration and Supervision made easy"
|
5
|
+
meta charset="utf-8"
|
6
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.min.css" integrity="sha512-b/j0MsmsRINkL4YUIZWvtf9tQr4KYQt2ld3NjEdakM7QRRWLenfe9OmG5K9GjNW56hE0QJCwWMv11fAVFELR2w==" crossorigin="anonymous"
|
7
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/accordion.min.css" integrity="sha512-5JEKYy09Sqq/8id+Mw3Za1avSracWTbu+JbI1nE7y3Ned7PG3K1E1/UxYF1oy9cUrRGJuvPXs4vNGamwRgM3sg==" crossorigin="anonymous"
|
8
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/sticky.min.css" integrity="sha512-bQYADl6QpGQzYScMfS9O7RTyyqlMABf2M5627gBC+xOMcGgqRIGJL3Yhr6QnXMwqQKVKcYcpknH0H3XQrDLB3w==" crossorigin="anonymous"
|
9
|
+
|
10
|
+
link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"
|
11
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.gradient.min.css" integrity="sha512-Vjr6Vz5D/gNvTBfQW581ssADQr1j8fAOU0seE2SxO8UvsCBZBoFQS9Lec3hkmZbpcYnsifkBtdQaHU4x6MylGw==" crossorigin="anonymous"
|
12
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/sticky.gradient.css" integrity="sha512-BY0A+4FEGeikNxmo9Q30BZMGRDykKHScJlOSeGq0uq+ylGDJD3zAApnktyKv9tzira1p0ow+B7VqIlRR2CBWoA==" crossorigin="anonymous"
|
13
|
+
link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/components/accordion.gradient.min.css" integrity="sha512-Cfd5PRktfT5WA1yUJbYkzjEHvT+9KzqPP1Z1OJud3CFUrkoAc6iIWawoMqPFmtvmxxDNV5RAHfe5DCISV+Gd9A==" crossorigin="anonymous"
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
link rel="stylesheet" href="/css/ultragreen.css"
|
18
|
+
|
19
|
+
script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"
|
20
|
+
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/uikit.min.js" integrity="sha512-KI08ZutCgdasDMwp5rPKd9nF8r+eAy/bZH3Rjova6HfkDv1W7J72sNW+K++KvMp3HL7z0cCykV9vixJACHeCew==" crossorigin="anonymous"
|
21
|
+
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/components/sticky.min.js" integrity="sha512-B21PoHN5PsI7sU3cUcNbitUsXp6Zzp81ZDlKJr1xRXwEh3WSftRmgSOgRYxB8h/SlgW+jazkmOXerT33NB7jGA==" crossorigin="anonymous"
|
22
|
+
script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/components/accordion.min.js" integrity="sha512-7UmYoHJ9tTZiNqlBuUgnr2l82TmZxhiOVXIjiMVP/hPFQJopjEBfVEFPjNdv97OX8K/FIZ4kAXSE+SRTfUkPMg==" crossorigin="anonymous"
|
23
|
+
|
24
|
+
|
25
|
+
body
|
26
|
+
div.uk-width-1-1.uk-visible-small.uk-text-left
|
27
|
+
img src="/images/logo_splash_tiny.png"
|
28
|
+
span.uk-text-medium.uk-text-middle Orchestration and Supervision made easy
|
29
|
+
div.uk-width-1-1.uk-hidden-small
|
30
|
+
img src="/images/logo_splash_reduce.png"
|
31
|
+
span.uk-text-large.uk-text-middle Orchestration and Supervision made easy
|
32
|
+
== slim :nav, :format => :html
|
33
|
+
div.wrapper
|
34
|
+
div.uk-grid.uk-grid-medium
|
35
|
+
div.uk-width-9-1.uk-container.uk-container-center.uk-margin-left
|
36
|
+
br
|
37
|
+
== yield
|
38
|
+
div.footer
|
39
|
+
br
|
40
|
+
<a href="https://twitter.com/UltragreenSoft" class="uk-icon-hover uk-icon-twitter uk-icon-button"></a>
|
41
|
+
<a href="https://www.facebook.com/UltragreenSoft" class="uk-icon-hover uk-icon-facebook uk-icon-button"></a>
|
42
|
+
<a href="http://www.github.com/Ultragreen/prometheus-splash" class="uk-icon-hover uk-icon-github uk-icon-button"></a>
|
43
|
+
p.uk-text-center <span class="uk-icon-copyright uk-icon-small"></span> 2020 <a href="http://www.ultragreen.net"> Ultragreen Software</a> / <i><a href="https://www.openhub.net/accounts/lecid">Romain GEORGES</a></i>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Logs configured in Splash
|
2
|
+
|
3
|
+
div.uk-width-medium-1-1
|
4
|
+
div.uk-panel.uk-panel-box
|
5
|
+
span.uk-text-large.uk-text-bold List of logs monitored
|
6
|
+
br
|
7
|
+
table.uk-table.uk-table-hover.uk-table-striped
|
8
|
+
thead
|
9
|
+
tr
|
10
|
+
th Log record label
|
11
|
+
th Definition
|
12
|
+
th Status
|
13
|
+
tbody
|
14
|
+
- @data.each do |log|
|
15
|
+
tr
|
16
|
+
td <b>Label</b> : #{log[:label]}
|
17
|
+
td
|
18
|
+
ul
|
19
|
+
li <b>File</b> : #{log[:log]}
|
20
|
+
li <b>Pattern</b> : #{log[:pattern]}
|
21
|
+
td
|
22
|
+
- if @result[log[:label]][:status] == :missing
|
23
|
+
div.uk-badge.uk-badge-warning missing
|
24
|
+
- if @result[log[:label]][:status] == :clean
|
25
|
+
div.uk-badge.uk-badge-success success
|
26
|
+
ul
|
27
|
+
li <b>Lines count</b> : #{@result[log[:label]][:lines]}
|
28
|
+
- if @result[log[:label]][:status] == :matched
|
29
|
+
div.uk-badge.uk-badge-danger matched
|
30
|
+
ul
|
31
|
+
li <b>Lines count</b> : #{@result[log[:label]][:lines]}
|
32
|
+
li <b class="uk-text-danger">Matchs count : #{@result[log[:label]][:count]} </b>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
nav.uk-navbar.uk-navbar-attached(data-uk-sticky)
|
2
|
+
a.uk-navbar-brand.uk-hidden-small href="/" <i class="uk-icon-home"></i> Home
|
3
|
+
ul.uk-navbar-nav.uk-hidden-small
|
4
|
+
- for item in @menu
|
5
|
+
li class=( (item == @current_item)? "uk-active" : "uk-inactive")
|
6
|
+
a href="/#{item.downcase}" title="Access to #{item.capitalize}" <i class="uk-icon-#{@menu_icons[item]}"></i> #{item.capitalize}
|
7
|
+
a.uk-navbar-toggle.uk-visible-small(href="#offcanvas" data-uk-offcanvas)
|
8
|
+
div.uk-navbar-brand.uk-navbar-left.uk-visible-small
|
9
|
+
<i class="uk-icon-arrow-left"></i> Menu
|
10
|
+
|
11
|
+
|
12
|
+
div#offcanvas.uk-offcanvas
|
13
|
+
div.uk-offcanvas-bar
|
14
|
+
ul.uk-nav.uk-nav-offcanvas
|
15
|
+
- for item in @menu
|
16
|
+
li class=( (item == @current_item)? "uk-active" : "uk-inactive")
|
17
|
+
a href="/#{item.downcase}" title="Access to #{item.capitalize}" #{item.capitalize}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Processes configured in Splash
|
2
|
+
|
3
|
+
div.uk-width-medium-1-1
|
4
|
+
div.uk-panel.uk-panel-box
|
5
|
+
span.uk-text-large.uk-text-bold List of processes monitored
|
6
|
+
br
|
7
|
+
table.uk-table.uk-table-hover.uk-table-striped
|
8
|
+
thead
|
9
|
+
tr
|
10
|
+
th Process record
|
11
|
+
th Patterns
|
12
|
+
th Status
|
13
|
+
tbody
|
14
|
+
- @data.each do |process|
|
15
|
+
tr
|
16
|
+
td <b>Process</b> : #{process[:process]}
|
17
|
+
td
|
18
|
+
span.uk-text-bold Patterns
|
19
|
+
ul
|
20
|
+
- process[:patterns].each do |pattern|
|
21
|
+
li= pattern
|
22
|
+
td
|
23
|
+
- if @result[process[:process]][:status] == :inexistant
|
24
|
+
div.uk-badge.uk-badge-danger not running
|
25
|
+
- if @result[process[:process]][:status] == :running
|
26
|
+
div.uk-badge.uk-badge-success running
|
27
|
+
ul
|
28
|
+
li <b>CPU usage</b> : #{@result[process[:process]][:cpu]}
|
29
|
+
li <b>MEM usage</b> : #{@result[process[:process]][:mem]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- if @proxy
|
2
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Proxies for Prometheus components
|
3
|
+
- else
|
4
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Links for Prometheus components
|
5
|
+
div.uk-width-medium-1-1
|
6
|
+
div.uk-panel.uk-panel-box
|
7
|
+
ul.uk-list
|
8
|
+
li
|
9
|
+
i.uk-icon-hand-o-right
|
10
|
+
a href="#{@prometheus_url}" Prometheus
|
11
|
+
li
|
12
|
+
i.uk-icon-hand-o-right
|
13
|
+
a href="#{@pushgateway_url}" Prometheus PushGateway
|
@@ -0,0 +1,41 @@
|
|
1
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> REST Client
|
2
|
+
|
3
|
+
div.uk-grid
|
4
|
+
div.uk-width-1-1
|
5
|
+
div.uk-panel.uk-panel-box
|
6
|
+
h3.uk-panel-title
|
7
|
+
<i class="uk-icon-question-circle"></i> Request
|
8
|
+
form.uk-form.uk-form-horizontal#query action="/restclient/query" method="POST"
|
9
|
+
label.uk-form-label for="method" Method
|
10
|
+
select.uk-form-large#method name="method"
|
11
|
+
option GET
|
12
|
+
option POST
|
13
|
+
option DELETE
|
14
|
+
option PUT
|
15
|
+
div
|
16
|
+
label.uk-form-label for="url" Endpoint
|
17
|
+
input.uk-form-width-large#url type="text" placeholder="url" name="url"
|
18
|
+
dev.uk-align-right
|
19
|
+
input.uk-button.uk-button-primary type="submit" value="Send"
|
20
|
+
|
21
|
+
div.uk-grid
|
22
|
+
div.uk-width-1-1
|
23
|
+
div.uk-panel.uk-panel-box
|
24
|
+
h3.uk-panel-title
|
25
|
+
<i class="uk-icon-share-square"></i> Response
|
26
|
+
br
|
27
|
+
div#result.uk-width-1-1
|
28
|
+
|
29
|
+
javascript:
|
30
|
+
$('#query').submit(function() {
|
31
|
+
console.log($(this).serialize());
|
32
|
+
$.ajax({
|
33
|
+
data: $(this).serialize(),
|
34
|
+
type: $(this).attr('method'),
|
35
|
+
url: $(this).attr('action'),
|
36
|
+
success: function(response) {
|
37
|
+
$('#result').html(response);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
return false;
|
41
|
+
});
|
@@ -0,0 +1,29 @@
|
|
1
|
+
di
|
2
|
+
ul.uk-list
|
3
|
+
li <b>HTTP Method</b> : #{@method}
|
4
|
+
li <b>URL</b> : #{@url}
|
5
|
+
h3 Result :
|
6
|
+
- unless @result == false
|
7
|
+
table.uk_table
|
8
|
+
tr
|
9
|
+
td.uk-width-2-10
|
10
|
+
i.uk-icon-dollar
|
11
|
+
| <b>Return code :</b>
|
12
|
+
td.uk-width-8-10 #{@result.code}
|
13
|
+
tr
|
14
|
+
td.uk-width-2-10
|
15
|
+
i.uk-icon-file-o
|
16
|
+
| <b>Body :</b>
|
17
|
+
td.uk-width-8-10.uk-scrollable-text <pre><code>#{@result}</code></pre>
|
18
|
+
tr
|
19
|
+
td.uk-width-2-10
|
20
|
+
i.uk-icon-header
|
21
|
+
| <b>Headers :</b>
|
22
|
+
td.uk-width-8-10
|
23
|
+
ul
|
24
|
+
- @result.headers.each do |hkey,value|
|
25
|
+
li <i><b>#{hkey}:</b> #{value}</i>
|
26
|
+
|
27
|
+
- else
|
28
|
+
div.uk-alert.uk-alert-danger
|
29
|
+
| Can't excute this request
|
@@ -0,0 +1,50 @@
|
|
1
|
+
h2 <i class="uk-icon-#{@menu_icons[@current_item]} uk-icon-medium "></i> Sequences configured in Splash
|
2
|
+
|
3
|
+
div.uk-width-medium-1-1
|
4
|
+
div.uk-panel.uk-panel-box
|
5
|
+
span.uk-text-large.uk-text-bold List of sequences availables
|
6
|
+
br
|
7
|
+
|
8
|
+
div.uk-accordion(data-uk-accordion)
|
9
|
+
- @data.each do |sequence,content|
|
10
|
+
h3.uk-accordion-title <b>Name</b> : #{sequence}
|
11
|
+
div.uk-accordion-content
|
12
|
+
table.uk-table.uk-table-hover.uk-table-striped
|
13
|
+
thead
|
14
|
+
tr
|
15
|
+
th Options
|
16
|
+
th Definition
|
17
|
+
th Actions
|
18
|
+
tbody
|
19
|
+
tr
|
20
|
+
td
|
21
|
+
dl.uk-description-list-horizontal
|
22
|
+
|
23
|
+
- if content[:options]
|
24
|
+
- if content[:options][:continue]
|
25
|
+
ul
|
26
|
+
li <i class="uk-icon-check-square-o"></i> <b>Continue execution on error</b> : #{content[:options][:continue]}
|
27
|
+
- if content[:schedule]
|
28
|
+
ul
|
29
|
+
li <i class="uk-icon-calendar"></i> <b>Scheduling</b> :
|
30
|
+
<ul>
|
31
|
+
<li> <b><i>Type</b></i> : #{content[:schedule].keys.first}</li>
|
32
|
+
<li> <b><i>Value</b></i> : #{content[:schedule].values.first}</li>
|
33
|
+
</ul>
|
34
|
+
td
|
35
|
+
dl.uk-description-list-horizontal
|
36
|
+
- content[:definition].each_with_index do |step,i|
|
37
|
+
dt <i class="uk-icon-check-square-o"></i> Step #{i+1} :
|
38
|
+
dd #{step[:step]}
|
39
|
+
ul
|
40
|
+
li <i class="uk-icon-cog"></i> <b>Command</b> : #{step[:command]}
|
41
|
+
- if step[:on_host]
|
42
|
+
li <i class="uk-icon-chevron-circle-right"></i> <b>Remote execution target</b> : #{step[:on_host]}
|
43
|
+
- if not step[:callback].nil?
|
44
|
+
li <i class="uk-icon-share-square-o"></i> <b>Execute Callback</b> : #{step[:callback]}
|
45
|
+
- if not step[:trace].nil?
|
46
|
+
li <i class="uk-icon-pencil-square-o"></i> <b>Trace Execution</b> : #{step[:trace]}
|
47
|
+
- if not step[:notify].nil?
|
48
|
+
li <i class="uk-icon-external-link"></i> <b>Notify Execution in Prometheus</b> : #{step[:notify]}
|
49
|
+
|
50
|
+
td
|
data/prometheus-splash.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = [Splash::Constants::EMAIL]
|
11
11
|
spec.description = %q{Prometheus Logs and Batchs supervision over PushGateway and commands orchestration}
|
12
12
|
spec.summary = %q{Supervision with Prometheus of Logs and Asynchronous tasks orchestration for Services or Hosts }
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/Ultragreen/prometheus-splash"
|
14
14
|
spec.license = Splash::Constants::LICENSE
|
15
15
|
spec.require_paths << 'bin'
|
16
16
|
spec.bindir = 'bin'
|
@@ -28,6 +28,12 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency 'tty-markdown','~> 0.6.0'
|
29
29
|
spec.add_runtime_dependency 'tty-pager','~> 0.12.1'
|
30
30
|
spec.add_runtime_dependency 'colorize','~> 0.8.1'
|
31
|
+
spec.add_runtime_dependency 'sinatra','~> 2.1.0'
|
32
|
+
spec.add_runtime_dependency 'thin','~> 1.7.2'
|
33
|
+
spec.add_runtime_dependency 'rest-client','~> 2.1.0'
|
34
|
+
spec.add_runtime_dependency 'slim','~> 4.1.0'
|
35
|
+
spec.add_runtime_dependency 'kramdown','~> 1.16.2'
|
36
|
+
spec.add_runtime_dependency 'rack-reverse-proxy','~> 0.12.0'
|
31
37
|
spec.add_development_dependency 'rake', '~> 13.0.1'
|
32
38
|
spec.add_development_dependency 'rspec', '~> 3.9.0'
|
33
39
|
spec.add_development_dependency 'yard', '~> 0.9.24'
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require_relative '../lib/splash/dependencies'
|
2
|
+
|
3
|
+
include Splash
|
4
|
+
|
5
|
+
describe Helpers do
|
6
|
+
$test_file = "./test.txt"
|
7
|
+
$test_target = './test_target.txt'
|
8
|
+
`echo 'test' > #{$test_file}`
|
9
|
+
$nonexistantfile = "./no.txt"
|
10
|
+
$test_folder = "./test_folder"
|
11
|
+
$symlink = "./test_link"
|
12
|
+
before :all do
|
13
|
+
File::unlink($nonexistantfile) if File::exist?($nonexistantfile)
|
14
|
+
end
|
15
|
+
|
16
|
+
after :all do
|
17
|
+
File::unlink($test_target) if File::exist?($test_target)
|
18
|
+
FileUtils::rm($symlink) if File::exist?($symlink)
|
19
|
+
FileUtils::rmdir($test_folder) if File::exist?($test_folder)
|
20
|
+
File::unlink($test_file) if File::exist?($test_file)
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
subject { Helpers }
|
26
|
+
specify { should be_an_instance_of Module }
|
27
|
+
context "Misc functions" do
|
28
|
+
include Splash::Helpers
|
29
|
+
describe '#user_root' do
|
30
|
+
specify { expect(self).to respond_to 'user_root' }
|
31
|
+
specify { expect(['root']).to include(user_root) }
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#group_root' do
|
35
|
+
specify { expect(self).to respond_to 'group_root' }
|
36
|
+
specify { expect(['root','wheel']).to include(user_root) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#get_processes' do
|
40
|
+
specify { expect(self).to respond_to 'get_processes' }
|
41
|
+
specify { expect(get_processes(pattern: '/usr')).to be_an_instance_of Array }
|
42
|
+
specify { expect(get_processes(patterns: ['/usr'])).to be_an_instance_of Array }
|
43
|
+
specify { expect(get_processes(pattern: '/usr').first).to be_an_instance_of String }
|
44
|
+
specify { expect(get_processes(pattern: '/usr', full: true).first).to be_an_instance_of PsProcess }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#search_file_in_gem' do
|
48
|
+
specify { expect(self).to respond_to 'search_file_in_gem' }
|
49
|
+
specify { expect(search_file_in_gem('prometheus-splash','config/splash.yml')).to be_an_instance_of String }
|
50
|
+
specify { expect(search_file_in_gem('prometheus-splash','config/splash.yml')).to include('config/splash.yml') }
|
51
|
+
end
|
52
|
+
|
53
|
+
describe '#is_root?' do
|
54
|
+
specify { expect(self).to respond_to 'is_root?' }
|
55
|
+
specify { expect(is_root?).to eq(false) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#run_as_root' do
|
59
|
+
specify { expect(self).to respond_to 'run_as_root' }
|
60
|
+
specify { expect(run_as_root(:user_root)).to eq({:case => :not_root, :more => "subcommands : user_root"}) }
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
context "FS functions" do
|
66
|
+
include Splash::Helpers
|
67
|
+
describe '#install_file' do
|
68
|
+
specify { expect(self).to respond_to 'install_file' }
|
69
|
+
specify { expect(install_file(source: $test_file, target: $test_target, mode: "777" )).to eq(true) }
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#make_folder' do
|
73
|
+
specify { expect(self).to respond_to 'make_folder' }
|
74
|
+
specify { expect(make_folder(path: $test_folder, mode: "777" )).to eq(true) }
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#make_link' do
|
78
|
+
specify { expect(self).to respond_to 'make_link' }
|
79
|
+
specify { expect(make_link(source: $test_file, link: $symlink )).to eq(true) }
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
context "FS checkers" do
|
85
|
+
include Splash::Helpers
|
86
|
+
describe '#verify_file' do
|
87
|
+
specify { expect(self).to respond_to 'verify_file' }
|
88
|
+
specify { expect(verify_file(name: $test_file, mode: "777" )).to be_an_instance_of Array }
|
89
|
+
specify { expect(verify_file(name: $test_target, mode: "777" )).to be_empty }
|
90
|
+
specify { expect(verify_file(name: $test_file, mode: "700" )).to include(:mode) }
|
91
|
+
specify { expect(verify_file(name: $nonexistantfile, mode: "777" )).to include(:inexistant) }
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#verify_folder' do
|
95
|
+
specify { expect(self).to respond_to 'verify_folder' }
|
96
|
+
specify { expect(verify_folder(name: $test_folder, mode: "777" )).to be_an_instance_of Array }
|
97
|
+
specify { expect(verify_folder(name: $test_folder, mode: "777" )).to be_empty }
|
98
|
+
specify { expect(verify_folder(name: $test_folder, mode: "700" )).to include(:mode) }
|
99
|
+
specify { expect(verify_folder(name: $nonexistantfile, mode: "777" )).to include(:inexistant) }
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#verify_link' do
|
103
|
+
specify { expect(self).to respond_to 'verify_link' }
|
104
|
+
specify { expect(verify_link(name: $nonexistantfile)).to eq(false) }
|
105
|
+
specify { expect(verify_link(name: $symlink)).to eq(true) }
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
context "Service checker" do
|
111
|
+
include Splash::Helpers
|
112
|
+
describe '#verify_service' do
|
113
|
+
specify { expect(self).to respond_to 'verify_service' }
|
114
|
+
specify { expect(verify_service(host: 'localhost', port: '7777')).to eq(false) }
|
115
|
+
specify { expect(verify_service(host: 'github.com', port: '80')).to eq(true) }
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|