Changed folder structure; added authelia config files
This commit is contained in:
15
homelab/mikrotik/mqtt.rsc
Normal file
15
homelab/mikrotik/mqtt.rsc
Normal file
@ -0,0 +1,15 @@
|
||||
:local cpuLoad [/system/resource/get cpu-load]
|
||||
:local cpuTemperature [/system health get [find name="temperature"] value]
|
||||
|
||||
:local sfp1Info [/interface ethernet monitor sfp-sfpplus1 once as-value]
|
||||
:local sfpTemperature ($sfp1Info->"sfp-temperature")
|
||||
|
||||
:local pppoeClientInfo [/interface pppoe-client monitor [find name="pppoe-telekom"] once as-value]
|
||||
:local pppoeUptime ($pppoeClientInfo->"uptime")
|
||||
|
||||
:local totalRAM [/system/resource/get total-memory]
|
||||
:local freeRAM [/system/resource/get free-memory]
|
||||
:local usedRAM ($totalRAM - $freeRAM)
|
||||
:local ramUtilization (($usedRAM * 100) / $totalRAM)
|
||||
|
||||
/iot mqtt publish message="{\"cpu\": \"$cpuLoad\", \"ram\": \"$ramUtilization\", \"cpu_temp\": \"$cpuTemperature\", \"sfp_temp\": \"$sfpTemperature\", \"pppoe_telekom_uptime\": \"$pppoeUptime\"}" broker="mosquitto" topic="mikrotik-info"
|
||||
Reference in New Issue
Block a user