Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #%# family=gpu
- #%# capabilities=autoconf
- # this munin plugin monitors the cooling fans through mbmon
- # dependencies on external programs:
- # mbmon
- # yyyy/mm/dd v author changelog:
- # 2008/01/16 v0.01 Lothar Schmidt initial version, email: l.make.a.noise.here@scarydevilmonastery.net
- # ----------------------------------------------------------------------------------
- #
- # CONFIGURATION DEPARTMENT
- #
- # ----------------------------------------------------------------------------------
- STYLE=LINE2 # graph style for number of listeners
- GRAPH="GPU fan speeds" # graph name, labels
- SECTION="GPU" # graph section
- #FANS=($(DISPLAY=:0 aticonfig --pplib-cmd "get fanspeed 0" | awk '/Result/ {print $4}' | cut -d "%" -f1))
- # -------------------------------------------------------------------------------------
- COUNT_DEVICE='./getatinumber.py'
- NFANS=$($COUNT_DEVICE)
- # --- check whether sensors returned data ---
- run_autoconf() {
- if (( NFANS )) ; then echo yes ; exit 0 ; fi
- echo U ; exit 1 ; }
- run_config() { cat << EOF
- graph_title GPU Fan revolution rates
- graph_category ${SECTION}
- graph_args --base 1000 -l 0
- graph_vlabel RPM
- EOF
- for (( I=0 ; I<NFANS ; I++ )) ; do
- (( FANS[I] )) && cat << EOF
- fan${I}.label fan $I
- fan${I}.draw $STYLE
- EOF
- done
- }
- run_() {
- for (( I=0 ; I<NFANS ; I++ )) ; do
- echo -n "gpu$(echo $I).value "; DISPLAY=:0.$I aticonfig --pplib-cmd "get fanspeed 0" | awk '/Result/ {print $4}' | cut -d "%" -f1
- done
- }
- run_$1
- exit 0
- user@linuxcoin:/etc/munin/plugins# munin-run gpu_fanspeed2
- gpu0.value 80
- gpu1.value 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement