telegraf: add CPU temperature on Raspberry Pi
This commit is contained in:
parent
61c0edbd88
commit
df5f0a6fc6
|
@ -17,6 +17,7 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Enable and restart telegraf
|
- name: Enable and restart telegraf
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: telegraf
|
name: telegraf
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -72,3 +72,12 @@
|
||||||
# ## Remove numbers from field names.
|
# ## Remove numbers from field names.
|
||||||
# ## If true, a field name like 'temp1_input' will be changed to 'temp_input'.
|
# ## If true, a field name like 'temp1_input' will be changed to 'temp_input'.
|
||||||
# # remove_numbers = true
|
# # remove_numbers = true
|
||||||
|
|
||||||
|
{% if ansible_lsb.id == "Raspbian" %}
|
||||||
|
# On Raspbian, get CPU temperature (in millicelsius)
|
||||||
|
[[inputs.exec]]
|
||||||
|
commands = ["cat /sys/class/thermal/thermal_zone0/temp"]
|
||||||
|
data_format = "value"
|
||||||
|
data_type = "integer"
|
||||||
|
name_override = "cpu_temp"
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue