Add exit at network check, config.conf > config.conf.sample

This commit is contained in:
no
2024-11-28 14:21:56 +01:00
parent c06012685f
commit 362a5071ca
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ Dieses Projekt implementiert ein flexibles und robustes VPN-Überwachungsskript,
chmod +x functions/*.sh chmod +x functions/*.sh
``` ```
4. Passe die `config.conf` Datei an: 4. Kopiere `config.conf.sample` zu `config.conf` und passe die Datei an:
- Definiere Netzwerkinterface, Schwellenwerte, Datenbankeinstellungen, SSH-Details und Logdateipfad. - Definiere Netzwerkinterface, Schwellenwerte, Datenbankeinstellungen, SSH-Details und Logdateipfad.
5. (Optional) Füge die Logrotation hinzu: 5. (Optional) Füge die Logrotation hinzu:
View File
+2
View File
@@ -25,7 +25,9 @@ function check_network_traffic() {
if (( $(echo "$avg_inbound < $THRESHOLD_INBOUND" | bc -l) )) || (( $(echo "$avg_outbound < $THRESHOLD_OUTBOUND" | bc -l) )); then if (( $(echo "$avg_inbound < $THRESHOLD_INBOUND" | bc -l) )) || (( $(echo "$avg_outbound < $THRESHOLD_OUTBOUND" | bc -l) )); then
log_critical "Network traffic below thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s." log_critical "Network traffic below thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s."
restart_service restart_service
exit 2 # Exit with error status if thresholds are not met
else else
log_info "Network traffic is above thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s." log_info "Network traffic is above thresholds. Avg In: $avg_inbound KB/s, Avg Out: $avg_outbound KB/s."
exit 0 # Exit with success status
fi fi
} }