Compare commits
2 Commits
update-pah
...
main
Author | SHA1 | Date | |
---|---|---|---|
3875f4501f
|
|||
7fec5c5049
|
60
config.yaml
60
config.yaml
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
# MQTT Broker Configuration
|
# MQTT Broker Configuration
|
||||||
mqtt:
|
mqtt:
|
||||||
broker: "192.168.10.202"
|
broker: "IP or FQDN"
|
||||||
port: 1883
|
port: 1883
|
||||||
user: "snmp2mqtt"
|
user: "USER"
|
||||||
password: "snmp_2_MQTT"
|
password: "PASSWORD"
|
||||||
|
|
||||||
# Optional: Sleep interval between SNMP polls (default: 2 seconds)
|
# Optional: Sleep interval between SNMP polls (default: 2 seconds)
|
||||||
sleep_interval: 2
|
sleep_interval: 2
|
||||||
@@ -16,72 +16,30 @@ sleep_interval: 2
|
|||||||
devices:
|
devices:
|
||||||
# Device name (used for MQTT topics and Home Assistant device identification)
|
# Device name (used for MQTT topics and Home Assistant device identification)
|
||||||
mikrotik_hex:
|
mikrotik_hex:
|
||||||
ip: "192.168.10.2"
|
ip: "IP"
|
||||||
snmp_community: "public"
|
snmp_community: "public"
|
||||||
oids:
|
oids:
|
||||||
# Starlink VPN interface (interface index 12)
|
# example interface index 1
|
||||||
- name: "stln_vpn_in"
|
- name: "if1_in"
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.10.12"
|
|
||||||
type: "int"
|
|
||||||
HA_device_class: "data_size"
|
|
||||||
HA_platform: "sensor"
|
|
||||||
HA_unit: "bit"
|
|
||||||
|
|
||||||
- name: "stlon_vpn_out"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.16.12"
|
|
||||||
type: "int"
|
|
||||||
HA_device_class: "data_size"
|
|
||||||
HA_platform: "sensor"
|
|
||||||
HA_unit: "bit"
|
|
||||||
|
|
||||||
- name: "stln_vpn_status"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.8.12"
|
|
||||||
type: "bool"
|
|
||||||
HA_device_class: "connectivity"
|
|
||||||
HA_platform: "binary_sensor"
|
|
||||||
|
|
||||||
# LAN Bridge interface (interface index 6)
|
|
||||||
- name: "lan_bridge_in"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.10.6"
|
|
||||||
type: "int"
|
|
||||||
HA_device_class: "data_size"
|
|
||||||
HA_platform: "sensor"
|
|
||||||
HA_unit: "bit"
|
|
||||||
|
|
||||||
- name: "lan_bridge_out"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.16.6"
|
|
||||||
type: "int"
|
|
||||||
HA_device_class: "data_size"
|
|
||||||
HA_platform: "sensor"
|
|
||||||
HA_unit: "bit"
|
|
||||||
|
|
||||||
- name: "lan_bridge_status"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.8.6"
|
|
||||||
type: "bool"
|
|
||||||
HA_device_class: "connectivity"
|
|
||||||
HA_platform: "binary_sensor"
|
|
||||||
|
|
||||||
# Starlink interface (interface index 1)
|
|
||||||
- name: "starlink_in"
|
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.10.1"
|
oid: ".1.3.6.1.2.1.2.2.1.10.1"
|
||||||
type: "int"
|
type: "int"
|
||||||
HA_device_class: "data_size"
|
HA_device_class: "data_size"
|
||||||
HA_platform: "sensor"
|
HA_platform: "sensor"
|
||||||
HA_unit: "bit"
|
HA_unit: "bit"
|
||||||
|
|
||||||
- name: "starlink_out"
|
- name: "if1_out"
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.16.1"
|
oid: ".1.3.6.1.2.1.2.2.1.16.1"
|
||||||
type: "int"
|
type: "int"
|
||||||
HA_device_class: "data_size"
|
HA_device_class: "data_size"
|
||||||
HA_platform: "sensor"
|
HA_platform: "sensor"
|
||||||
HA_unit: "bit"
|
HA_unit: "bit"
|
||||||
|
|
||||||
- name: "starlink_status"
|
- name: "if1_status"
|
||||||
oid: ".1.3.6.1.2.1.2.2.1.8.1"
|
oid: ".1.3.6.1.2.1.2.2.1.8.1"
|
||||||
type: "bool"
|
type: "bool"
|
||||||
HA_device_class: "connectivity"
|
HA_device_class: "connectivity"
|
||||||
HA_platform: "binary_sensor"
|
HA_platform: "binary_sensor"
|
||||||
|
|
||||||
# OID Configuration Reference:
|
# OID Configuration Reference:
|
||||||
# - name: Unique identifier for this metric (used in MQTT topics and Home Assistant)
|
# - name: Unique identifier for this metric (used in MQTT topics and Home Assistant)
|
||||||
# - oid: SNMP Object Identifier
|
# - oid: SNMP Object Identifier
|
||||||
|
@@ -19,7 +19,7 @@ import time
|
|||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
format='(%(levelname)s) [%(threadName)s] %(message)s',
|
format='(%(levelname)s) [%(threadName)s] %(message)s',
|
||||||
level=logging.DEBUG
|
level=logging.INFO
|
||||||
)
|
)
|
||||||
|
|
||||||
# Global shutdown flag
|
# Global shutdown flag
|
||||||
|
Reference in New Issue
Block a user