mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-07-07 13:14:27 +02:00
22 lines
505 B
Text
22 lines
505 B
Text
|
# Find temparature and alert if threshold is reached.
|
||
|
|
||
|
:local t
|
||
|
:local threshold 60
|
||
|
|
||
|
:do {
|
||
|
:set t [/system health get value-name=value number=[find name=cpu-temperature]]
|
||
|
} on-error={ :set t -1 }
|
||
|
|
||
|
:put $t
|
||
|
|
||
|
:if ( $t < 0 ) do={
|
||
|
:log warn "Temparature reading could not be fetched."
|
||
|
:error "Temparature reading could not be fetched."
|
||
|
}
|
||
|
|
||
|
:if ( $t > $threshold ) do={
|
||
|
:put "Temp exceeded the limit ($limit)."
|
||
|
:log warning "Temp exceeded the limit ($threshold)."
|
||
|
}
|
||
|
:log info "Current temparature: $t"
|