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

collect virtual machine temperature #4400

Closed
pytimer opened this issue Jul 9, 2018 · 12 comments
Closed

collect virtual machine temperature #4400

pytimer opened this issue Jul 9, 2018 · 12 comments
Labels
area/system feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@pytimer
Copy link
Contributor

pytimer commented Jul 9, 2018

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

system inputs plugin add temperature metric.

Current behavior:

I want to use telegraf collect vm temperature, but i not found inputs plugin to do it.

Desired behavior:

Telegraf have inputs plugin to do it.

Use case: [Why is this important (helps with prioritizing requests)]

If telegraf inputs plugin can collect temperature, please tell me. Thanks. :)

@danielnelson
Copy link
Contributor

We have the sensors input for Linux, but I'm assuming you are interested in this on Windows via gopsutil? I think this would be good to add, do you want to prepare a PR?

@danielnelson danielnelson added feature request Requests for new plugin and for new features to existing plugins area/system labels Jul 10, 2018
@pytimer
Copy link
Contributor Author

pytimer commented Jul 10, 2018

Thanks for your reply.

I read sensors input, it use lm-sensors to collect sensor metrics, but many linux machine not installed lm-sensors package.

I already read gopsutil code, linux it read machine file to get temperature, and yesterday i send a PR to gopsutil, use WMI to collect Windows temperature. Is it helpful for Telegraf?

Whether Telegraf use gopsutil to get temperature? If not, you can tell me which plugin can add this feature, i will happly to send a PR to implement it.

@danielnelson
Copy link
Contributor

It should be acceptable to add a temp plugin that uses this interface from gopsutil.

@pytimer
Copy link
Contributor Author

pytimer commented Jul 11, 2018

Add a new temp input plugin in system package, i understand it right?

If right, which metrics name should be included in this plugin. Do you have any idea?

@danielnelson
Copy link
Contributor

Add a new temp input plugin in system package, i understand it right?

Yes

If right, which metrics name should be included in this plugin.

Since the current interface from gopsutil is:

type TemperatureStat struct {
	SensorKey   string  `json:"sensorKey"`
	Temperature float64 `json:"sensorTemperature"`
}

Something like this should be appropriate:

temp,sensor=<sensorKey> temp=<sensorTemperature>

@pytimer
Copy link
Contributor Author

pytimer commented Jul 11, 2018

Now my PR not merge, if it merged, i want to begin this work.
Is it ok? :-)

@danielnelson
Copy link
Contributor

Yeah, can you add a link to the PR? I think we will remove the system package soon with this PR so you should probably make your plugin a top level plugin: plugins/inputs/temp/temp.go

@pytimer
Copy link
Contributor Author

pytimer commented Jul 11, 2018

can you add a link to the PR?

Sorry, i am a beginner for this. I'm not understand what is mean, can you tell me what should i do or explain it detail? Thanks very much. :)

I add new temp inputs plugin to plugins/inputs/all/all.go, like _ "github.com/influxdata/telegraf/plugins/inputs/temp" directly?

@danielnelson
Copy link
Contributor

danielnelson commented Jul 11, 2018

Just paste a URL to the PR you are waiting for in a comment, this way we can keep an eye on it.

I add new temp inputs plugin to plugins/inputs/all/all.go, like _ "github.com/influxdata/telegraf/plugins/inputs/temp" directly?

👍

@pytimer
Copy link
Contributor Author

pytimer commented Jul 11, 2018

OK. Thanks.

@pytimer
Copy link
Contributor Author

pytimer commented Jul 12, 2018

@danielnelson i send PR #4411 , i hope you can review it if you have time. Thanks.

@danielnelson danielnelson added this to the 1.8.0 milestone Sep 10, 2018
@danielnelson
Copy link
Contributor

Closed by #4411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/system feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

2 participants