Skip to content

Commit e51f9cb

Browse files
authored
Merge pull request #344 from netbox-community/Prometheus
Prepare for Monitoring with Prometheus
2 parents 071401b + 5512ea6 commit e51f9cb

File tree

6 files changed

+22
-3
lines changed

6 files changed

+22
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ configuration/*
88
!configuration/extra.py
99
configuration/ldap/*
1010
!configuration/ldap/ldap_config.py
11+
prometheus.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The default credentials are:
7979
## Documentation
8080

8181
Please refer [to our wiki on Github][netbox-docker-wiki] for further information on how to use this Netbox Docker image properly.
82-
It covers advanced topics such as using secret files, deployment to Kubernetes as well as NAPALM and LDAP configuration.
82+
It covers advanced topics such as using files for secrets, deployment to Kubernetes, monitoring and configuring NAPALM or LDAP.
8383

8484
[netbox-docker-wiki]: https://github.com/netbox-community/netbox-docker/wiki/
8585

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ services:
2727
- /opt/netbox/netbox/manage.py
2828
command:
2929
- rqworker
30+
31+
# nginx
3032
nginx:
3133
command: nginx -c /etc/netbox-nginx/nginx.conf
3234
image: nginx:1.19-alpine
@@ -37,11 +39,15 @@ services:
3739
volumes:
3840
- netbox-static-files:/opt/netbox/netbox/static:ro
3941
- netbox-nginx-config:/etc/netbox-nginx/:ro
42+
43+
# postgres
4044
postgres:
4145
image: postgres:12-alpine
4246
env_file: env/postgres.env
4347
volumes:
4448
- netbox-postgres-data:/var/lib/postgresql/data
49+
50+
# redis
4551
redis:
4652
image: redis:6-alpine
4753
command:
@@ -58,6 +64,7 @@ services:
5864
- -c # this is to evaluate the $REDIS_PASSWORD from the env
5965
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
6066
env_file: env/redis-cache.env
67+
6168
volumes:
6269
netbox-static-files:
6370
driver: local

docker/gunicorn_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
accesslog = '-'
77
capture_output = False
88
loglevel = 'info'
9+
raw_env = 'prometheus_multiproc_dir=/tmp/metrics'

docker/nginx.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,13 @@ http {
3232
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
3333
}
3434
}
35+
36+
server {
37+
listen 8081;
38+
access_log off;
39+
40+
location = /stub_status {
41+
stub_status;
42+
}
43+
}
3544
}

env/netbox.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ EMAIL_USE_SSL=false
1414
EMAIL_USE_TLS=false
1515
EMAIL_SSL_CERTFILE=
1616
EMAIL_SSL_KEYFILE=
17+
MAX_PAGE_SIZE=1000
1718
MEDIA_ROOT=/opt/netbox/netbox/media
19+
METRICS_ENABLED=false
1820
NAPALM_USERNAME=
1921
NAPALM_PASSWORD=
2022
NAPALM_TIMEOUT=10
21-
MAX_PAGE_SIZE=1000
2223
REDIS_HOST=redis
2324
REDIS_PASSWORD=H733Kdjndks81
2425
REDIS_DATABASE=0
@@ -27,6 +28,7 @@ REDIS_CACHE_HOST=redis-cache
2728
REDIS_CACHE_PASSWORD=t4Ph722qJ5QHeQ1qfu36
2829
REDIS_CACHE_DATABASE=1
2930
REDIS_CACHE_SSL=false
31+
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
3032
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
3133
SKIP_STARTUP_SCRIPTS=false
3234
SKIP_SUPERUSER=false
@@ -35,4 +37,3 @@ SUPERUSER_EMAIL=admin@example.com
3537
SUPERUSER_PASSWORD=admin
3638
SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567
3739
WEBHOOKS_ENABLED=true
38-
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases

0 commit comments

Comments
 (0)