add prometheus export
This commit is contained in:
31
config.py
31
config.py
@ -1,16 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
""" Author: Hendrik Schutter, mail@hendrikschutter.com
|
||||
Date of creation: 2023/02/26
|
||||
Date of last modification: 2023/02/26
|
||||
"""
|
||||
MAC Watcher - Configuration
|
||||
"""
|
||||
|
||||
# switch
|
||||
# --- SNMP / Switch ---
|
||||
switch_ip_addr = "10.0.0.2"
|
||||
switch_snmp_community = "public"
|
||||
snmp_poll_interval = 30 # seconds between SNMP queries
|
||||
snmpwalk_bin = "/usr/bin/snmpwalk" # full path to snmpwalk binary
|
||||
|
||||
# email
|
||||
mail_server_domain = 'smtp.maildomain.dev'
|
||||
# --- Email alerts ---
|
||||
mail_server_domain = "smtp.maildomain.dev"
|
||||
mail_server_port = 587
|
||||
mail_server_password = "__PW_DB__"
|
||||
mail_from_address = "sender@domain.com"
|
||||
@ -18,11 +19,23 @@ mail_from_name = "MAC-Watcher"
|
||||
mail_to_address = "dummy@example.com"
|
||||
mail_to_name = "Joe Doe"
|
||||
|
||||
# trusted macs
|
||||
# --- Trusted MAC addresses (whitelist) ---
|
||||
# Case-insensitive. Normalized to uppercase at startup.
|
||||
# MACs not in this list trigger an email alert.
|
||||
# All MACs seen in the last SNMP readout are exposed via Prometheus regardless.
|
||||
# Format: "AA:BB:CC:DD:EE:FF" # device description
|
||||
trusted_mac_addresses = [
|
||||
"00:EE:00:EE:40:EE", #Router
|
||||
"00:EE:C2:EE:82:EE", #Smartphone
|
||||
"00:EE:00:EE:40:EE", # Router
|
||||
"00:EE:C2:EE:82:EE", # Smartphone
|
||||
]
|
||||
|
||||
# --- MAC vendor lookup cache ---
|
||||
vendor_cache_file = "mac_vendor_cache.json"
|
||||
|
||||
# --- Prometheus exporter ---
|
||||
exporter_prefix = "mac_watcher_"
|
||||
exporter_host = "10.0.0.12"
|
||||
exporter_port = 9200
|
||||
|
||||
# --- Logging ---
|
||||
log_level = "INFO" # DEBUG, INFO, WARNING, ERROR
|
||||
|
||||
Reference in New Issue
Block a user