windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

NIC name missing ?

Open SupraOva opened this issue 4 years ago • 10 comments

Hi,

Everything is in the title, the name of the NIC interface seems to be missing, or I couldn't find it.

TYPE windows_net_bytes_received_total counter

windows_net_bytes_received_total{nic="vmxnet3_Ethernet_Adapter"} 4.7875466e+07 windows_net_bytes_received_total{nic="vmxnet3_Ethernet_Adapter__2"} 4.255629273e+09

The metrics shows the interface description instead name. Is there a way to display it ?

SupraOva avatar Jul 11 '20 17:07 SupraOva

This is the name as far as Windows is concerned. What field/data did you expect instead?

carlpett avatar Jul 11 '20 19:07 carlpett

I rather expect the name in this command : Get-WmiObject Win32_NetworkAdapter | Select-Object -ExpandProperty NetConnectionID

See https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-networkadapter

NetConnectionID Data type: string Access type: Read/write Name of the network connection as it appears in the Network Connections Control Panel program.

SupraOva avatar Jul 11 '20 19:07 SupraOva

NetConnectionID is not a member of the Win32_PerfRawData_Tcpip_NetworkInterface class, which is what this collector uses.

https://github.com/prometheus-community/windows_exporter/blob/b64ccbe68307385d9d9f2dcdffdcdd776216406e/collector/net.go#L148-L164

scluff avatar Jul 12 '20 00:07 scluff

Is there a way to match the name that appears in class Win32_PerfRawData_Tcpip_NetworkInterface with the name in Win32_NetworkAdapter class ?

SupraOva avatar Jul 17 '20 21:07 SupraOva

I agree, without this label the NET metrics are almost useless on any computer that have more than one NIC.

You can match Win32_NetworkAdapter Name property with the Win32_NetworkAdapter Name property and add the NetConnectionID as a name label?

Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface -Property Name                  | Select-Object Name                  | FT -Autosize
Get-WmiObject Win32_NetworkAdapter                     -Property Name, NetConnectionID | Select-Object Name, NetConnectionID | FT -Autosize

JDA88 avatar Aug 11 '20 13:08 JDA88

Up.

Any news about the nic name matching ?

SupraOva avatar Nov 09 '20 23:11 SupraOva

No. I'd like to clarify that this is spare time work for us, and replying to "is it done yet" type comments takes time from that limited pool we have to spend. If this feature is important to you, we'd love to help review a pull request with code. If not, it'll be on the backlog if we have some extra time.

carlpett avatar Nov 10 '20 08:11 carlpett

I really would like to help more about code, unfortunately no knowledge is limited to PowerShell / .NET languages. Go is very obscure for me and I don’t have enough tome to get into it.

Thx for the hard work! :)

JDA88 avatar Nov 10 '20 08:11 JDA88

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

github-actions[bot] avatar Nov 25 '23 05:11 github-actions[bot]

I really think this one should be implemented

JDA88 avatar Nov 25 '23 09:11 JDA88

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

github-actions[bot] avatar Feb 24 '24 02:02 github-actions[bot]