Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #%# family=gpu
  4. #%# capabilities=autoconf
  5.  
  6. #STYLE=LINE2 # graph style for number of listeners
  7. GRAPH="GPU fan speeds" # graph name, labels
  8. SECTION="GPU" # graph section
  9. #FANS=($(DISPLAY=:0 aticonfig --pplib-cmd "get fanspeed 0" | awk '/Result/ {print $4}' | cut -d "%" -f1))
  10.  
  11.  
  12. COUNT_DEVICE='./getatinumber.py'
  13. NFANS=$($COUNT_DEVICE)
  14.  
  15.  
  16. # --- check whether sensors returned data ---
  17. run_autoconf() {
  18. if (( NFANS )) ; then echo yes ; exit 0 ; fi
  19. echo U ; exit 1 ; }
  20.  
  21.  
  22.  
  23.  
  24. run_config() { cat << EOF
  25. graph_title GPU Fan revolution rates
  26. graph_category ${SECTION}
  27. graph_args --base 1000 -l 0
  28. graph_vlabel RPM
  29. EOF
  30. for (( I=0 ; I<NFANS ; I++ )) ; do
  31. gpu${I}.label fan $I
  32. EOF
  33. done
  34. }
  35.  
  36.  
  37.  
  38.  
  39. run_() {
  40. for (( I=0 ; I<NFANS ; I++ )) ; do
  41. echo -n "gpu$(echo $I).value "; DISPLAY=:0.$I aticonfig --pplib-cmd "get fanspeed 0" | awk '/Result/ {print $4}' | cut -d "%" -f1
  42. done
  43. }
  44.  
  45. run_$1
  46. exit 0
  47.  
  48. user@linuxcoin:/etc/munin/plugins# munin-run gpu_fanspeed2
  49. gpu0.value 80
  50. gpu1.value 100
  51. user@linuxcoin:/etc/munin/plugins#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement