net: expose operation status of nic (#1956)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-03-28 15:18:17 +01:00
committed by GitHub
parent 63efa92be7
commit ad98d11326
5 changed files with 54 additions and 14 deletions

View File

@@ -277,6 +277,8 @@ windows_exporter_collector_timeout{collector="udp"} 0
# TYPE windows_net_nic_address_info gauge
# HELP windows_net_nic_info A metric with a constant '1' value labeled with the network interface's general information.
# TYPE windows_net_nic_info gauge
# HELP windows_net_nic_operation_status The operational status for the interface as defined in RFC 2863 as IfOperStatus.
# TYPE windows_net_nic_operation_status gauge
# HELP windows_net_output_queue_length_packets (Network.OutputQueueLength)
# TYPE windows_net_output_queue_length_packets gauge
# HELP windows_net_packets_outbound_discarded_total (Network.PacketsOutboundDiscarded)

View File

@@ -66,7 +66,8 @@ try {
throw $_
}
$output_diff = Compare-Object ((Get-Content 'e2e-output.txt' | Out-String).Trim()) ((Get-Content "$($temp_dir)/e2e-output.txt" | Out-String).Trim())
# Compare the expected and actual output
$output_diff = Compare-Object (Get-Content 'e2e-output.txt' | Where-Object { $_ -ne "" }) (Get-Content "$($temp_dir)/e2e-output.txt" | Where-Object { $_ -ne "" })
# Fail if differences in output are detected
if (-not ($null -eq $output_diff)) {
@@ -74,6 +75,7 @@ if (-not ($null -eq $output_diff)) {
Write-Host "STDOUT"
Get-Content "$($temp_dir)/windows_exporter.log"
Write-Host "----------------------------------------"
Write-Host "STDERR"
Get-Content "$($temp_dir)/windows_exporter_error.log"