Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow querying IPMI sensors via the open interface #2244

Closed
wants to merge 1 commit into from

Conversation

m4ce
Copy link
Contributor

@m4ce m4ce commented Jan 9, 2017

Hi,

this solves #1547.

I have not adjuted the tests yet. I wanted to first confirm with you that my changes are okay and then update the tests accordingly.

Cheers,
Matteo

@m4ce
Copy link
Contributor Author

m4ce commented Jan 9, 2017

I've also updated the README so that you can evaluate the changes better.

@sparrc sparrc added this to the 1.3.0 milestone Jan 9, 2017
@m4ce
Copy link
Contributor Author

m4ce commented Jan 9, 2017

@sparrc, any chance of having this in the next release? :(

@m4ce
Copy link
Contributor Author

m4ce commented Jan 9, 2017

All tests are passing now, I've re-factored the code a little bit more.

@m4ce m4ce changed the title allow querying sensors via the open interface allow querying IPMI sensors via the open interface Jan 9, 2017
@@ -4,23 +4,32 @@ Get bare metal metrics using the command line utility `ipmitool`

see ipmitool(https://sourceforge.net/projects/ipmitool/files/ipmitool/)

The plugin will use the following command to collect remote host sensor stats:
The plugin supports two modes. When 'servers' is not specified, the plugin will utilize the OpenIPMI kernel device driver to retrieve the sensor stats.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean? does it still run an ipmitool command? can you provide it here?

* Fields:
- status
- value

The `server` tag will be made available when retrieving stats from remote server(s).

## Configuration

```toml
[[inputs.ipmi_sensor]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should change the SampleConfig to indicate that servers is optional

func (m *Ipmi) SampleConfig() string {
return sampleConfig
}

func (m *Ipmi) Description() string {
return "Read metrics from one or many bare metal servers"
return "Read metrics from the local machines (via the open interface) or one or many bare metal servers (via the lan interface)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limit this to 80 characters

if m.runner == nil {
m.runner = CommandRunner{}
if len(m.path) == 0 {
return errors.New("ipmitool not found: verify that ipmitool is installed and that ipmitool is in your PATH")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fmt.Errorf instead of errors.New

@sparrc
Copy link
Contributor

sparrc commented Feb 2, 2017

@m4ce I'm not sure I understand the distinction you're making in documentation with local vs. external hosts using the "OpenIPMI device driver"? Don't they both use OpenIPMI?

@m4ce
Copy link
Contributor Author

m4ce commented Feb 2, 2017

@sparrc, when running ipmitool sdr without specifying the interface (-I), it uses the open interface by default (/dev/ipmiN). The open interface uses the OpenIPMI kernel device driver to query the local machine sensors. When you use 'lan' as an interface, you are expected to pass a host via the -H command line flag. It still uses the openipmi protocol, but over UDP.

@sparrc
Copy link
Contributor

sparrc commented Feb 2, 2017

but in both cases we are querying the OpenIPMI device driver, it's just that in the lan case we are querying it on a remote server.

I think you should change the documentation to only specify that if a server is not given, then we will query locally.

@m4ce
Copy link
Contributor Author

m4ce commented Feb 2, 2017

@sparrc, I've improved the documentation and amended the code based on your reviews.

## optionally specify the path to the ipmitool executable
## path = "/usr/bin/ipmitool"

## optionally specify one or more servers via a url matching. If servers is omitted, only the local machine sensor stats will be retrieved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config file line length should be limited to 80 characters

@sparrc sparrc closed this in a610f8b Feb 2, 2017
@sparrc
Copy link
Contributor

sparrc commented Feb 2, 2017

thanks @m4ce

mlindes pushed a commit to Comcast/telegraf that referenced this pull request Feb 6, 2017
maxunt pushed a commit that referenced this pull request Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants