telegraf updates for v1.7.0RC3 (#2204)

* new path of "vcgencmd" at raspiblitz v1.7.0RC2
* whitespaces + rename raspiblitz_ip_info -> ipinfo
* add mempool info via bitcoincli
Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>
This commit is contained in:
PatrickScheich
2021-04-20 20:42:56 +02:00
committed by rootzoll
parent 423e8c7d4d
commit 40e554c5e7
2 changed files with 42 additions and 23 deletions

View File

@@ -3,7 +3,7 @@
###############################################################################
# File: getraspiblitzipinfo.sh
# Date: 2020-10-04
# Date: 2021-04-19
###############################################################################
# set the "debugLevel"
@@ -203,7 +203,9 @@ fi
# now create the output for the telegraf "[[inputs.exec]]" section in influx-line-format
#
# measurement: raspiblitz_ip_info
# 2021-04-19: rename measurement: "raspiblitz_ip_info" -> "ipinfo"
#
# measurement: ipinfo
#
# tags
# * host
@@ -229,7 +231,7 @@ for i in $( seq 0 4 ); do
# create influx-line-format output
# only if there is a proper creation timestamp
if [ ${creation_ts_curr[ $i ]} -gt 1000000000 ]; then
influxLine="raspiblitz_ip_info,origin=${origin[ $i ]},ipaddr=${ip_addr_curr[$i]},ipaddr_prev=${ip_addr_prev[$i]},ipaddr_changed=${has_changed[ $i ]} created=${creation_ts_curr[ $i ]}i,uptime=${ipaddr_online}i,changed=${has_changed[ $i ]}i"
influxLine="ipinfo,origin=${origin[ $i ]},ipaddr=${ip_addr_curr[$i]},ipaddr_prev=${ip_addr_prev[$i]},ipaddr_changed=${has_changed[ $i ]} created=${creation_ts_curr[ $i ]}i,uptime=${ipaddr_online}i,changed=${has_changed[ $i ]}i"
if [ -f "${logFile}" ]; then printf "%s: === %s\n" "$sts" "$influxLine" >> ${logFile} ; fi
echo "${influxLine}"
else

View File

@@ -75,6 +75,22 @@
data_format = "json"
#### Bitcoin related metric
#### basic information about the mempool
#### --> https://developer.bitcoin.org/reference/rpc/getmempoolinfo.html
##
## Most usefull fields...
## * loaded (boolean) True if the mempool is fully loaded
## * size (numeric) Current tx count
## * usage (numeric) Total memory usage for the mempool
##
[[inputs.exec]]
interval = "60s"
commands = ["/usr/local/bin/bitcoin-cli -conf=/mnt/hdd/bitcoin/bitcoin.conf getmempoolinfo" ]
name_override = "bitcoin_mempoolinfo"
data_format = "json"
#### Bitcoin related metric
#### information about network traffic, including bytes in, bytes out, and current time window
#### --> https://developer.bitcoin.org/reference/rpc/getnettotals.html
@@ -203,6 +219,7 @@
#####################################
#### Hardware data: cpu/gpu temperature, voltage, cpu clock
####
#### 2021-04-19 adopt to new path of "vcgencmd" at raspiblitz v1.7.0RC2
#####################################
[[inputs.file]]
files = ["/sys/class/thermal/thermal_zone0/temp"]
@@ -212,21 +229,21 @@
[[inputs.exec]]
commands = ["/opt/vc/bin/vcgencmd measure_temp"]
commands = ["/usr/bin/vcgencmd measure_temp"]
name_override = "gpu_temperature"
data_format = "grok"
grok_patterns = ["%{NUMBER:value:float}"]
[[inputs.exec]]
commands = ["/opt/vc/bin/vcgencmd measure_volts core"]
commands = ["/usr/bin/vcgencmd measure_volts core"]
name_override = "cpu_volts"
data_format = "grok"
grok_patterns = ["%{NUMBER:value:float}"]
[[inputs.exec]]
commands = ["/opt/vc/bin/vcgencmd measure_clock arm"]
commands = ["/usr/bin/vcgencmd measure_clock arm"]
name_override = "cpu_frequency"
data_format = "grok"
grok_patterns = ["=%{NUMBER:value:int}"]