hastats 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +24 -7
  2. data/bin/hastats +1 -1
  3. data/lib/hastats/version.rb +1 -1
  4. metadata +3 -3
data/README.rdoc CHANGED
@@ -2,13 +2,30 @@
2
2
 
3
3
  HAStats communicates with a running HAProxy process through the "stats socket" (not enabled by default). Through this socket you can query stats, reset counters, change server weightings, put servers in maintenance mode, and more.
4
4
 
5
+ === Setup HAProxy
6
+
7
+ Add the following to your HAProxy config (see the HAProxy documentation for more details):
8
+
9
+ # You can specify lower levels to restrict certain commands -- admin allows everything
10
+ stats socket /var/run/haproxy.sock level admin
11
+
5
12
  === Using the command line tool
6
13
 
7
- $ hastats info
8
- Name: HAProxy
9
- Version: 1.4.8
10
- Release_date: 2010/06/16
11
- Nbproc: 1
12
- Process_num: 1
13
- ...
14
+ $ hastats
15
+ Tasks:
16
+ hastats clear # [FUTURE] Clear counter maximums (see --all option)
17
+ hastats disable [BACKEND] [SERVER] # Put a server into MAINT mode
18
+ hastats enable [BACKEND] [SERVER] # Remove a server from MAINT mode
19
+ hastats errors # [FUTURE] Get current error information
20
+ hastats get_weight [BACKEND]/[SERVER] # [FUTURE] Get a server's weight
21
+ hastats help [TASK] # Describe available tasks or one specific task
22
+ hastats info # Get information about the HAProxy process
23
+ hastats sess # [FUTURE] Get current session information
24
+ hastats set_weight [BACKEND] [SERVER] [WEIGHT] # [FUTURE] Set a server's weight. Weight is a number or percentage of current weight
25
+ hastats stat # Get information about all frontends/backends/servers
26
+
27
+ Options:
28
+ -j, [--json] # Return results in JSON for easy parsing
29
+ -s, [--socket=SOCKET]
30
+ # Default: /usr/local/var/run/haproxy.sock
14
31
 
data/bin/hastats CHANGED
@@ -6,7 +6,7 @@ require 'thor'
6
6
 
7
7
  class HAStats::Bin < Thor
8
8
  map %w(-h --help) => :help
9
- class_option :socket, :aliases => %w(-s), :default => '/usr/local/var/run/haproxy.sock'
9
+ class_option :socket, :aliases => %w(-s), :default => '/var/run/haproxy.sock'
10
10
  class_option :json, :aliases => %w(-j), :type => :boolean, :default => false, :desc => "Return results in JSON for easy parsing"
11
11
 
12
12
  desc 'info', 'Get information about the HAProxy process'
@@ -1,4 +1,4 @@
1
1
  module HAStats
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hastats
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Travis Petticrew