Skip to content

Commit b044344

Browse files
author
Phung Mike
committed
added config file for credentials and updated README.md how to use it and how to change the password correctly
1 parent 5ec3ce1 commit b044344

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dockprom
22
========
33

4-
A monitoring solution for Docker hosts and containers with [Prometheus](https://prometheus.io/), [Grafana](http://grafana.org/), [cAdvisor](https://github.com/google/cadvisor),
4+
A monitoring solution for Docker hosts and containers with [Prometheus](https://prometheus.io/), [Grafana](http://grafana.org/), [cAdvisor](https://github.com/google/cadvisor),
55
[NodeExporter](https://github.com/prometheus/node_exporter) and alerting with [AlertManager](https://github.com/prometheus/alertmanager).
66

77
***If you're looking for the Docker Swarm version please go to [stefanprodan/swarmprom](https://github.com/stefanprodan/swarmprom)***
@@ -30,11 +30,28 @@ Containers:
3030
* Grafana (visualize metrics) `http://<host-ip>:3000`
3131
* NodeExporter (host metrics collector)
3232
* cAdvisor (containers metrics collector)
33-
* Caddy (reverse proxy and basic auth provider for prometheus and alertmanager)
33+
* Caddy (reverse proxy and basic auth provider for prometheus and alertmanager)
3434

3535
## Setup Grafana
3636

37-
Navigate to `http://<host-ip>:3000` and login with user ***admin*** password ***admin***. You can change the credentials in the compose file or by supplying the `ADMIN_USER` and `ADMIN_PASSWORD` environment variables on compose up.
37+
Navigate to `http://<host-ip>:3000` and login with user ***admin*** password ***admin***. You can change the credentials in the compose file or by supplying the `ADMIN_USER` and `ADMIN_PASSWORD` environment variables on compose up. The config file can be added directly in grafana part like this
38+
```
39+
grafana:
40+
image: grafana/grafana:5.2.4
41+
env_file:
42+
- config
43+
44+
```
45+
and the config file format should have this content
46+
```
47+
GF_SECURITY_ADMIN_USER=admin
48+
GF_SECURITY_ADMIN_PASSWORD=changeme
49+
GF_USERS_ALLOW_SIGN_UP=false
50+
```
51+
If you want to change the password, you have to remove this entry, otherwise the change will not take effect
52+
```
53+
- grafana_data:/var/lib/grafana
54+
```
3855

3956
Grafana is preconfigured with dashboards and Prometheus as the default data source:
4057

@@ -61,7 +78,7 @@ For storage and particularly Free Storage graph, you have to specify the fstype
6178
You can find it in `grafana/dashboards/docker_host.json`, at line 480 :
6279

6380
"expr": "sum(node_filesystem_free_bytes{fstype=\"btrfs\"})",
64-
81+
6582
I work on BTRFS, so i need to change `aufs` to `btrfs`.
6683

6784
You can find right value for your system in Prometheus `http://<host-ip>:9090` launching this request :
@@ -109,7 +126,7 @@ I've set the Prometheus retention period to 200h and the heap size to 1GB, you c
109126
- '-storage.local.retention=200h'
110127
```
111128
112-
Make sure you set the heap size to a maximum of 50% of the total physical memory.
129+
Make sure you set the heap size to a maximum of 50% of the total physical memory.
113130
114131
## Define alerts
115132
@@ -226,15 +243,15 @@ ALERT jenkins_high_memory
226243

227244
## Setup alerting
228245

229-
The AlertManager service is responsible for handling alerts sent by Prometheus server.
230-
AlertManager can send notifications via email, Pushover, Slack, HipChat or any other system that exposes a webhook interface.
246+
The AlertManager service is responsible for handling alerts sent by Prometheus server.
247+
AlertManager can send notifications via email, Pushover, Slack, HipChat or any other system that exposes a webhook interface.
231248
A complete list of integrations can be found [here](https://prometheus.io/docs/alerting/configuration).
232249

233250
You can view and silence notifications by accessing `http://<host-ip>:9093`.
234251

235252
The notification receivers can be configured in [alertmanager/config.yml](https://github.com/stefanprodan/dockprom/blob/master/alertmanager/config.yml) file.
236253

237-
To receive alerts via Slack you need to make a custom integration by choose ***incoming web hooks*** in your Slack team app page.
254+
To receive alerts via Slack you need to make a custom integration by choose ***incoming web hooks*** in your Slack team app page.
238255
You can find more details on setting up Slack integration [here](http://www.robustperception.io/using-slack-with-the-alertmanager/).
239256

240257
Copy the Slack Webhook URL into the ***api_url*** field and specify a Slack ***channel***.
@@ -258,7 +275,7 @@ receivers:
258275
## Sending metrics to the Pushgateway
259276
260277
The [pushgateway](https://github.com/prometheus/pushgateway) is used to collect data from batch jobs or from services.
261-
278+
262279
To push data, simply execute:
263280
264281
echo "some_metric 3.14" | curl --data-binary @- http://user:password@localhost:9091/metrics/job/some_job
@@ -344,4 +361,4 @@ To run the grafana container as `user: 104` change your `docker-compose.yml` lik
344361
- monitor-net
345362
labels:
346363
org.label-schema.group: "monitoring"
347-
```
364+
```

config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GF_SECURITY_ADMIN_USER=admin
2+
GF_SECURITY_ADMIN_PASSWORD=changeme
3+
GF_USERS_ALLOW_SIGN_UP=false

0 commit comments

Comments
 (0)