eznemo 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -5
- data/lib/eznemo/mysql.rb +2 -0
- data/lib/eznemo/version.rb +1 -1
- data/lib/eznemo.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: c3efce5df3e500b3170a41590e844315147277f9
|
4
|
+
data.tar.gz: fddcc93d34f4c32d015b257f33447bbbb555ad67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 211605c26eae2da41969b4be18e2d3d4d02f57604ff9ae06af6799b02eb3fc061b682d52bf8fad7638700acc2a5e3e580a9aaa63e0141ee774196aa08832f5d4
|
7
|
+
data.tar.gz: eaf38d99f061d70917681a41e1f02cb327d2499cdaaaf1eff50d8e6246d349a67d250ecbc3133babd53651d70904c83b6ada2429f35c93981e7c6a3a38afa16f
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# eznemo
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/eznemo.svg)](https://badge.fury.io/rb/eznemo) [![Code Climate](https://codeclimate.com/github/kenjij/eznemo/badges/gpa.svg)](https://codeclimate.com/github/kenjij/eznemo)
|
4
|
+
|
3
5
|
A Ruby gem. It's a simple monitoring engine and stores results in a database. Runs on EventMachine.
|
4
6
|
|
5
7
|
For reports and alerts, analyze the results in the database.
|
@@ -35,18 +37,21 @@ Config file.
|
|
35
37
|
|
36
38
|
```yaml
|
37
39
|
---
|
40
|
+
:probe:
|
41
|
+
:name: Probe01
|
38
42
|
:datastore:
|
39
43
|
:type: :mysql
|
40
44
|
:options:
|
41
|
-
:host:
|
42
|
-
:username:
|
43
|
-
:password:
|
44
|
-
:database:
|
45
|
+
:host: 127.0.0.1
|
46
|
+
:username: user
|
47
|
+
:password: paSsw0rd
|
48
|
+
:database: eznemo
|
45
49
|
:checks:
|
46
50
|
:tags:
|
47
51
|
- tag1
|
48
52
|
- tag2
|
49
53
|
:monitor:
|
54
|
+
:ping: # all optional
|
50
55
|
:path: '/bin/ping'
|
51
56
|
:min_interval: 10
|
52
57
|
:timeout: 5
|
@@ -75,6 +80,7 @@ Config file.
|
|
75
80
|
```ruby
|
76
81
|
{
|
77
82
|
check_id: 123, # from checks
|
83
|
+
probe: 'Probe01',
|
78
84
|
timestamp: '2016-04-01 10:00:00 -07:00',
|
79
85
|
status: true, # true means OK
|
80
86
|
response_ms: 0.012, # in milliseconds
|
@@ -100,12 +106,14 @@ CREATE TABLE `checks` (
|
|
100
106
|
CREATE TABLE `results` (
|
101
107
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
102
108
|
`check_id` int(11) NOT NULL,
|
109
|
+
`probe` varchar(255) NOT NULL DEFAULT '',
|
103
110
|
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
104
111
|
`status` tinyint(1) NOT NULL,
|
105
112
|
`response_ms` float NOT NULL DEFAULT '0',
|
106
|
-
`status_desc` varchar(255)
|
113
|
+
`status_desc` varchar(255) DEFAULT NULL,
|
107
114
|
PRIMARY KEY (`id`),
|
108
115
|
KEY `check_id` (`check_id`),
|
116
|
+
KEY `probe` (`probe`),
|
109
117
|
KEY `timestamp` (`timestamp`),
|
110
118
|
KEY `status` (`status`)
|
111
119
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
data/lib/eznemo/mysql.rb
CHANGED
@@ -11,6 +11,7 @@ module EzNemo
|
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
@results = []
|
14
|
+
@probe = EzNemo.config[:probe][:name]
|
14
15
|
@opts = EzNemo.config[:datastore][:options]
|
15
16
|
@opts[:flags] = Mysql2::Client::MULTI_STATEMENTS
|
16
17
|
end
|
@@ -51,6 +52,7 @@ module EzNemo
|
|
51
52
|
sync ? db = database : db = emdatabase
|
52
53
|
stmt = ''
|
53
54
|
@results.each do |r|
|
55
|
+
r[:probe] = @probe
|
54
56
|
r[:status_desc] = db.escape(r[:status_desc])
|
55
57
|
cols = r.keys.join(',')
|
56
58
|
vals = r.values.join("','")
|
data/lib/eznemo/version.rb
CHANGED
data/lib/eznemo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eznemo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken J.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kajiki
|