First version of temparature monitoring and alert script

This commit is contained in:
Pothi Kalimuthu 2023-07-24 07:36:50 +05:30
parent 6e58b65be5
commit 7789cfa8b5
No known key found for this signature in database
GPG key ID: 08202A469C2D0E06

21
scripts/temparature.rsc Normal file
View 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"