newrelic_haproxy_agent 0.0.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +57 -8
- data/bin/newrelic_haproxy_agent +5 -0
- data/config/newrelic_plugin.yml.example +2 -8
- data/lib/newrelic_haproxy_agent.rb +1 -1
- data/newrelic_haproxy_agent.gemspec +2 -2
- metadata +2 -2
data/README.md
CHANGED
@@ -1,10 +1,59 @@
|
|
1
|
-
## New Relic Haproxy
|
1
|
+
## New Relic Haproxy monitoring Plugin
|
2
2
|
|
3
|
-
|
3
|
+
The New Relic Haproxy Plugin enables monitoring of HAProxy – a TCP/HTTP load balancer – and reports the following data for a specified proxy:
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
* Error Rate (per-min)
|
6
|
+
* Proxy Status
|
7
|
+
* Request Rate (per-min)
|
8
|
+
* Active Servers
|
9
|
+
* Sessions Active
|
10
|
+
* Sessions Queued
|
11
|
+
|
12
|
+
### Requirements
|
13
|
+
|
14
|
+
The Haproxy monitoring Plugin for New Relic requires the following:
|
15
|
+
|
16
|
+
* A New Relic account. Signup for a free account at http://newrelic.com
|
17
|
+
* You need a host to install the plugin on that is able to poll the desired Haproxy server. That host also needs Ruby (tested with 1.8.7, 1.9.3), and support for rubygems.
|
18
|
+
|
19
|
+
### Instructions for running the Haproxy agent
|
20
|
+
|
21
|
+
1. Install this gem from RubyGems:
|
22
|
+
|
23
|
+
`sudo gem install newrelic_haproxy_agent`
|
24
|
+
|
25
|
+
2. Install config, execute
|
26
|
+
|
27
|
+
`sudo newrelic_haproxy_agent install` - it will create `/etc/newrelic/newrelic_haproxy_agent.yml` file for you.
|
28
|
+
|
29
|
+
3. Edit the `/etc/newrelic/newrelic_haproxy_agent.yml` file generated in step 2.
|
30
|
+
|
31
|
+
3.1. replace `YOUR_LICENSE_KEY_HERE` with your New Relic license key. Your license key can be found under Account Settings at https://rpm.newrelic.com, see https://newrelic.com/docs/subscriptions/license-key for more help.
|
32
|
+
|
33
|
+
3.2. add the URI of the haproxy CSV stats url
|
34
|
+
|
35
|
+
4. Execute
|
36
|
+
|
37
|
+
`newrelic_haproxy_agent run`
|
38
|
+
|
39
|
+
5. Go back to the Plugins list and after a brief period you will see the Haproxy Plugin listed in your New Relic account
|
40
|
+
|
41
|
+
|
42
|
+
## Keep this process running
|
43
|
+
|
44
|
+
You can use services like these to manage this process and run it as a daemon.
|
45
|
+
|
46
|
+
- [Upstart](http://upstart.ubuntu.com/)
|
47
|
+
- [Systemd](http://www.freedesktop.org/wiki/Software/systemd/)
|
48
|
+
- [Runit](http://smarden.org/runit/)
|
49
|
+
- [Monit](http://mmonit.com/monit/)
|
50
|
+
|
51
|
+
Also you can use [foreman](https://github.com/ddollar/foreman) for daemonization.
|
52
|
+
|
53
|
+
Foreman can be useful if you want to use [Heroku](https://www.heroku.com/) for run your agent. Just add Procfile and push to Heroku.
|
54
|
+
|
55
|
+
`monitor_daemon: newrelic_haproxy_agent run -c config/newrelic_plugin.yml`
|
56
|
+
|
57
|
+
## Support
|
58
|
+
|
59
|
+
Please use Github issue for support.
|
data/bin/newrelic_haproxy_agent
CHANGED
@@ -37,6 +37,11 @@ end
|
|
37
37
|
args = options.parse!(ARGV)
|
38
38
|
|
39
39
|
if args.first == "run"
|
40
|
+
if !File.exists? NewRelic::Plugin::Config.config_file
|
41
|
+
puts "Agent config file not found: #{NewRelic::Plugin::Config.config_file.inspect}"
|
42
|
+
puts "Run 'sudo newrelic_haproxy_agent install' for setup config"
|
43
|
+
exit 1
|
44
|
+
end
|
40
45
|
NewRelicHaproxyAgent.run
|
41
46
|
elsif args.first == "install"
|
42
47
|
config_file = File.read(File.expand_path("../../config/newrelic_plugin.yml.example", __FILE__))
|
@@ -1,12 +1,6 @@
|
|
1
1
|
#
|
2
2
|
#
|
3
|
-
# This is a sample newrelic_plugin.yml file.
|
4
|
-
# to the following location if it is not already there:
|
5
|
-
#
|
6
|
-
# ./config/newrelic_plugin.yml
|
7
|
-
#
|
8
|
-
# Where the current directory is the directory where your main program resides and is your current
|
9
|
-
# directory when you run the main program.
|
3
|
+
# This is a sample newrelic_plugin.yml file.
|
10
4
|
#
|
11
5
|
# Please make sure to update the license_key information with the license key for your New Relic
|
12
6
|
# account.
|
@@ -21,7 +15,7 @@ newrelic:
|
|
21
15
|
# Set to '1' for verbose output, remove for normal output.
|
22
16
|
# All output goes to stdout/stderr.
|
23
17
|
#
|
24
|
-
verbose:
|
18
|
+
verbose: 0
|
25
19
|
#
|
26
20
|
# Agent Configuration:
|
27
21
|
#
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'newrelic_haproxy_agent'
|
16
|
-
s.version = '0.0
|
17
|
-
s.date = '2013-06-
|
16
|
+
s.version = '1.0.0'
|
17
|
+
s.date = '2013-06-30'
|
18
18
|
# s.rubyforge_project = 'newrelic_haproxy_agent'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_haproxy_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: newrelic_plugin
|