fivesixzero / telegraf-pi-bash

Telegraf scripts and configs for monitoring Raspberry Pi internals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

telegraf-pi-get-throttled.sh: not working

scolytus opened this issue · comments

For me, this doesn't work:

  strb=${1:0:1}
  uvb=${1:1:1}
  afcb=${1:2:1}
  trb=${1:3:1}
  str=${1:16:1}
  uv=${1:17:1}
  afc=${1:18:1}
  tr=${1:19:1}

I used this, to fix it:

  strb=${throttle_state_bin:0:1}
  uvb=${throttle_state_bin:1:1}
  afcb=${throttle_state_bin:2:1}
  trb=${throttle_state_bin:3:1}
  str=${throttle_state_bin:16:1}
  uv=${throttle_state_bin:17:1}
  afc=${throttle_state_bin:18:1}
  tr=${throttle_state_bin:19:1}

Thanks for posting this! Looks like an oversight during development.

Originally I had created two scripts, one to generate the binary number and one to parse it into the Telegraf line. Looks like the use of var $1 there was a holdover from that. 🤦

Thanks anyway for sharing, always easier to get started with someone else's ideas!