Ajout d'un fichier de configuraiton séparé
This commit is contained in:
111
config.yaml
Normal file
111
config.yaml
Normal file
@@ -0,0 +1,111 @@
|
||||
# SNMP2MQTT Configuration File
|
||||
# This file contains the configuration for the SNMP to MQTT bridge
|
||||
|
||||
# MQTT Broker Configuration
|
||||
mqtt:
|
||||
broker: "192.168.10.202"
|
||||
port: 1883
|
||||
user: "snmp2mqtt"
|
||||
password: "snmp_2_MQTT"
|
||||
|
||||
# Optional: Sleep interval between SNMP polls (default: 2 seconds)
|
||||
sleep_interval: 2
|
||||
|
||||
# Device Configurations
|
||||
# You can define multiple devices here. Each device will be monitored independently.
|
||||
devices:
|
||||
# Device name (used for MQTT topics and Home Assistant device identification)
|
||||
mikrotik_hex:
|
||||
ip: "192.168.10.2"
|
||||
snmp_community: "public"
|
||||
oids:
|
||||
# Starlink VPN interface (interface index 12)
|
||||
- name: "stln_vpn_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"
|
||||
type: "int"
|
||||
HA_device_class: "data_size"
|
||||
HA_platform: "sensor"
|
||||
HA_unit: "bit"
|
||||
|
||||
- name: "starlink_out"
|
||||
oid: ".1.3.6.1.2.1.2.2.1.16.1"
|
||||
type: "int"
|
||||
HA_device_class: "data_size"
|
||||
HA_platform: "sensor"
|
||||
HA_unit: "bit"
|
||||
|
||||
- name: "starlink_status"
|
||||
oid: ".1.3.6.1.2.1.2.2.1.8.1"
|
||||
type: "bool"
|
||||
HA_device_class: "connectivity"
|
||||
HA_platform: "binary_sensor"
|
||||
|
||||
# Example of how to add another device:
|
||||
# another_device:
|
||||
# ip: "192.168.10.3"
|
||||
# snmp_community: "public"
|
||||
# oids:
|
||||
# - name: "cpu_usage"
|
||||
# oid: ".1.3.6.1.4.1.14988.1.1.3.14.0" # MikroTik CPU usage
|
||||
# type: "int"
|
||||
# HA_device_class: "power_factor"
|
||||
# HA_platform: "sensor"
|
||||
# HA_unit: "%"
|
||||
|
||||
# OID Configuration Reference:
|
||||
# - name: Unique identifier for this metric (used in MQTT topics and Home Assistant)
|
||||
# - oid: SNMP Object Identifier
|
||||
# - type: Python type for value conversion ("int", "bool", "str")
|
||||
# - HA_device_class: Home Assistant device class for proper icon/categorization
|
||||
# Common classes: data_size, connectivity, power_factor, temperature, etc.
|
||||
# - HA_platform: Home Assistant platform type ("sensor", "binary_sensor")
|
||||
# - HA_unit: (optional) Unit of measurement for the sensor
|
||||
# Common units: "bit", "byte", "%", "°C", "°F", etc.
|
||||
|
||||
# Common SNMP OIDs for network interfaces:
|
||||
# - .1.3.6.1.2.1.2.2.1.10.X = Incoming bytes on interface X
|
||||
# - .1.3.6.1.2.1.2.2.1.16.X = Outgoing bytes on interface X
|
||||
# - .1.3.6.1.2.1.2.2.1.8.X = Interface operational status (1=up, 2=down)
|
||||
# - .1.3.6.1.2.1.2.2.1.2.X = Interface description
|
Reference in New Issue
Block a user