This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdbi_neutron_agents.json
58 lines (58 loc) · 2.18 KB
/
dbi_neutron_agents.json
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"queries": [
{
"name": "agents_down",
"statement": "select concat_ws('/', 'agents', replace(replace(a1.binary, '-agent', ''), 'neutron-', ''), 'down') as metric, count(a2.id) as value from agents a1 left outer join agents a2 on a1.id = a2.id and a1.admin_state_up=1 and timestampdiff(SECOND,a1.heartbeat_timestamp,utc_timestamp())>60 group by a1.binary",
"results": [
{
"instance_from": "metric",
"value_from": "value"
}
]
},
{
"name": "agents_up",
"statement": "select concat_ws('/', 'agents', replace(replace(a1.binary, '-agent', ''), 'neutron-', ''), 'up') as metric, count(a2.id) as value from agents a1 left outer join agents a2 on a1.id = a2.id and a1.admin_state_up=1 and timestampdiff(SECOND,a1.heartbeat_timestamp,utc_timestamp())<60 group by a1.binary",
"results": [
{
"instance_from": "metric",
"value_from": "value"
}
]
},
{
"name": "agents_disabled",
"statement": "select concat_ws('/', 'agents', replace(replace(a1.binary, '-agent', ''), 'neutron-', ''), 'disabled') as metric, count(a2.id) as value from agents a1 left outer join agents a2 on a1.id = a2.id and a1.admin_state_up=0 group by a1.binary",
"results": [
{
"instance_from": "metric",
"value_from": "value"
}
]
}
],
"databases": [
{
"name": "neutron",
"driver": "mysql",
"driver_option": {
"host": "123.456.78.9",
"port": "3306",
"username": "neutron",
"password": "passwd",
"dbname": "neutron"
},
"dbqueries": [
{
"query": "agents_down"
},
{
"query": "agents_up"
},
{
"query": "agents_disabled"
}
]
}
]
}