1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-08-10 22:31:28 +02:00

update collectd

This commit is contained in:
kev
2017-03-23 16:49:18 +08:00
parent e0166b7ffb
commit dc7b50337f
9 changed files with 54 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ in RRD files.
```
~/fig/collectd/
├── collectd/
├── data/
│   ├── collectd.conf
│   └── conf.d/
│   └── network.conf
@@ -20,7 +20,7 @@ in RRD files.
collectd.conf
```
```apache
Hostname "localhost"
FQDNLookup false
@@ -39,7 +39,7 @@ Include "/etc/collectd/conf.d/*.conf"
network.conf
```
```apache
LoadPlugin network
<Plugin "network">
@@ -47,13 +47,40 @@ LoadPlugin network
</Plugin>
```
weather.conf
```apache
LoadPlugin curl_json
<Plugin curl_json>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D2151330%20and%20u%3D'c'&format=json">
Instance "Beijing"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D2151849%20and%20u%3D'c'&format=json">
Instance "Shanghai"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D23511745%20and%20u%3D'c'&format=json">
Instance "Silicon_Valley"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
</Plugin>
```
## docker-compose.yml
```
collectd:
image: vimagick/collectd
volumes:
- ./collectd:/etc/collectd
- ./data:/etc/collectd
pid: host
net: host
restart: always

View File

@@ -0,0 +1,22 @@
LoadPlugin curl_json
<Plugin curl_json>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D2151330%20and%20u%3D'c'&format=json">
Instance "Beijing"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D2151849%20and%20u%3D'c'&format=json">
Instance "Shanghai"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
<URL "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%3D23511745%20and%20u%3D'c'&format=json">
Instance "Silicon_Valley"
<Key "query/results/channel/item/condition/temp">
Type "gauge"
</Key>
</URL>
</Plugin>

View File

@@ -1,7 +1,7 @@
collectd:
image: vimagick/collectd
volumes:
- ./collectd:/etc/collectd
- ./data:/etc/collectd
pid: host
net: host
restart: always