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

Add dhcp collector #493

Merged
merged 1 commit into from
May 4, 2020
Merged

Add dhcp collector #493

merged 1 commit into from
May 4, 2020

Conversation

breed808
Copy link
Contributor

Unfortunately perflib does not expose scope statistics
(DhcpServerv4ScopeStatistics), and WMI queries to this class don't
appear to be possible with the stackexchange/wmi module.

Copy link
Collaborator

@carlpett carlpett left a comment

Choose a reason for hiding this comment

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

Thanks @breed808! Some minor comments, but looks good as usual :)

collector/dhcp.go Outdated Show resolved Hide resolved
collector/dhcp.go Outdated Show resolved Hide resolved
collector/dhcp.go Outdated Show resolved Hide resolved
collector/dhcp.go Show resolved Hide resolved
collector/dhcp.go Outdated Show resolved Hide resolved
collector/dhcp.go Outdated Show resolved Hide resolved
collector/dhcp.go Show resolved Hide resolved
@carlpett
Copy link
Collaborator

carlpett commented Apr 8, 2020

[...] and WMI queries to this class don't appear to be possible with the stackexchange/wmi module.

Is it a namespaced class, or something more exotic? We do namespaced queries in the process/iis collector:
https://github.com/martinlindhe/wmi_exporter/blob/91a64fecb850fae0a90219bfcd045c3bc1838cc7/collector/process.go#L189

@breed808
Copy link
Contributor Author

It's been a while since I've looked at the WMI class for the scope statistics. Would it be preferable to investigate the class as a separate collector, to keep the Perflib & WMI components separate?

collector/dhcp.go Outdated Show resolved Hide resolved
docs/collector.dhcp.md Outdated Show resolved Hide resolved
@carlpett
Copy link
Collaborator

It's been a while since I've looked at the WMI class for the scope statistics. Would it be preferable to investigate the class as a separate collector, to keep the Perflib & WMI components separate?

I think we'd rather have it in a single collector, but it might make sense to split it in different collect-functions as we've done in some places.

@breed808
Copy link
Contributor Author

breed808 commented May 2, 2020

I think most of the issues have been ironed out by now, I just need to investigate the WMI class. Will update when this has been done.

@breed808
Copy link
Contributor Author

breed808 commented May 3, 2020

I've looked into the WMI class by testing the wmi library directly. However, this has not returned any data. Running Get-WmiObject -namespace "root\Microsoft\Windows\DHCP" -query 'SELECT * FROM DhcpServerv4ScopeStatistics' also returns no data.

I can see someone else has had this issue but the general advice appears to be "Use the Get-DhcpServerv4ScopeStatistics PowerShell command instead of querying WMI directly".

I'm not sure how this can be queried with WMI 😞

Copy link
Collaborator

@carlpett carlpett left a comment

Choose a reason for hiding this comment

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

Okay, let's skip the scope statistics for now and it can be added later if we figure out how. Just one minor doc nit, then we I think we're done.
Great work! 🎉

docs/collector.dhcp.md Outdated Show resolved Hide resolved
Unfortunately perflib does not expose scope statistics
(DhcpServerv4ScopeStatistics), and WMI queries to this class don't
appear to be possible with the stackexchange/wmi module.
@carlpett carlpett merged commit 54d94c2 into prometheus-community:master May 4, 2020
@breed808 breed808 deleted the dhcp branch June 1, 2020 08:20
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
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