Compare commits
3 Commits
5017cb5dfb
...
64721148d8
Author | SHA1 | Date |
---|---|---|
Gregor Michels | 64721148d8 | |
Gregor Michels | e3b111f2c7 | |
Gregor Michels | 5fa5b13da7 |
|
@ -54,3 +54,13 @@ groups:
|
||||||
annotations:
|
annotations:
|
||||||
summary: Host out of inodes (instance {{ $labels.instance }})
|
summary: Host out of inodes (instance {{ $labels.instance }})
|
||||||
description: "Disk is almost running out of available inodes (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
|
description: "Disk is almost running out of available inodes (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
|
||||||
|
|
||||||
|
- name: Network
|
||||||
|
rules:
|
||||||
|
- alert: PortChangedState
|
||||||
|
expr: changes(ifLastChange[2h]) != 0
|
||||||
|
labels:
|
||||||
|
severity: warning
|
||||||
|
annotations:
|
||||||
|
summary: A switch port changed it's state {{ $value }}x time
|
||||||
|
description: "For some reason a switch port changed it's state\n LABELS = {{ $labels }}"
|
||||||
|
|
|
@ -6,3 +6,6 @@ pass on wg2 proto ospf
|
||||||
|
|
||||||
# allow prometheus on wg2
|
# allow prometheus on wg2
|
||||||
pass on wg2 proto tcp from any to self port 9100
|
pass on wg2 proto tcp from any to self port 9100
|
||||||
|
|
||||||
|
# allow outgoing snmp on wg2
|
||||||
|
pass out on wg2 proto udp from self to any port snmp
|
||||||
|
|
Binary file not shown.
|
@ -61,6 +61,7 @@
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- prometheus
|
- prometheus
|
||||||
|
- snmp_exporter
|
||||||
- alertmanager
|
- alertmanager
|
||||||
- grafana
|
- grafana
|
||||||
|
|
||||||
|
@ -148,6 +149,7 @@
|
||||||
state: started
|
state: started
|
||||||
with_items:
|
with_items:
|
||||||
- prometheus
|
- prometheus
|
||||||
|
- snmp_exporter
|
||||||
- alertmanager
|
- alertmanager
|
||||||
- grafana
|
- grafana
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,14 @@ config rule
|
||||||
option dest_port 9100
|
option dest_port 9100
|
||||||
option target ACCEPT
|
option target ACCEPT
|
||||||
|
|
||||||
|
config rule
|
||||||
|
option name From-BACKBONE-Into-MGMT-Allow-SNMP
|
||||||
|
option src backbone
|
||||||
|
option dest mgmt
|
||||||
|
option proto udp
|
||||||
|
option dest_port 161
|
||||||
|
option target ACCEPT
|
||||||
|
|
||||||
config rule
|
config rule
|
||||||
option name From-Any-Allow-SSH
|
option name From-Any-Allow-SSH
|
||||||
option src *
|
option src *
|
||||||
|
|
|
@ -39,8 +39,7 @@ spanning-tree mst configuration
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
no snmp community "public"
|
snmp community "public" ro
|
||||||
snmp community "{{ lookup('passwordstore', 'snmp-community') }}" ro
|
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
ip ssh
|
ip ssh
|
||||||
|
|
|
@ -36,6 +36,23 @@ scrape_configs:
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
- job_name: 'snmp'
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
{% for host in groups['switches_stock'] %}
|
||||||
|
- {{ hostvars[host]['ip'] }}
|
||||||
|
{% endfor %}
|
||||||
|
metrics_path: /snmp
|
||||||
|
params:
|
||||||
|
module: [if_mib]
|
||||||
|
relabel_configs:
|
||||||
|
- source_labels: [__address__]
|
||||||
|
target_label: __param_target
|
||||||
|
- source_labels: [__param_target]
|
||||||
|
target_label: instance
|
||||||
|
- target_label: __address__
|
||||||
|
replacement: 127.0.0.1:9116 # The SNMP exporter's real hostname:port.
|
||||||
|
|
||||||
- job_name: 'blackbox'
|
- job_name: 'blackbox'
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
|
|
Reference in New Issue