Skip to content

Commit

Permalink
At #54 Replace strings.TrimSpace with trim function
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-jinhyeong committed Aug 16, 2023
1 parent 0040a3b commit 0d9aabe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/inputs/ipmi_sensor/ipmi_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (m *Ipmi) parse(acc telegraf.Accumulator, server string) error {
if server != "" {
lastIndex := strings.LastIndex(server, ",")
if lastIndex > 1 && server[lastIndex+1:] != "" {
hostname = strings.TrimSpace(server[lastIndex+1:])
hostname = trim(server[lastIndex+1:])
}

conn := NewConnection(server, m.Privilege, m.HexKey)
Expand Down Expand Up @@ -169,6 +169,7 @@ func (m *Ipmi) parseV1(acc telegraf.Accumulator, ipmiIP string, hostname string,
// Planar VBAT | 3.05 Volts | ok
scanner := bufio.NewScanner(bytes.NewReader(cmdOut))
for scanner.Scan() {

ipmiFields := m.extractFieldsFromRegex(reV1ParseLine, scanner.Text())
if len(ipmiFields) != 3 {
continue
Expand Down

0 comments on commit 0d9aabe

Please sign in to comment.