Skip to content

Commit

Permalink
Smaller fixes (#128)
Browse files Browse the repository at this point in the history
* b.tunnel is now ansible deployed

* fix fail2ban for hosts without rsyslog

* fix uisp hostname

* persist a few experiments
  • Loading branch information
nicolasberens authored Aug 25, 2024
1 parent c3b40b3 commit a9c4063
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 11 deletions.
2 changes: 1 addition & 1 deletion inventory/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ util.berlin.freifunk.net # hopglass
download-master.berlin.freifunk.net

[uisp]
uisp.berlin.freifunk.net ansible_host=10.31.130.158 # New uisp VM
uisp.olsr ansible_host=10.31.130.158 # New uisp VM

[website]
web.berlin.freifunk.net
Expand Down
2 changes: 1 addition & 1 deletion play.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
- ff_monitor

- name: Set up tunneldigger
hosts: tunneldigger,!b.tunnel.berlin.freifunk.net
hosts: tunneldigger
become: true
roles:
- tunneldigger
Expand Down
13 changes: 9 additions & 4 deletions roles/common/templates/fail2ban-ffberlin.local.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
[DEFAULT]
backend = systemd

[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3 # ban after 3 failed tries
bantime = 86400 # ban for 24h
findtime = 3600 # count tries within one hour
# ban after 3 failed tries
maxretry = 3
# ban for 24h
bantime = 86400
# count tries within one hour
findtime = 3600
2 changes: 1 addition & 1 deletion roles/ff_monitor/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- name: Restart php-fpm
ansible.builtin.systemd:
daemon_reload: true
name: php7.4-fpm
name: php8.2-fpm
enabled: true
state: restarted

Expand Down
2 changes: 1 addition & 1 deletion roles/ff_monitor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
name: remove old rrd files
special_time: daily
user: root
job: find /mnt/collectd/rrd/ -type f -mtime +14 -delete; find /mnt/collectd/rrd/ -type d -empty -delete
job: find /mnt/collectd/rrd/ -type f -mtime +30 -delete; find /mnt/collectd/rrd/ -type d -empty -delete

- name: Create a directory if it does not exist
ansible.builtin.file:
Expand Down
6 changes: 6 additions & 0 deletions roles/ff_monitor/templates/grafana.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ router_logging = false
[analytics]
reporting_enabled = false
check_for_updates = false
enabled = false
[security]
disable_gravatar = true
[users]
Expand Down Expand Up @@ -97,8 +98,13 @@ enabled = true

[plugins]
allow_loading_unsigned_plugins = panodata-map-panel
hide_angular_deprecation = true

[feature_toggles]
angularDeprecationUI=false
publicDashboards = true
[unified_alerting]
enabled = true

[panels]
enable_alpha = true
2 changes: 1 addition & 1 deletion roles/ff_monitor/templates/prometheus.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{ ansible_managed }}
# Set the command-line arguments to pass to the server.

ARGS="--storage.tsdb.retention.size=90GB --enable-feature=memory-snapshot-on-shutdown --web.listen-address=127.0.0.1:9090"
ARGS="--storage.tsdb.retention.size=100GB --enable-feature=memory-snapshot-on-shutdown --web.listen-address=127.0.0.1:9090"
15 changes: 15 additions & 0 deletions roles/ff_monitor/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ alerting:
- targets: ['localhost:9093']

rule_files:
- rules.yml

scrape_configs:

Expand All @@ -25,6 +26,13 @@ scrape_configs:
static_configs:
- targets: ['localhost:9090']

- job_name: 'pushgateway'
scrape_interval: 30s
scrape_timeout: 30s
honor_labels: true
static_configs:
- targets: ['localhost:9091']

- job_name: collectd
scrape_interval: 30s
static_configs:
Expand All @@ -38,6 +46,13 @@ scrape_configs:
- job_name: servers
static_configs:
- targets:
- "a36s-hyp03.berlin.freifunk.net:9100"
{% for host in groups.all %}
- "{{ host }}:9100"
{% endfor %}

- job_name: 'weather'
scrape_interval: 900s
scrape_timeout: 30s
static_configs:
- targets: ['127.0.0.1:9111']
12 changes: 10 additions & 2 deletions templates/Caddyfile_monitor.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,13 @@ monitor.berlin.freifunk.net {
}




# Pushgw
http://10.31.130.151:9091 {
bind 10.31.130.151
# @delete-get { # TODO Fix
# return 418
# }
# @put-post {
reverse_proxy http://127.0.0.1:9091
# }
}

0 comments on commit a9c4063

Please sign in to comment.