Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Removing docker input, using deg F for IPMI.
Browse files Browse the repository at this point in the history
Try as I might I couldn't find a way to get ipmitool to use Fahrenheit
instead of Celsius. I looked in the ipmitool source (which has "degrees
F" but no option to force it), in the ipmi0 kernel module source, and in
my BIOS settings. Nothing.

The solution is to write a wrapper AWK program that does the conversion
for Telegraf.

Won't work until (hopefully)
influxdata/telegraf#2498 is merged.

Not collecting Docker metrics since it requires adding Telegraf to the
"docker" group to give it access to the Docker unix socket. I didn't
really like that from a security perspective. Better to just give up on
that.
  • Loading branch information
Robpol86 committed Mar 7, 2017
1 parent 02369d4 commit cacf97a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
26 changes: 26 additions & 0 deletions bin/ipmitool_sdr_f
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/awk -f

function fahrenheit(celsius) {
return (9 / 5) * celsius + 32
}

function spaces(count) {
pad = ""
for (i=0; i < count; i++) {
pad = pad " "
}
return pad
}

BEGIN {
while ("ipmitool sdr" |getline) {
if (match($0, /([0-9]+) degrees C +/, matched)) {
replacement = fahrenheit(matched[1]) " degrees F"
padding = length(matched[0]) - length(replacement)
sub(matched[0], replacement spaces(padding))
print $0
} else {
print $0
}
}
}
9 changes: 1 addition & 8 deletions etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,11 @@
domains = ["google.com", "robpol86.com"]


[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
container_names = []
timeout = "5s"
perdevice = true
total = false


[[inputs.hddtemp]]


[[inputs.ipmi_sensor]]
path = "/usr/local/bin/ipmitool_sdr_f"


[[inputs.mem]]
Expand Down

0 comments on commit cacf97a

Please sign in to comment.