ServState 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.gitignore +1 -0
- data/.travis.yml +2 -1
- data/README.md +1 -1
- data/ServState.gemspec +1 -0
- data/lib/ServState/network_usage.rb +3 -3
- data/lib/ServState/public/js/dashboard.js +1 -1
- data/lib/ServState/usage_manager.rb +3 -3
- data/lib/ServState/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +27 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
M2FjZGFiMjAzMjY2ZGQ4NWFjNjA5MmZlYzU1MDQ0YjczOTVkODI0Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
N2QwOGUzMjc1Yjk4MTI0ZWM3NDA4MWI0YTAyMWU1ZTcyNDIwN2FmNw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTI2Y2I4N2Y1MzczZjRhMDE5NjEwODdkMWFmNWJmNjU1OGM4NThlOTI1OGU0
|
10
|
+
NTBlY2M2MDc2NDU0ZjRhMmZiZGRjOGM1OTc1YWQzMmU3ODdjOTU5NjQ1ZmRl
|
11
|
+
MmExNzQ5YTFmNGIwYjcwMTA5NDkyZDFjMWYwZjQ2YWM3NGMzNjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTRmM2E5ODM5N2VmOGY3ZWM5Y2Y3OWM1Nzc4ODk3YmQxYzhhYjc1YTFjNWI3
|
14
|
+
NDM1ZjFjMmI3OWU4ZmQ0YTRkNGM1ZDFmMmNhOTc4ODE2MzYwYjBhMzdiZjZh
|
15
|
+
MTZhYTQ1MTg4YTA5OWI5MDk0YTVjYWVhMzQyMzRhNzMxYWQ1ZjM=
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Very simple tool to watch your LINUX server status.
|
|
4
4
|
[Demo page](http://162.243.90.233:8080/)
|
5
5
|
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/ServState.png)](http://badge.fury.io/rb/ServState)
|
7
|
-
[![Build Status](https://travis-ci.org/ololyay/ServState.png?branch=
|
7
|
+
[![Build Status](https://travis-ci.org/ololyay/ServState.png?branch=master)](https://travis-ci.org/ololyay/ServState)
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
data/ServState.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module ServState
|
2
2
|
class NetworkUsage
|
3
3
|
|
4
|
-
|
4
|
+
BYTES_IN_KB = 1024
|
5
5
|
|
6
6
|
attr_reader :speeds
|
7
7
|
|
@@ -15,8 +15,8 @@ module ServState
|
|
15
15
|
down = values[0] - @old_traffic[interface][0]
|
16
16
|
up = values[1] - @old_traffic[interface][1]
|
17
17
|
|
18
|
-
down_speed = (down /
|
19
|
-
up_speed = (up /
|
18
|
+
down_speed = (down / BYTES_IN_KB / time_diff).round(2)
|
19
|
+
up_speed = (up / BYTES_IN_KB / time_diff).round(2)
|
20
20
|
|
21
21
|
@speeds[interface] = [down_speed, up_speed]
|
22
22
|
end
|
@@ -31,7 +31,7 @@ function renew(){
|
|
31
31
|
var interfaces=[]
|
32
32
|
$.each(data.network, function(key, value){
|
33
33
|
ip=(data.interfaces[key])?(data.interfaces[key]):('');
|
34
|
-
interfaces.push('<div class="uk-width-medium-1-4"><div class="uk-panel uk-panel-box"><p><span class="uk-text-bold">'+key+' </span><span id="ram" class="uk-text-muted">'+ip+'</span></p><p class="uk-text-info">Down: '+value[0]+'
|
34
|
+
interfaces.push('<div class="uk-width-medium-1-4"><div class="uk-panel uk-panel-box"><p><span class="uk-text-bold">'+key+' </span><span id="ram" class="uk-text-muted">'+ip+'</span></p><p class="uk-text-info">Down: '+value[0]+'Kbps</p><p class="uk-text-success">Up: '+value[1]+'Kbps</p></div></div>');
|
35
35
|
});
|
36
36
|
$('#traffic').html(interfaces.join(''));
|
37
37
|
removeNotify($('#notification'));
|
@@ -13,7 +13,7 @@ module ServState
|
|
13
13
|
# TODO: rewrite without using ifconfig
|
14
14
|
def interfaces
|
15
15
|
ifconfig_output = `ifconfig -a`
|
16
|
-
ifconfig_lines = ifconfig_output.
|
16
|
+
ifconfig_lines = ifconfig_output.split("\n").map{ |line| line.chomp }
|
17
17
|
|
18
18
|
faces = Hash.new
|
19
19
|
name = ''
|
@@ -45,7 +45,7 @@ module ServState
|
|
45
45
|
usage = Hash.new
|
46
46
|
|
47
47
|
# grep lines with physical devices
|
48
|
-
df_output = `df`.
|
48
|
+
df_output = `df`.split("\n").grep(/^\/dev/)
|
49
49
|
|
50
50
|
# Filesystem 1K-blocks Used Available Use% Mounted on
|
51
51
|
# /dev/sda5 36462184 11383116 23226860 33% /
|
@@ -74,7 +74,7 @@ module ServState
|
|
74
74
|
def ram_usage
|
75
75
|
usage = Hash.new
|
76
76
|
|
77
|
-
free_output = `free`.
|
77
|
+
free_output = `free`.split("\n")
|
78
78
|
|
79
79
|
total_ram = (free_output[1].split[1].to_f / KB_IN_GB).round(2)
|
80
80
|
used_ram = (free_output[2].split[2].to_f / KB_IN_GB).round(2)
|
data/lib/ServState/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ServState
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Sergienko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -71,56 +71,70 @@ dependencies:
|
|
71
71
|
name: rake
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - '>='
|
74
|
+
- - ! '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - '>='
|
81
|
+
- - ! '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rspec
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - '>='
|
88
|
+
- - ! '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - '>='
|
95
|
+
- - ! '>='
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: capybara
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - '>='
|
102
|
+
- - ! '>='
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - '>='
|
109
|
+
- - ! '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: capybara-webkit
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - '>='
|
116
|
+
- - ! '>='
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- - '>='
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: coveralls
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
124
138
|
- !ruby/object:Gem::Version
|
125
139
|
version: '0'
|
126
140
|
description: Simple tool to watch your linux server state
|
@@ -180,17 +194,17 @@ require_paths:
|
|
180
194
|
- lib
|
181
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
182
196
|
requirements:
|
183
|
-
- - '>='
|
197
|
+
- - ! '>='
|
184
198
|
- !ruby/object:Gem::Version
|
185
199
|
version: '0'
|
186
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
201
|
requirements:
|
188
|
-
- - '>='
|
202
|
+
- - ! '>='
|
189
203
|
- !ruby/object:Gem::Version
|
190
204
|
version: '0'
|
191
205
|
requirements: []
|
192
206
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.2.
|
207
|
+
rubygems_version: 2.2.2
|
194
208
|
signing_key:
|
195
209
|
specification_version: 4
|
196
210
|
summary: http://github.com/ololyay/ServState
|