Skip to content

Commit 611a8f6

Browse files
committed
Monitor all machines with grafana/prometheus
Default this needs an additional machine so we don't install unless its an actual choice. Collectd is superseded by prometheus which runs on localhost so the variable is not needed anymore.
1 parent 6d016df commit 611a8f6

File tree

15 files changed

+114
-4
lines changed

15 files changed

+114
-4
lines changed

icpc-wf/ansible/admin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
tags: clusterssh
3939
- role: phpstorm
4040
tags: phpstorm
41+
- role: prometheus_target_all
42+
tags: prometheus_target_all
43+
when: GRAFANA_MONITORING
4144
handlers:
4245
- include: handlers.yml
4346
tasks:

icpc-wf/ansible/domserver.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
tags: mysql_replication
3737
- role: keepalived
3838
tags: keepalived
39+
- role: prometheus_target_web
40+
tags: prometheus_target_web
41+
when: GRAFANA_MONITORING
42+
- role: prometheus_target_all
43+
tags: prometheus_target_all
44+
when: GRAFANA_MONITORING
3945
handlers:
4046
- include: handlers.yml
4147
tasks:

icpc-wf/ansible/grafana.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
host_type: grafana
66
become: yes
77
tasks:
8+
- role: prometheus_target_all
9+
tags: prometheus_target_all
10+
when: GRAFANA_MONITORING
811
- name: include global variables
912
include_vars: variables.yml
1013
- name: include global (secret) variables

icpc-wf/ansible/group_vars/all/all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ DJ_GIT_REPO_SCRIPTS: "domjudge@{{DJ_GIT_HOST}}:domjudge-scripts-bare"
4242

4343
PHPSTORM_VERSION: 2021.2
4444
PHPSTORM_FULL_VERSION: 212.5284.49
45+
46+
GRAFANA_MONITORING: false

icpc-wf/ansible/group_vars/all/secret.yml.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# Set this to enable master-master replication between two domservers.
33
REPLICATION_PASSWORD: some-replication-password
44

5-
# Password for the collectd MySQL status user.
6-
# Set this to enable collectd for system statistics collection.
7-
COLLECTD_MYSQL_PASSWORD: password-here
8-
95
# Database user password.
106
DB_PASSWORD: some-database-password
117

icpc-wf/ansible/judgehost.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- role: icpc_fixes
1313
tags: icpc_fixes
1414
when: ICPC_IMAGE
15+
- role: prometheus_target_all
16+
tags: prometheus_target_all
17+
when: GRAFANA_MONITORING
1518
- role: system_fixes
1619
tags: system_fixes
1720
- role: hosts
@@ -30,6 +33,9 @@
3033
tags: ssh
3134
- role: domlogo
3235
tags: domlogo
36+
- role: prometheus_target_all
37+
tags: prometheus_target_all
38+
when: GRAFANA_MONITORING
3339
pre_tasks:
3440
- pause:
3541
prompt: "Did you disable all judges"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# This tasks gathers default system metrics.
3+
4+
- name: install required packages
5+
apt:
6+
state: present
7+
pkg:
8+
- prometheus-node-exporter
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/php-fpm_exporter*.tar.gz
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add to this directory:
2+
php-fpm_exporter.tar.gz (See https://github.com/hipages/php-fpm_exporter/releases)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server {
2+
listen 8080;
3+
listen [::]:8080;
4+
server_name _default_;
5+
6+
location = /basic_status {
7+
stub_status;
8+
}
9+
}

0 commit comments

Comments
 (0)