changing it won’t allow the sh scripts to work inside the custom telegraf.conf, It appears yours has not been customized properly or is just not exporting that input since you ran ‘net’. Can you verify your telegraf.conf is a fork of https://github.com/gsxryan/storj_telegraf_mon/blob/d96e969ad590997da1c9a3d15454902461f752ef/telegraf.conf
this is my telegraf.conf and I don’t see problem, can you take a look ?
fabrizio@storenode:~$ cat telegraf.conf
[global_tags]
[agent]
interval = “30s”
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = “0s”
flush_interval = “10s”
flush_jitter = “0s”
precision = “s”
debug = false
quiet = false
logfile = “”
hostname = “”
omit_hostname = false
###############################################################################
OUTPUT PLUGINS
###############################################################################
[[outputs.influxdb]]
urls = [“http://10.1.0.200:8086”]
database = “telegraf”
precision = “s”
username = “telegraf”
password = “*******”
###############################################################################
INPUT PLUGINS
###############################################################################
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
[[inputs.disk]]
ignore_fs = [“tmpfs”, “devtmpfs”, “devfs”, “overlay”, “aufs”, “squashfs”]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.net]]
[[inputs.exec]]
commands = ["/etc/telegraf/successrate.sh"]
timeout = “60s”
interval = “10m”
data_format = “influx”
[[inputs.exec]]
commands = ["/etc/telegraf/tokens.sh"] #some configs may need "bash " before /
timeout = “60s”
interval = “30m” # if you don’t care to track STORJ price, you can increase it to 24h
data_format = “influx”
[[inputs.exec]]
commands = [
“curl -s 10.1.0.200:14002/api/dashboard” # Open SNO API by mapping ports when running your SNO docker instance
]
timeout = “60s”
interval = “1m”
data_format = “json”
tag_keys = [ “data_nodeID” ]
name_override = “StorJHealth”
Is there a way to monitor temperature for Raspberry Pi 4?
vcgencmd is not found within the telegraf container
pi@rpi-storj:~/storj/telegraf/latest $ sudo docker exec -i -t telegraf /bin/bash
root@rpi-storj:/# which vcgencmd
root@rpi-storj:/#
Using
I hack the successrate.sh to add a few lines so it’ll push temperature into influxdb. ofc there is better way to do it, but this is quick and dirty. It works for me on RPI4.
Temperature value can go up to 3 decimal places.
soc_tempc=$(cat /sys/class/thermal/thermal_zone0/temp)
soc_tempc=$(awk “BEGIN {printf "%.2f",${soc_tempc}/1000}”)
echo “StorJHealth,NodeId=$node_id InfoDBcheck=$infodb_check,VoucherCheck=$kad_check,Reboots=$reboots,Version="$version",Soc_TemperatureC=$soc_tempc $(date +‘%s%N’)”
i like quick an dirty. Any idea if that works for other hardware, assuming the senors are there for it…?
I’ll add to the codebase on the next push with your username.
I have RPI and laptop running Linux. Seems to work the same within the container. Not sure about other hardware with non-Linux OS. Maybe those who have it can test it out.
Else, the script can skip reporting if this temp file is not found. Just append the code block below to successrate.sh, before the rm $LOG
Note: the code block below somehow got mess up slightly when posting. I’ve inserted the ss of the code.
soc_tempc_file=“/sys/class/thermal/thermal_zone0/temp”
if [ -f $soc_tempc_file ]; then
soc_tempc=$(cat $soc_tempc_file)
soc_tempc=$(awk “BEGIN {printf \”%.2f\“,${soc_tempc}/1000}”)
echo “StorJHealth,NodeId=$node_id Soc_TemperatureC=$soc_tempc $(date +‘%s%N’)”
fi