-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoc.go
More file actions
28 lines (28 loc) · 909 Bytes
/
doc.go
File metadata and controls
28 lines (28 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
//haproxy agent-check utility
//
//Inspired by http://blog.loadbalancer.org/open-source-windows-service-for-reporting-server-load-back-to-haproxy-load-balancer-feedback-agent/
//
//Responds to telnet request with CPU Idle %.
//
//Also opens up a command channel on localhost that will accept
//management commands (i.e. Drain, Stop, Ready)
//
//Can be used with haproxy's agent-check to weight traffic based on CPU load.
//
//Note: The agent check functionality was added as of version 1.5
//
// [user@aServer ~]$ nc localhost 5309
// UP 99%
// [user@aServer ~]$ echo "DRAIN" | nc localhost 8675
// DRAIN OK
// [user@aServer ~]$ nc localhost 5309
// DRAIN 99%
//
// user@aServer ~]$ echo "READY" | nc localhost 8675
// READY OK
// [user@aServer ~]$ nc localhost 5309
// READY 100%
//
//agent_check can be run from the command line or with supervisord and supervisord-like utilities.
package main