vlad-status 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.autotest ADDED
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
data/.gemtest ADDED
File without changes
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ === 0.0.1 / 2011-07-14
2
+
3
+ * Init
4
+
data/Manifest.txt ADDED
@@ -0,0 +1,7 @@
1
+ .autotest
2
+ History.txt
3
+ lib/vlad/status.rb
4
+ Manifest.txt
5
+ Rakefile
6
+ README.txt
7
+ test/test_vlad_status.rb
data/README.txt ADDED
@@ -0,0 +1,59 @@
1
+ = vlad-status
2
+
3
+ * http://github.com/jmervine/vlad-status
4
+
5
+ == DESCRIPTION:
6
+
7
+ Adds support to Vlad for checking app and web server status.
8
+
9
+
10
+ == FEATURES/PROBLEMS:
11
+
12
+ * Only tested with nginx and unicorn running on Ubuntu.
13
+ ** Might work with others, but if not should be easy
14
+ to modify for you server, feel free to submit
15
+ patches.
16
+
17
+ == SYNOPSIS:
18
+
19
+ $ rake <env> vlad:web:status
20
+ $ rake <env> vlad:app:status
21
+
22
+
23
+ == REQUIREMENTS:
24
+
25
+ * Vlad[http://rubyhitsquad.com/Vlad_the_Deployer.html]
26
+
27
+ == INSTALL:
28
+
29
+ $ sudo gem install vlad-status
30
+ ^-- coming soon
31
+
32
+ == VARIABLES:
33
+
34
+ * Anything required for vlad.
35
+
36
+ == LICENSE:
37
+
38
+ (The MIT License)
39
+
40
+ Copyright (c) 2011 Joshua Mervine
41
+
42
+ Permission is hereby granted, free of charge, to any person obtaining
43
+ a copy of this software and associated documentation files (the
44
+ 'Software'), to deal in the Software without restriction, including
45
+ without limitation the rights to use, copy, modify, merge, publish,
46
+ distribute, sublicense, and/or sell copies of the Software, and to
47
+ permit persons to whom the Software is furnished to do so, subject to
48
+ the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be
51
+ included in all copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
54
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
55
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
56
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
57
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
58
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
59
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.plugin :hg
7
+
8
+ Hoe.spec 'vlad-status' do
9
+ #self.rubyforge_name = 'vlad-status'
10
+ developer('Joshua P. Mervine', 'joshua@mervine.net')
11
+ extra_deps << ['vlad', '~> 2.0']
12
+ clean_globs << '.yardoc'
13
+ end
14
+
15
+ # vim: syntax=ruby
@@ -0,0 +1,47 @@
1
+ require 'vlad'
2
+
3
+ module Vlad
4
+ module Status
5
+ VERSION = '0.0.1' #:nodoc:
6
+ end
7
+ end
8
+
9
+ namespace :vlad do
10
+
11
+ def status_cmd(svr)
12
+
13
+ master = "master"
14
+ worker = "worker"
15
+ psub = "**REPLACE**"
16
+
17
+ ps = []
18
+ ps << %(ps aux)
19
+ ps << %(grep "#{svr}")
20
+ ps << %(grep "#{psub}")
21
+ ps << %(grep -v grep)
22
+ ps << %(wc -l)
23
+
24
+ cmd = []
25
+ cmd << %(echo "Getting status for #{svr} on `hostname`")
26
+ cmd << %(echo " #{master} processes running: `#{ps.join(" | ").gsub(psub, master)}`")
27
+ cmd << %(echo " #{worker} processes running: `#{ps.join(" | ").gsub(psub, worker)}`")
28
+ cmd.join(" && ")
29
+
30
+ end
31
+
32
+ namespace :web do
33
+ desc "Status of web servers."
34
+ remote_task :status, :roles => :web do
35
+ run status_cmd(web.to_s)
36
+ end
37
+ end
38
+
39
+ namespace :app do
40
+ desc "Status of app servers."
41
+ remote_task :status, :roles => :app do
42
+ run status_cmd(app.to_s)
43
+ end
44
+ end
45
+
46
+ end
47
+
@@ -0,0 +1,8 @@
1
+ require "test/unit"
2
+ require "vlad/push"
3
+
4
+ class TestVladPush < Test::Unit::TestCase
5
+ def test_sanity
6
+ flunk "write tests or I will kneecap you"
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vlad-status
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Joshua P. Mervine
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-07-15 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: vlad
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 2
31
+ - 0
32
+ version: "2.0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 23
44
+ segments:
45
+ - 2
46
+ - 10
47
+ version: "2.10"
48
+ type: :development
49
+ version_requirements: *id002
50
+ description: Adds support to Vlad for checking app and web server status.
51
+ email:
52
+ - joshua@mervine.net
53
+ executables: []
54
+
55
+ extensions: []
56
+
57
+ extra_rdoc_files:
58
+ - History.txt
59
+ - Manifest.txt
60
+ - README.txt
61
+ files:
62
+ - .autotest
63
+ - History.txt
64
+ - lib/vlad/status.rb
65
+ - Manifest.txt
66
+ - Rakefile
67
+ - README.txt
68
+ - test/test_vlad_status.rb
69
+ - .gemtest
70
+ homepage: http://github.com/jmervine/vlad-status
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options:
75
+ - --main
76
+ - README.txt
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ requirements: []
98
+
99
+ rubyforge_project: vlad-status
100
+ rubygems_version: 1.8.5
101
+ signing_key:
102
+ specification_version: 3
103
+ summary: Adds support to Vlad for checking app and web server status.
104
+ test_files:
105
+ - test/test_vlad_status.rb