mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-25 20:26:34 +00:00
Raspberry Pi (all): S11throttlewatch: log current temperature
This commit is contained in:
parent
923b931647
commit
8c57d5e76b
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CHECK_INTERVAL=30
|
CHECK_INTERVAL=60
|
||||||
|
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
@ -19,12 +19,16 @@ get_throttled_since_boot() {
|
|||||||
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_temp() {
|
||||||
|
t=$(</sys/class/thermal/thermal_zone0/temp)
|
||||||
|
echo "$((t / 1000))"
|
||||||
|
}
|
||||||
|
|
||||||
watch_now() {
|
watch_now() {
|
||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_now)
|
th=$(get_throttled_now)
|
||||||
if [[ -n "${t}" ]]; then
|
te=$(get_temp)
|
||||||
logger -t throttlewatch -s "currently: ${t}"
|
logger -t throttlewatch "currently: ${th:-ok}, temperature: ${te} C"
|
||||||
fi
|
|
||||||
|
|
||||||
sleep ${CHECK_INTERVAL}
|
sleep ${CHECK_INTERVAL}
|
||||||
done
|
done
|
||||||
@ -34,7 +38,7 @@ watch_since_boot() {
|
|||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_since_boot)
|
t=$(get_throttled_since_boot)
|
||||||
if [[ -n "${t}" ]]; then
|
if [[ -n "${t}" ]]; then
|
||||||
logger -t throttlewatch -s "since boot: ${t}"
|
logger -t throttlewatch "since boot: ${t}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,4 +66,3 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CHECK_INTERVAL=30
|
CHECK_INTERVAL=60
|
||||||
|
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
@ -19,12 +19,16 @@ get_throttled_since_boot() {
|
|||||||
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_temp() {
|
||||||
|
t=$(</sys/class/thermal/thermal_zone0/temp)
|
||||||
|
echo "$((t / 1000))"
|
||||||
|
}
|
||||||
|
|
||||||
watch_now() {
|
watch_now() {
|
||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_now)
|
th=$(get_throttled_now)
|
||||||
if [[ -n "${t}" ]]; then
|
te=$(get_temp)
|
||||||
logger -t throttlewatch -s "currently: ${t}"
|
logger -t throttlewatch "currently: ${th:-ok}, temperature: ${te} C"
|
||||||
fi
|
|
||||||
|
|
||||||
sleep ${CHECK_INTERVAL}
|
sleep ${CHECK_INTERVAL}
|
||||||
done
|
done
|
||||||
@ -34,7 +38,7 @@ watch_since_boot() {
|
|||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_since_boot)
|
t=$(get_throttled_since_boot)
|
||||||
if [[ -n "${t}" ]]; then
|
if [[ -n "${t}" ]]; then
|
||||||
logger -t throttlewatch -s "since boot: ${t}"
|
logger -t throttlewatch "since boot: ${t}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,4 +66,3 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CHECK_INTERVAL=30
|
CHECK_INTERVAL=60
|
||||||
|
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
@ -19,12 +19,16 @@ get_throttled_since_boot() {
|
|||||||
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_temp() {
|
||||||
|
t=$(</sys/class/thermal/thermal_zone0/temp)
|
||||||
|
echo "$((t / 1000))"
|
||||||
|
}
|
||||||
|
|
||||||
watch_now() {
|
watch_now() {
|
||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_now)
|
th=$(get_throttled_now)
|
||||||
if [[ -n "${t}" ]]; then
|
te=$(get_temp)
|
||||||
logger -t throttlewatch -s "currently: ${t}"
|
logger -t throttlewatch "currently: ${th:-ok}, temperature: ${te} C"
|
||||||
fi
|
|
||||||
|
|
||||||
sleep ${CHECK_INTERVAL}
|
sleep ${CHECK_INTERVAL}
|
||||||
done
|
done
|
||||||
@ -34,7 +38,7 @@ watch_since_boot() {
|
|||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_since_boot)
|
t=$(get_throttled_since_boot)
|
||||||
if [[ -n "${t}" ]]; then
|
if [[ -n "${t}" ]]; then
|
||||||
logger -t throttlewatch -s "since boot: ${t}"
|
logger -t throttlewatch "since boot: ${t}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,4 +66,3 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CHECK_INTERVAL=30
|
CHECK_INTERVAL=60
|
||||||
|
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
@ -19,12 +19,16 @@ get_throttled_since_boot() {
|
|||||||
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
test $((t & 262144)) -ne 0 && echo -n "throttled "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_temp() {
|
||||||
|
t=$(</sys/class/thermal/thermal_zone0/temp)
|
||||||
|
echo "$((t / 1000))"
|
||||||
|
}
|
||||||
|
|
||||||
watch_now() {
|
watch_now() {
|
||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_now)
|
th=$(get_throttled_now)
|
||||||
if [[ -n "${t}" ]]; then
|
te=$(get_temp)
|
||||||
logger -t throttlewatch -s "currently: ${t}"
|
logger -t throttlewatch "currently: ${th:-ok}, temperature: ${te} C"
|
||||||
fi
|
|
||||||
|
|
||||||
sleep ${CHECK_INTERVAL}
|
sleep ${CHECK_INTERVAL}
|
||||||
done
|
done
|
||||||
@ -34,7 +38,7 @@ watch_since_boot() {
|
|||||||
while true; do
|
while true; do
|
||||||
t=$(get_throttled_since_boot)
|
t=$(get_throttled_since_boot)
|
||||||
if [[ -n "${t}" ]]; then
|
if [[ -n "${t}" ]]; then
|
||||||
logger -t throttlewatch -s "since boot: ${t}"
|
logger -t throttlewatch "since boot: ${t}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,4 +66,3 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user