mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-06-25 15:38:35 +02:00
First version of temparature monitoring and alert script
This commit is contained in:
parent
6e58b65be5
commit
7789cfa8b5
1 changed files with 21 additions and 0 deletions
21
scripts/temparature.rsc
Normal file
21
scripts/temparature.rsc
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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"
|
Loading…
Add table
Add a link
Reference in a new issue