2017-06-20 02:52:20 +03:00
|
|
|
{
|
|
|
|
consul: 'localhost:8500',
|
|
|
|
jobs: [
|
2017-06-20 17:45:50 +03:00
|
|
|
{
|
2017-07-31 23:10:04 +03:00
|
|
|
name: 'consul-agent',
|
|
|
|
exec: ['/usr/local/bin/consul', 'agent',
|
|
|
|
'-data-dir=/data',
|
|
|
|
'-config-dir=/config',
|
|
|
|
'-log-level=err',
|
|
|
|
'-rejoin',
|
|
|
|
'-retry-join', '{{ .CONSUL | default "consul" }}',
|
|
|
|
'-retry-max', '10',
|
|
|
|
'-retry-interval', '10s'],
|
|
|
|
health: {
|
|
|
|
exec: '/usr/bin/curl -o /dev/null --fail -s http://localhost:8500',
|
|
|
|
interval: 5,
|
|
|
|
ttl: 25
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "preStart",
|
|
|
|
exec: "/bin/reload-nginx.sh preStart",
|
|
|
|
when: {
|
|
|
|
source: 'consul-agent',
|
|
|
|
once: 'healthy'
|
|
|
|
},
|
2017-06-20 17:45:50 +03:00
|
|
|
},
|
2017-06-20 02:52:20 +03:00
|
|
|
{
|
|
|
|
name: 'cp-frontend',
|
|
|
|
port: {{.PORT}},
|
2017-06-22 04:05:45 +03:00
|
|
|
exec: 'nginx',
|
|
|
|
interfaces: ["eth0", "eth1"],
|
|
|
|
restarts: 'unlimited',
|
2017-06-20 17:45:50 +03:00
|
|
|
when: {
|
2017-07-31 23:10:04 +03:00
|
|
|
source: 'preStart',
|
2017-06-20 17:45:50 +03:00
|
|
|
once: 'exitSuccess'
|
|
|
|
},
|
2017-06-20 02:52:20 +03:00
|
|
|
health: {
|
2017-08-02 01:38:20 +03:00
|
|
|
exec: 'pstree nginx',
|
|
|
|
interval: 10,
|
2017-06-22 04:05:45 +03:00
|
|
|
ttl: 25
|
2017-07-31 23:10:04 +03:00
|
|
|
}
|
2017-06-20 02:52:20 +03:00
|
|
|
},
|
|
|
|
{
|
2017-07-31 23:10:04 +03:00
|
|
|
name: "onchange-api",
|
|
|
|
exec: "/bin/reload-nginx.sh onChange",
|
|
|
|
when: {
|
|
|
|
source: "watch.api",
|
|
|
|
each: "changed"
|
|
|
|
}
|
2017-06-20 02:52:20 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_memory_usage',
|
2017-06-23 23:22:06 +03:00
|
|
|
exec: '/bin/sensors.sh memory',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '5s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_cpu_load',
|
2017-06-23 23:22:06 +03:00
|
|
|
exec: '/bin/sensors.sh cpu',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '5s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_disk_capacity',
|
2017-06-23 23:22:06 +03:00
|
|
|
exec: '/bin/sensors.sh diskcapacity',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '60s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_disk_usage',
|
2017-06-23 23:22:06 +03:00
|
|
|
exec: '/bin/sensors.sh diskusage',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '60s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
}
|
|
|
|
],
|
2017-07-31 23:10:04 +03:00
|
|
|
watches: [
|
|
|
|
{
|
|
|
|
name: 'api',
|
|
|
|
interval: 3
|
|
|
|
}
|
|
|
|
],
|
2017-06-20 02:52:20 +03:00
|
|
|
telemetry: {
|
|
|
|
port: 9090,
|
|
|
|
tags: ['op'],
|
|
|
|
metrics: [
|
|
|
|
{
|
2017-06-23 23:22:06 +03:00
|
|
|
namespace: 'frontend',
|
2017-06-20 02:52:20 +03:00
|
|
|
subsystem: 'memory',
|
|
|
|
name: 'percent',
|
|
|
|
help: 'Percentage of memory used',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
2017-06-23 23:22:06 +03:00
|
|
|
namespace: 'frontend',
|
2017-06-20 02:52:20 +03:00
|
|
|
subsystem: 'cpu',
|
|
|
|
name: 'load',
|
|
|
|
help: 'CPU load',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
2017-06-23 23:22:06 +03:00
|
|
|
namespace: 'frontend',
|
2017-06-20 02:52:20 +03:00
|
|
|
subsystem: 'disk',
|
|
|
|
name: 'capacity',
|
|
|
|
help: 'Disk capacity',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
2017-06-23 23:22:06 +03:00
|
|
|
namespace: 'frontend',
|
2017-06-20 02:52:20 +03:00
|
|
|
subsystem: 'disk',
|
|
|
|
name: 'usage',
|
|
|
|
help: 'Disk usage',
|
|
|
|
type: 'gauge'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|