From 1d1116ba5c8997cee236a33bd5daef3485862d46 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Thu, 4 Sep 2025 17:11:04 +0200 Subject: [PATCH 01/11] working on arp, saving progress --- pkg/features/systemstatistics/collector.go | 254 +++++++++++++++++++++ pkg/features/systemstatistics/rpc.go | 130 +++++------ 2 files changed, 320 insertions(+), 64 deletions(-) diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index 95559f80..35cf1a20 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -222,6 +222,68 @@ var ( tcpOptionSackpermittedLength *prometheus.Desc tcpOptionSackLength *prometheus.Desc tcpOptionAuthoptionLength *prometheus.Desc + + arpDatagramsReceivedDesc *prometheus.Desc + arpRequestsReceivedDesc *prometheus.Desc + arpRepliesReceivedDesc *prometheus.Desc + arpResolutionRequestReceivedDesc *prometheus.Desc + arpResolutionRequestDroppedDesc *prometheus.Desc + arpUnrestrictedProxyRequestsDesc *prometheus.Desc + arpRestrictedProxyRequestsDesc *prometheus.Desc + arpReceivedProxyRequestsDesc *prometheus.Desc + arpProxyRequestsNotProxiedDesc *prometheus.Desc + arpRestrictedProxyRequestsNotProxiedDesc *prometheus.Desc + arpDatagramsWithBogusInterfaceDesc *prometheus.Desc + arpDatagramsWithIncorrectLengthDesc *prometheus.Desc + arpDatagramsForNonIpProtocolDesc *prometheus.Desc + arpDatagramsWithUnsupportedOpcodeDesc *prometheus.Desc + arpDatagramsWithBadProtocolAddressLengthDesc *prometheus.Desc + arpDatagramsWithBadHardwareAddressLengthDesc *prometheus.Desc + arpDatagramsWithMulticastSourceAddressDesc *prometheus.Desc + arpDatagramsWithMulticastTargetAddressDesc *prometheus.Desc + arpDatagramsWithMyOwnHardwareAddressDesc *prometheus.Desc + arpDatagramsForAnAddressNotOnTheInterfaceDesc *prometheus.Desc + arpDatagramsWithABroadcastSourceAddressDesc *prometheus.Desc + arpDatagramsWithSourceAddressDuplicateToMineDesc *prometheus.Desc + arpDatagramsWhichWereNotForMeDesc *prometheus.Desc + arpPacketsDiscardedWaitingForResolutionDesc *prometheus.Desc + arpPacketsSentAfterWaitingForResolutionDesc *prometheus.Desc + arpRequestsSentDesc *prometheus.Desc + arpRepliesSentDesc *prometheus.Desc + arpRequestsForMemoryDeniedDesc *prometheus.Desc + arpRequestsDroppedOnEntryDesc *prometheus.Desc + arpRequestsDroppedDuringRetryDesc *prometheus.Desc + arpRequestsDroppedDueToInterfaceDeletionDesc *prometheus.Desc + arpRequestsOnUnnumberedInterfacesDesc *prometheus.Desc + arpNewRequestsOnUnnumberedInterfacesDesc *prometheus.Desc + arpRepliesFromUnnumberedInterfacesDesc *prometheus.Desc + arpRequestsOnUnnumberedInterfaceWithNonSubnettedDonorDesc *prometheus.Desc + arpRepliesFromUnnumberedInterfaceWithNonSubnettedDonorDesc *prometheus.Desc + arpPacketsRejectedAsFamilyIsConfiguredWithDenyArpDesc *prometheus.Desc + arpResponsePacketsAreRejectedOnMcAeIclInterfaceDesc *prometheus.Desc + arpRepliesAreRejectedAsSourceAndDestinationIsSameDesc *prometheus.Desc + arpProbeForProxyAddressReachableFromTheIncomingInterfaceDesc *prometheus.Desc + arpRequestDiscardedForVrrpSourceAddressDesc *prometheus.Desc + arpSelfArpRequestPacketReceivedOnIrbInterfaceDesc *prometheus.Desc + arpProxyArpRequestDiscardedAsSourceIpIsAProxyTargetDesc *prometheus.Desc + arpPacketsAreDroppedAsNexthopAllocationFailedDesc *prometheus.Desc + arpPacketsReceivedFromPeerVrrpRouterAndDiscardedDesc *prometheus.Desc + arpPacketsAreRejectedAsTargetIpArpResolveIsInProgressDesc *prometheus.Desc + arpGratArpPacketsAreIgnoredAsMacAddressIsNotChangedDesc *prometheus.Desc + arpPacketsAreDroppedFromPeerVrrpDesc *prometheus.Desc + arpPacketsAreDroppedAsDriverCallFailedDesc *prometheus.Desc + arpPacketsAreDroppedAsSourceIsNotValidatedDesc *prometheus.Desc + arpSystemMaxDesc *prometheus.Desc + arpPublicMaxDesc *prometheus.Desc + arpIriMaxDesc *prometheus.Desc + arpMgtMaxDesc *prometheus.Desc + arpPublicCntDesc *prometheus.Desc + arpIriCntDesc *prometheus.Desc + arpMgtCntDesc *prometheus.Desc + arpSystemDropDesc *prometheus.Desc + arpPublicDropDesc *prometheus.Desc + arpIriDropDesc *prometheus.Desc + arpMgtDropDesc *prometheus.Desc ) func init() { @@ -444,6 +506,68 @@ func init() { tcpOptionSackLength = prometheus.NewDesc(prefix+"tcp_option_sack_length", "Number of TCP option sack length", labelsTCP, nil) tcpOptionAuthoptionLength = prometheus.NewDesc(prefix+"tcp_option_authoption_length", "Number of TCP option authoption length", labelsTCP, nil) + labelsARP := []string{"target", "protocol"} + arpDatagramsReceivedDesc = prometheus.NewDesc(prefix+"arp_datagrams_received", "Number of ARP datagrams received", labelsARP, nil) + arpRequestsReceivedDesc = prometheus.NewDesc(prefix+"arp_requests_received", "Number of ARP requests received", labelsARP, nil) + arpRepliesReceivedDesc = prometheus.NewDesc(prefix+"arp_replies_received", "Number of ARP replies received", labelsARP, nil) + arpResolutionRequestReceivedDesc = prometheus.NewDesc(prefix+"arp_resolution_request_received", "Number of ARP resolution request received", labelsARP, nil) + arpResolutionRequestDroppedDesc = prometheus.NewDesc(prefix+"arp_resolution_request_dropped", "Number of ARP resolution request dropped", labelsARP, nil) + arpUnrestrictedProxyRequestsDesc = prometheus.NewDesc(prefix+"arp_unrestricted_proxy_requests", "Number of ARP unrestricted proxy requests", labelsARP, nil) + arpRestrictedProxyRequestsDesc = prometheus.NewDesc(prefix+"arp_restricted_proxy_requests", "Number of ARP restricted proxy requests", labelsARP, nil) + arpReceivedProxyRequestsDesc = prometheus.NewDesc(prefix+"arp_received_proxy_requests", "Number of ARP received proxy requests", labelsARP, nil) + arpProxyRequestsNotProxiedDesc = prometheus.NewDesc(prefix+"arp_proxy_requests_not_proxied", "Number of ARP proxy requests not proxied", labelsARP, nil) + arpRestrictedProxyRequestsNotProxiedDesc = prometheus.NewDesc(prefix+"arp_restricted_proxy_requests_not_proxied", "Number of ARP restricted proxy requests not proxied", labelsARP, nil) + arpDatagramsWithBogusInterfaceDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_bogus_interface", "Number of ARP datagrams with bogus interface", labelsARP, nil) + arpDatagramsWithIncorrectLengthDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_incorrect_length", "Number of ARP datagrams with incorrect length", labelsARP, nil) + arpDatagramsForNonIpProtocolDesc = prometheus.NewDesc(prefix+"arp_datagrams_for_non_ip_protocol", "Number of ARP datagrams for non ip protocol", labelsARP, nil) + arpDatagramsWithUnsupportedOpcodeDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_unsupported_opcode", "Number of ARP datagrams with unsupported opcode", labelsARP, nil) + arpDatagramsWithBadProtocolAddressLengthDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_bad_protocol_address_length", "Number of ARP datagrams with bad protocol address length", labelsARP, nil) + arpDatagramsWithBadHardwareAddressLengthDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_bad_hardware_address_length", "Number of ARP datagrams with bad hardware address length", labelsARP, nil) + arpDatagramsWithMulticastSourceAddressDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_multicast_source_address", "Number of ARP datagrams with multicast source address", labelsARP, nil) + arpDatagramsWithMulticastTargetAddressDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_multicast_target_address", "Number of ARP datagrams with multicast target address", labelsARP, nil) + arpDatagramsWithMyOwnHardwareAddressDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_my_own_hardware_address", "Number of ARP datagrams with my own hardware address", labelsARP, nil) + arpDatagramsForAnAddressNotOnTheInterfaceDesc = prometheus.NewDesc(prefix+"arp_datagrams_for_an_address_not_on_interface", "Number of ARP datagrams for an address not on the interface", labelsARP, nil) + arpDatagramsWithABroadcastSourceAddressDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_a_broadcast_source_address", "Number of ARP datagrams with a broadcast source address", labelsARP, nil) + arpDatagramsWithSourceAddressDuplicateToMineDesc = prometheus.NewDesc(prefix+"arp_datagrams_with_source_address_duplicate_to_mine", "Number of ARP datagrams with source address duplicate to mine", labelsARP, nil) + arpDatagramsWhichWereNotForMeDesc = prometheus.NewDesc(prefix+"arp_datagrams_which_were_not_for_me", "Number of ARP datagrams which were not for me", labelsARP, nil) + arpPacketsDiscardedWaitingForResolutionDesc = prometheus.NewDesc(prefix+"arp_packets_discarded_waiting_for_resolution", "Number of ARP packets discarded waiting for resolution", labelsARP, nil) + arpPacketsSentAfterWaitingForResolutionDesc = prometheus.NewDesc(prefix+"arp_packets_sent_after_waiting_for_resolution", "Number of ARP packets sent after waiting for resolution", labelsARP, nil) + arpRequestsSentDesc = prometheus.NewDesc(prefix+"arp_requests_sent", "Number of ARP requests sent", labelsARP, nil) + arpRepliesSentDesc = prometheus.NewDesc(prefix+"arp_replies_sent", "Number of ARP replies sent", labelsARP, nil) + arpRequestsForMemoryDeniedDesc = prometheus.NewDesc(prefix+"arp_requests_for_memory_denied", "Number of ARP requests for memory denied", labelsARP, nil) + arpRequestsDroppedOnEntryDesc = prometheus.NewDesc(prefix+"arp_requests_dropped_on_entry", "Number of ARP requests dropped on entry", labelsARP, nil) + arpRequestsDroppedDuringRetryDesc = prometheus.NewDesc(prefix+"arp_requests_dropped_during_retry", "Number of ARP requests dropped during retry", labelsARP, nil) + arpRequestsDroppedDueToInterfaceDeletionDesc = prometheus.NewDesc(prefix+"arp_requests_dropped_due_to_interface_deletion", "Number of ARP requests dropped due to interface deletion", labelsARP, nil) + arpRequestsOnUnnumberedInterfacesDesc = prometheus.NewDesc(prefix+"arp_requests_on_unnumbered_interfaces", "Number of ARP requests on unnumbered interfaces", labelsARP, nil) + arpNewRequestsOnUnnumberedInterfacesDesc = prometheus.NewDesc(prefix+"arp_new_requests_on_unnumbered_interfaces", "Number of ARP requests on unnumbered interfaces", labelsARP, nil) + arpRepliesFromUnnumberedInterfacesDesc = prometheus.NewDesc(prefix+"arp_replies_from_unnumbered_interfaces", "Number of ARP replies from unnumbered interfaces", labelsARP, nil) + arpRequestsOnUnnumberedInterfaceWithNonSubnettedDonorDesc = prometheus.NewDesc(prefix+"arp_requests_on_unnumbered_interface_with_non_subnetted_donor", "Number of ARP requests on unnumbered interface with non subnetted donor", labelsARP, nil) + arpRepliesFromUnnumberedInterfaceWithNonSubnettedDonorDesc = prometheus.NewDesc(prefix+"arp_replies_from_unnumbered_interface_with_non_subnet_donor", "Number of ARP replies from unnumbered interface with non subnetted donor", labelsARP, nil) + arpPacketsRejectedAsFamilyIsConfiguredWithDenyArpDesc = prometheus.NewDesc(prefix+"arp_packets_rejected_as_family_is_configured_with_deny", "Number of ARP packets rejected as family is configured with deny", labelsARP, nil) + arpResponsePacketsAreRejectedOnMcAeIclInterfaceDesc = prometheus.NewDesc(prefix+"arp_response_packets_are_rejected_on_McAeIcl_interface", "Number of ARP response packets are rejected on McAeIcl interface", labelsARP, nil) + arpRepliesAreRejectedAsSourceAndDestinationIsSameDesc = prometheus.NewDesc(prefix+"arp_replies_are_rejected_as_source_and_destination_is_same", "Number of ARP replies tha tare rejected due to source and destination being same ", labelsARP, nil) + arpProbeForProxyAddressReachableFromTheIncomingInterfaceDesc = prometheus.NewDesc(prefix+"arp_probe_for_proxy_address_reachable_from_the_incoming_interface", "Number of ARP probes for proxy address reachable from the incoming interface", labelsARP, nil) + arpRequestDiscardedForVrrpSourceAddressDesc = prometheus.NewDesc(prefix+"arp_request_discarded_for_vrrp_source_address", "Number of ARP request discarded for vrrp source address", labelsARP, nil) + arpSelfArpRequestPacketReceivedOnIrbInterfaceDesc = prometheus.NewDesc(prefix+"arp_self_arp_request_packet_received_on_irb_interface", "Number of ARP self arp request packet received on irb interface", labelsARP, nil) + arpProxyArpRequestDiscardedAsSourceIpIsAProxyTargetDesc = prometheus.NewDesc(prefix+"arp_proxy_arp_request_discarded_as_source_ip_is_a_proxy_target", "Number of ARP proxy arp request discarded as source ip is a proxy target", labelsARP, nil) + arpPacketsAreDroppedAsNexthopAllocationFailedDesc = prometheus.NewDesc(prefix+"arp_packets_are_dropped_as_nexthop_allocation_failed", "Number of ARP packets are dropped as nexthop allocation failed", labelsARP, nil) + arpPacketsReceivedFromPeerVrrpRouterAndDiscardedDesc = prometheus.NewDesc(prefix+"apr_packets_received_from_peer_vrrp_router_and_discarded", "NUmber of ARP packets received from peer vrrp router and discarded", labelsARP, nil) + arpPacketsAreRejectedAsTargetIpArpResolveIsInProgressDesc = prometheus.NewDesc(prefix+"arp_packets_are_rejected_as_target_ip_arp_resolve_is_in_progress", "Number of ARP packets are rejected as target ip arp resolve is in progress", labelsARP, nil) + arpGratArpPacketsAreIgnoredAsMacAddressIsNotChangedDesc = prometheus.NewDesc(prefix+"arp_grat_arp_packets_are_ignored_as_mac_address_is_not_changed", "Number of ARP grat arp packets are ignored as mac address is not changed", labelsARP, nil) + arpPacketsAreDroppedFromPeerVrrpDesc = prometheus.NewDesc(prefix+"apr_packets_are_dropped_from_peer_vrrp", "NUmber of ARP packets are dropped from peer vrrp", labelsARP, nil) + arpPacketsAreDroppedAsDriverCallFailedDesc = prometheus.NewDesc(prefix+"arp_packets_are_dropped_as_driver_call_failed", "Number of ARP packets are dropped as driver call failed", labelsARP, nil) + arpPacketsAreDroppedAsSourceIsNotValidatedDesc = prometheus.NewDesc(prefix+"arp_packets_are_dropped_as_source_is_not_validated", "Number of ARP packets are dropped as source is not validated", labelsARP, nil) + arpSystemMaxDesc = prometheus.NewDesc(prefix+"arp_system_max", "Number of ARP system max", labelsARP, nil) + arpPublicMaxDesc = prometheus.NewDesc(prefix+"arp_public_max", "Number of ARP public max", labelsARP, nil) + arpIriMaxDesc = prometheus.NewDesc(prefix+"arp_iri_max", "Number of ARP iri max", labelsARP, nil) + arpMgtMaxDesc = prometheus.NewDesc(prefix+"arp_mgnt_max", "Number of ARP mgnt max", labelsARP, nil) + arpPublicCntDesc = prometheus.NewDesc(prefix+"arp_public_cnt", "Number of ARP public cnt", labelsARP, nil) + arpIriCntDesc = prometheus.NewDesc(prefix+"arp_iri_cnt", "Number of ARP iri cnt", labelsARP, nil) + arpMgtCntDesc = prometheus.NewDesc(prefix+"arp_mgnt_cnt", "Number of ARP mgnt cnt", labelsARP, nil) + arpSystemDropDesc = prometheus.NewDesc(prefix+"arp_system_drop", "Number of ARP system drop", labelsARP, nil) + arpPublicDropDesc = prometheus.NewDesc(prefix+"arp_public_drop", "Number of ARP public drop", labelsARP, nil) + arpIriDropDesc = prometheus.NewDesc(prefix+"arp_iri_drop", "Number of ARP iri drop", labelsARP, nil) + arpMgtDropDesc = prometheus.NewDesc(prefix+"arp_mgnt_drop", "Number of ARP mgnt drop", labelsARP, nil) } type systemstatisticsCollector struct{} @@ -671,6 +795,66 @@ func (c *systemstatisticsCollector) Describe(ch chan<- *prometheus.Desc) { ch <- tcpOptionSackLength ch <- tcpOptionAuthoptionLength + ch <- arpDatagramsReceivedDesc + ch <- arpRequestsReceivedDesc + ch <- arpRepliesReceivedDesc + ch <- arpResolutionRequestReceivedDesc + ch <- arpResolutionRequestDroppedDesc + ch <- arpUnrestrictedProxyRequestsDesc + ch <- arpRestrictedProxyRequestsDesc + ch <- arpReceivedProxyRequestsDesc + ch <- arpProxyRequestsNotProxiedDesc + ch <- arpDatagramsWithBogusInterfaceDesc + ch <- arpDatagramsWithIncorrectLengthDesc + ch <- arpDatagramsForNonIpProtocolDesc + ch <- arpDatagramsWithUnsupportedOpcodeDesc + ch <- arpDatagramsWithBadProtocolAddressLengthDesc + ch <- arpDatagramsWithBadHardwareAddressLengthDesc + ch <- arpDatagramsWithMulticastSourceAddressDesc + ch <- arpDatagramsWithMulticastTargetAddressDesc + ch <- arpDatagramsWithMyOwnHardwareAddressDesc + ch <- arpDatagramsForAnAddressNotOnTheInterfaceDesc + ch <- arpDatagramsWithABroadcastSourceAddressDesc + ch <- arpDatagramsWithSourceAddressDuplicateToMineDesc + ch <- arpDatagramsWhichWereNotForMeDesc + ch <- arpPacketsDiscardedWaitingForResolutionDesc + ch <- arpPacketsSentAfterWaitingForResolutionDesc + ch <- arpRequestsSentDesc + ch <- arpRepliesSentDesc + ch <- arpRequestsForMemoryDeniedDesc + ch <- arpRequestsDroppedOnEntryDesc + ch <- arpRequestsDroppedDuringRetryDesc + ch <- arpRequestsDroppedDueToInterfaceDeletionDesc + ch <- arpRequestsOnUnnumberedInterfacesDesc + ch <- arpNewRequestsOnUnnumberedInterfacesDesc + ch <- arpRepliesFromUnnumberedInterfacesDesc + ch <- arpRequestsOnUnnumberedInterfaceWithNonSubnettedDonorDesc + ch <- arpRepliesFromUnnumberedInterfaceWithNonSubnettedDonorDesc + ch <- arpPacketsRejectedAsFamilyIsConfiguredWithDenyArpDesc + ch <- arpResponsePacketsAreRejectedOnMcAeIclInterfaceDesc + ch <- arpRepliesAreRejectedAsSourceAndDestinationIsSameDesc + ch <- arpProbeForProxyAddressReachableFromTheIncomingInterfaceDesc + ch <- arpRequestDiscardedForVrrpSourceAddressDesc + ch <- arpSelfArpRequestPacketReceivedOnIrbInterfaceDesc + ch <- arpProxyArpRequestDiscardedAsSourceIpIsAProxyTargetDesc + ch <- arpPacketsAreDroppedAsNexthopAllocationFailedDesc + ch <- arpPacketsReceivedFromPeerVrrpRouterAndDiscardedDesc + ch <- arpPacketsAreRejectedAsTargetIpArpResolveIsInProgressDesc + ch <- arpGratArpPacketsAreIgnoredAsMacAddressIsNotChangedDesc + ch <- arpPacketsAreDroppedFromPeerVrrpDesc + ch <- arpPacketsAreDroppedAsDriverCallFailedDesc + ch <- arpPacketsAreDroppedAsSourceIsNotValidatedDesc + ch <- arpSystemMaxDesc + ch <- arpPublicMaxDesc + ch <- arpIriMaxDesc + ch <- arpMgtMaxDesc + ch <- arpPublicCntDesc + ch <- arpIriCntDesc + ch <- arpMgtCntDesc + ch <- arpSystemDropDesc + ch <- arpPublicDropDesc + ch <- arpIriDropDesc + ch <- arpMgtDropDesc } func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { @@ -695,6 +879,11 @@ func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- p return err } c.collectSystemStatisticsTCP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics arp", &s) + if err != nil { + return err + } + c.collectSystemStatisticsARP(ch, labelValues, s) return nil } @@ -925,3 +1114,68 @@ func (c *systemstatisticsCollector) collectSystemStatisticsTCP(ch chan<- prometh ch <- prometheus.MustNewConstMetric(tcpOptionSackLength, prometheus.CounterValue, s.Statistics.Tcp.OptionSackLength, l...) ch <- prometheus.MustNewConstMetric(tcpOptionAuthoptionLength, prometheus.CounterValue, s.Statistics.Tcp.OptionAuthoptionLength, l...) } + +func (c *systemstatisticsCollector) collectSystemStatisticsARP(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { + labels := append(labelValues, "ARP") + ch <- prometheus.MustNewConstMetric(arpDatagramsReceivedDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsReceived, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsReceivedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRequestsSent, labels...) + ch <- prometheus.MustNewConstMetric(arpRepliesReceivedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRepliesReceived, labels...) + ch <- prometheus.MustNewConstMetric(arpResolutionRequestReceivedDesc, prometheus.CounterValue, s.Statistics.Arp.ResolutionRequestReceived, labels...) + ch <- prometheus.MustNewConstMetric(arpResolutionRequestDroppedDesc, prometheus.CounterValue, s.Statistics.Arp.ResolutionRequestDropped, labels...) + ch <- prometheus.MustNewConstMetric(arpUnrestrictedProxyRequestsDesc, prometheus.CounterValue, s.Statistics.Arp.UnrestrictedProxyRequests, labels...) + ch <- prometheus.MustNewConstMetric(arpRestrictedProxyRequestsDesc, prometheus.CounterValue, s.Statistics.Arp.RestrictedProxyRequests, labels...) + ch <- prometheus.MustNewConstMetric(arpReceivedProxyRequestsDesc, prometheus.CounterValue, s.Statistics.Arp.ReceivedProxyRequests, labels...) + ch <- prometheus.MustNewConstMetric(arpProxyRequestsNotProxiedDesc, prometheus.CounterValue, s.Statistics.Arp.ProxyRequestsNotProxied, labels...) + ch <- prometheus.MustNewConstMetric(arpRestrictedProxyRequestsNotProxiedDesc, prometheus.CounterValue, s.Statistics.Arp.RestrictedProxyRequestsNotProxied, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithBogusInterfaceDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithBogusInterface, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithIncorrectLengthDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithIncorrectLength, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsForNonIpProtocolDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsForNonIpProtocol, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithUnsupportedOpcodeDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithUnsupportedOpcode, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithBadProtocolAddressLengthDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithBadProtocolAddressLength, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithBadHardwareAddressLengthDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithBadHardwareAddressLength, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithMulticastSourceAddressDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithMulticastSourceAddress, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithMulticastTargetAddressDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithMulticastTargetAddress, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithMyOwnHardwareAddressDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithMyOwnHardwareAddress, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsForAnAddressNotOnTheInterfaceDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsForAnAddressNotOnTheInterface, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithABroadcastSourceAddressDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithABroadcastSourceAddress, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWithSourceAddressDuplicateToMineDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWithSourceAddressDuplicateToMine, labels...) + ch <- prometheus.MustNewConstMetric(arpDatagramsWhichWereNotForMeDesc, prometheus.CounterValue, s.Statistics.Arp.DatagramsWhichWereNotForMe, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsDiscardedWaitingForResolutionDesc, prometheus.CounterValue, s.Statistics.Arp.PacketsDiscardedWaitingForResolution, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsSentAfterWaitingForResolutionDesc, prometheus.CounterValue, s.Statistics.Arp.PacketsSentAfterWaitingForResolution, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsSentDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRequestsSent, labels...) + ch <- prometheus.MustNewConstMetric(arpRepliesSentDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRepliesSent, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsForMemoryDeniedDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsForMemoryDenied, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsDroppedOnEntryDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsDroppedOnEntry, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsDroppedDuringRetryDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsDroppedDuringRetry, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsDroppedDueToInterfaceDeletionDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsDroppedDueToInterfaceDeletion, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsOnUnnumberedInterfacesDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsOnUnnumberedInterfaces, labels...) + ch <- prometheus.MustNewConstMetric(arpNewRequestsOnUnnumberedInterfacesDesc, prometheus.CounterValue, s.Statistics.Arp.NewRequestsOnUnnumberedInterfaces, labels...) + ch <- prometheus.MustNewConstMetric(arpRepliesFromUnnumberedInterfacesDesc, prometheus.CounterValue, s.Statistics.Arp.RepliesFromUnnumberedInterfaces, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestsOnUnnumberedInterfaceWithNonSubnettedDonorDesc, prometheus.CounterValue, s.Statistics.Arp.RequestsOnUnnumberedInterfaceWithNonSubnettedDonor, labels...) + ch <- prometheus.MustNewConstMetric(arpRepliesFromUnnumberedInterfaceWithNonSubnettedDonorDesc, prometheus.CounterValue, s.Statistics.Arp.RepliesFromUnnumberedInterfaceWithNonSubnettedDonor, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsRejectedAsFamilyIsConfiguredWithDenyArpDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsRejectedAsFamilyIsConfiguredWithDenyArp, labels...) + ch <- prometheus.MustNewConstMetric(arpResponsePacketsAreRejectedOnMcAeIclInterfaceDesc, prometheus.CounterValue, s.Statistics.Arp.ArpResponsePacketsAreRejectedOnMcAeIclInterface, labels...) + ch <- prometheus.MustNewConstMetric(arpRepliesAreRejectedAsSourceAndDestinationIsSameDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRepliesAreRejectedAsSourceAndDestinationIsSame, labels...) + ch <- prometheus.MustNewConstMetric(arpProbeForProxyAddressReachableFromTheIncomingInterfaceDesc, prometheus.CounterValue, s.Statistics.Arp.ArpProbeForProxyAddressReachableFromTheIncomingInterface, labels...) + ch <- prometheus.MustNewConstMetric(arpRequestDiscardedForVrrpSourceAddressDesc, prometheus.CounterValue, s.Statistics.Arp.ArpRequestDiscardedForVrrpSourceAddress, labels...) + ch <- prometheus.MustNewConstMetric(arpSelfArpRequestPacketReceivedOnIrbInterfaceDesc, prometheus.CounterValue, s.Statistics.Arp.SelfArpRequestPacketReceivedOnIrbInterface, labels...) + ch <- prometheus.MustNewConstMetric(arpProxyArpRequestDiscardedAsSourceIpIsAProxyTargetDesc, prometheus.CounterValue, s.Statistics.Arp.ProxyArpRequestDiscardedAsSourceIpIsAProxyTarget, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsAreDroppedAsNexthopAllocationFailedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsAreDroppedAsNexthopAllocationFailed, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsReceivedFromPeerVrrpRouterAndDiscardedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsReceivedFromPeerVrrpRouterAndDiscarded, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsAreRejectedAsTargetIpArpResolveIsInProgressDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsAreRejectedAsTargetIpArpResolveIsInProgress, labels...) + ch <- prometheus.MustNewConstMetric(arpGratArpPacketsAreIgnoredAsMacAddressIsNotChangedDesc, prometheus.CounterValue, s.Statistics.Arp.GratArpPacketsAreIgnoredAsMacAddressIsNotChanged, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsAreDroppedFromPeerVrrpDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsAreDroppedFromPeerVrrp, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsAreDroppedAsDriverCallFailedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsAreDroppedAsDriverCallFailed, labels...) + ch <- prometheus.MustNewConstMetric(arpPacketsAreDroppedAsSourceIsNotValidatedDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPacketsAreDroppedAsSourceIsNotValidated, labels...) + ch <- prometheus.MustNewConstMetric(arpSystemMaxDesc, prometheus.CounterValue, s.Statistics.Arp.ArpSystemMax, labels...) + ch <- prometheus.MustNewConstMetric(arpPublicMaxDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPublicMax, labels...) + ch <- prometheus.MustNewConstMetric(arpIriMaxDesc, prometheus.CounterValue, s.Statistics.Arp.ArpIriMax, labels...) + ch <- prometheus.MustNewConstMetric(arpMgtMaxDesc, prometheus.CounterValue, s.Statistics.Arp.ArpMgtMax, labels...) + ch <- prometheus.MustNewConstMetric(arpPublicCntDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPublicCnt, labels...) + ch <- prometheus.MustNewConstMetric(arpIriCntDesc, prometheus.CounterValue, s.Statistics.Arp.ArpIriCnt, labels...) + ch <- prometheus.MustNewConstMetric(arpMgtCntDesc, prometheus.CounterValue, s.Statistics.Arp.ArpMgtCnt, labels...) + ch <- prometheus.MustNewConstMetric(arpSystemDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpSystemDrop, labels...) + ch <- prometheus.MustNewConstMetric(arpPublicDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpPublicDrop, labels...) + ch <- prometheus.MustNewConstMetric(arpIriDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpIriDrop, labels...) + ch <- prometheus.MustNewConstMetric(arpMgtDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpMgtDrop, labels...) +} diff --git a/pkg/features/systemstatistics/rpc.go b/pkg/features/systemstatistics/rpc.go index 4d3c8b93..1464034b 100644 --- a/pkg/features/systemstatistics/rpc.go +++ b/pkg/features/systemstatistics/rpc.go @@ -49,70 +49,7 @@ type Statistics struct { TimestampDropsWithBroadcastOrMulticastDestinationAddress string `xml:"timestamp-drops-with-broadcast-or-multicast-destination-address"` MessageResponsesGenerated string `xml:"message-responses-generated"` } `xml:"icmp"` - Arp struct { - Text string `xml:",chardata"` - DatagramsReceived string `xml:"datagrams-received"` - ArpRequestsReceived string `xml:"arp-requests-received"` - ArpRepliesReceived string `xml:"arp-replies-received"` - ResolutionRequestReceived string `xml:"resolution-request-received"` - ResolutionRequestDropped string `xml:"resolution-request-dropped"` - UnrestrictedProxyRequests string `xml:"unrestricted-proxy-requests"` - RestrictedProxyRequests string `xml:"restricted-proxy-requests"` - ReceivedProxyRequests string `xml:"received-proxy-requests"` - ProxyRequestsNotProxied string `xml:"proxy-requests-not-proxied"` - RestrictedProxyRequestsNotProxied string `xml:"restricted-proxy-requests-not-proxied"` - DatagramsWithBogusInterface string `xml:"datagrams-with-bogus-interface"` - DatagramsWithIncorrectLength string `xml:"datagrams-with-incorrect-length"` - DatagramsForNonIpProtocol string `xml:"datagrams-for-non-ip-protocol"` - DatagramsWithUnsupportedOpcode string `xml:"datagrams-with-unsupported-opcode"` - DatagramsWithBadProtocolAddressLength string `xml:"datagrams-with-bad-protocol-address-length"` - DatagramsWithBadHardwareAddressLength string `xml:"datagrams-with-bad-hardware-address-length"` - DatagramsWithMulticastSourceAddress string `xml:"datagrams-with-multicast-source-address"` - DatagramsWithMulticastTargetAddress string `xml:"datagrams-with-multicast-target-address"` - DatagramsWithMyOwnHardwareAddress string `xml:"datagrams-with-my-own-hardware-address"` - DatagramsForAnAddressNotOnTheInterface string `xml:"datagrams-for-an-address-not-on-the-interface"` - DatagramsWithABroadcastSourceAddress string `xml:"datagrams-with-a-broadcast-source-address"` - DatagramsWithSourceAddressDuplicateToMine string `xml:"datagrams-with-source-address-duplicate-to-mine"` - DatagramsWhichWereNotForMe string `xml:"datagrams-which-were-not-for-me"` - PacketsDiscardedWaitingForResolution string `xml:"packets-discarded-waiting-for-resolution"` - PacketsSentAfterWaitingForResolution string `xml:"packets-sent-after-waiting-for-resolution"` - ArpRequestsSent string `xml:"arp-requests-sent"` - ArpRepliesSent string `xml:"arp-replies-sent"` - RequestsForMemoryDenied string `xml:"requests-for-memory-denied"` - RequestsDroppedOnEntry string `xml:"requests-dropped-on-entry"` - RequestsDroppedDuringRetry string `xml:"requests-dropped-during-retry"` - RequestsDroppedDueToInterfaceDeletion string `xml:"requests-dropped-due-to-interface-deletion"` - RequestsOnUnnumberedInterfaces string `xml:"requests-on-unnumbered-interfaces"` - NewRequestsOnUnnumberedInterfaces string `xml:"new-requests-on-unnumbered-interfaces"` - RepliesFromUnnumberedInterfaces string `xml:"replies-from-unnumbered-interfaces"` - RequestsOnUnnumberedInterfaceWithNonSubnettedDonor string `xml:"requests-on-unnumbered-interface-with-non-subnetted-donor"` - RepliesFromUnnumberedInterfaceWithNonSubnettedDonor string `xml:"replies-from-unnumbered-interface-with-non-subnetted-donor"` - ArpPacketsRejectedAsFamilyIsConfiguredWithDenyArp string `xml:"arp-packets-rejected-as-family-is-configured-with-deny-arp"` - ArpResponsePacketsAreRejectedOnMcAeIclInterface string `xml:"arp-response-packets-are-rejected-on-mc-ae-icl-interface"` - ArpRepliesAreRejectedAsSourceAndDestinationIsSame string `xml:"arp-replies-are-rejected-as-source-and-destination-is-same"` - ArpProbeForProxyAddressReachableFromTheIncomingInterface string `xml:"arp-probe-for-proxy-address-reachable-from-the-incoming-interface"` - ArpRequestDiscardedForVrrpSourceAddress string `xml:"arp-request-discarded-for-vrrp-source-address"` - SelfArpRequestPacketReceivedOnIrbInterface string `xml:"self-arp-request-packet-received-on-irb-interface"` - ProxyArpRequestDiscardedAsSourceIpIsAProxyTarget string `xml:"proxy-arp-request-discarded-as-source-ip-is-a-proxy-target"` - ArpPacketsAreDroppedAsNexthopAllocationFailed string `xml:"arp-packets-are-dropped-as-nexthop-allocation-failed"` - ArpPacketsReceivedFromPeerVrrpRouterAndDiscarded string `xml:"arp-packets-received-from-peer-vrrp-router-and-discarded"` - ArpPacketsAreRejectedAsTargetIpArpResolveIsInProgress string `xml:"arp-packets-are-rejected-as-target-ip-arp-resolve-is-in-progress"` - GratArpPacketsAreIgnoredAsMacAddressIsNotChanged string `xml:"grat-arp-packets-are-ignored-as-mac-address-is-not-changed"` - ArpPacketsAreDroppedFromPeerVrrp string `xml:"arp-packets-are-dropped-from-peer-vrrp"` - ArpPacketsAreDroppedAsDriverCallFailed string `xml:"arp-packets-are-dropped-as-driver-call-failed"` - ArpPacketsAreDroppedAsSourceIsNotValidated string `xml:"arp-packets-are-dropped-as-source-is-not-validated"` - ArpSystemMax string `xml:"arp-system-max"` - ArpPublicMax string `xml:"arp-public-max"` - ArpIriMax string `xml:"arp-iri-max"` - ArpMgtMax string `xml:"arp-mgt-max"` - ArpPublicCnt string `xml:"arp-public-cnt"` - ArpIriCnt string `xml:"arp-iri-cnt"` - ArpMgtCnt string `xml:"arp-mgt-cnt"` - ArpSystemDrop string `xml:"arp-system-drop"` - ArpPublicDrop string `xml:"arp-public-drop"` - ArpIriDrop string `xml:"arp-iri-drop"` - ArpMgtDrop string `xml:"arp-mgt-drop"` - } `xml:"arp"` + Arp ARP `xml:"arp"` Ip6 IP6 `xml:"ip6"` Icmp6 struct { Text string `xml:",chardata"` @@ -450,4 +387,69 @@ type TCP struct { OptionSackpermittedLength float64 `xml:"option-sackpermitted-length"` OptionSackLength float64 `xml:"option-sack-length"` OptionAuthoptionLength float64 `xml:"option-authoption-length"` +} + +type ARP struct { + Text string `xml:",chardata"` + DatagramsReceived float64 `xml:"datagrams-received"` + ArpRequestsReceived float64 `xml:"arp-requests-received"` + ArpRepliesReceived float64 `xml:"arp-replies-received"` + ResolutionRequestReceived float64 `xml:"resolution-request-received"` + ResolutionRequestDropped float64 `xml:"resolution-request-dropped"` + UnrestrictedProxyRequests float64 `xml:"unrestricted-proxy-requests"` + RestrictedProxyRequests float64 `xml:"restricted-proxy-requests"` + ReceivedProxyRequests float64 `xml:"received-proxy-requests"` + ProxyRequestsNotProxied float64 `xml:"proxy-requests-not-proxied"` + RestrictedProxyRequestsNotProxied float64 `xml:"restricted-proxy-requests-not-proxied"` + DatagramsWithBogusInterface float64 `xml:"datagrams-with-bogus-interface"` + DatagramsWithIncorrectLength float64 `xml:"datagrams-with-incorrect-length"` + DatagramsForNonIpProtocol float64 `xml:"datagrams-for-non-ip-protocol"` + DatagramsWithUnsupportedOpcode float64 `xml:"datagrams-with-unsupported-opcode"` + DatagramsWithBadProtocolAddressLength float64 `xml:"datagrams-with-bad-protocol-address-length"` + DatagramsWithBadHardwareAddressLength float64 `xml:"datagrams-with-bad-hardware-address-length"` + DatagramsWithMulticastSourceAddress float64 `xml:"datagrams-with-multicast-source-address"` + DatagramsWithMulticastTargetAddress float64 `xml:"datagrams-with-multicast-target-address"` + DatagramsWithMyOwnHardwareAddress float64 `xml:"datagrams-with-my-own-hardware-address"` + DatagramsForAnAddressNotOnTheInterface float64 `xml:"datagrams-for-an-address-not-on-the-interface"` + DatagramsWithABroadcastSourceAddress float64 `xml:"datagrams-with-a-broadcast-source-address"` + DatagramsWithSourceAddressDuplicateToMine float64 `xml:"datagrams-with-source-address-duplicate-to-mine"` + DatagramsWhichWereNotForMe float64 `xml:"datagrams-which-were-not-for-me"` + PacketsDiscardedWaitingForResolution float64 `xml:"packets-discarded-waiting-for-resolution"` + PacketsSentAfterWaitingForResolution float64 `xml:"packets-sent-after-waiting-for-resolution"` + ArpRequestsSent float64 `xml:"arp-requests-sent"` + ArpRepliesSent float64 `xml:"arp-replies-sent"` + RequestsForMemoryDenied float64 `xml:"requests-for-memory-denied"` + RequestsDroppedOnEntry float64 `xml:"requests-dropped-on-entry"` + RequestsDroppedDuringRetry float64 `xml:"requests-dropped-during-retry"` + RequestsDroppedDueToInterfaceDeletion float64 `xml:"requests-dropped-due-to-interface-deletion"` + RequestsOnUnnumberedInterfaces float64 `xml:"requests-on-unnumbered-interfaces"` + NewRequestsOnUnnumberedInterfaces float64 `xml:"new-requests-on-unnumbered-interfaces"` + RepliesFromUnnumberedInterfaces float64 `xml:"replies-from-unnumbered-interfaces"` + RequestsOnUnnumberedInterfaceWithNonSubnettedDonor float64 `xml:"requests-on-unnumbered-interface-with-non-subnetted-donor"` + RepliesFromUnnumberedInterfaceWithNonSubnettedDonor float64 `xml:"replies-from-unnumbered-interface-with-non-subnetted-donor"` + ArpPacketsRejectedAsFamilyIsConfiguredWithDenyArp float64 `xml:"arp-packets-rejected-as-family-is-configured-with-deny-arp"` + ArpResponsePacketsAreRejectedOnMcAeIclInterface float64 `xml:"arp-response-packets-are-rejected-on-mc-ae-icl-interface"` + ArpRepliesAreRejectedAsSourceAndDestinationIsSame float64 `xml:"arp-replies-are-rejected-as-source-and-destination-is-same"` + ArpProbeForProxyAddressReachableFromTheIncomingInterface float64 `xml:"arp-probe-for-proxy-address-reachable-from-the-incoming-interface"` + ArpRequestDiscardedForVrrpSourceAddress float64 `xml:"arp-request-discarded-for-vrrp-source-address"` + SelfArpRequestPacketReceivedOnIrbInterface float64 `xml:"self-arp-request-packet-received-on-irb-interface"` + ProxyArpRequestDiscardedAsSourceIpIsAProxyTarget float64 `xml:"proxy-arp-request-discarded-as-source-ip-is-a-proxy-target"` + ArpPacketsAreDroppedAsNexthopAllocationFailed float64 `xml:"arp-packets-are-dropped-as-nexthop-allocation-failed"` + ArpPacketsReceivedFromPeerVrrpRouterAndDiscarded float64 `xml:"arp-packets-received-from-peer-vrrp-router-and-discarded"` + ArpPacketsAreRejectedAsTargetIpArpResolveIsInProgress float64 `xml:"arp-packets-are-rejected-as-target-ip-arp-resolve-is-in-progress"` + GratArpPacketsAreIgnoredAsMacAddressIsNotChanged float64 `xml:"grat-arp-packets-are-ignored-as-mac-address-is-not-changed"` + ArpPacketsAreDroppedFromPeerVrrp float64 `xml:"arp-packets-are-dropped-from-peer-vrrp"` + ArpPacketsAreDroppedAsDriverCallFailed float64 `xml:"arp-packets-are-dropped-as-driver-call-failed"` + ArpPacketsAreDroppedAsSourceIsNotValidated float64 `xml:"arp-packets-are-dropped-as-source-is-not-validated"` + ArpSystemMax float64 `xml:"arp-system-max"` + ArpPublicMax float64 `xml:"arp-public-max"` + ArpIriMax float64 `xml:"arp-iri-max"` + ArpMgtMax float64 `xml:"arp-mgt-max"` + ArpPublicCnt float64 `xml:"arp-public-cnt"` + ArpIriCnt float64 `xml:"arp-iri-cnt"` + ArpMgtCnt float64 `xml:"arp-mgt-cnt"` + ArpSystemDrop float64 `xml:"arp-system-drop"` + ArpPublicDrop float64 `xml:"arp-public-drop"` + ArpIriDrop float64 `xml:"arp-iri-drop"` + ArpMgtDrop float64 `xml:"arp-mgt-drop"` } \ No newline at end of file From 5f157338973c4107c442feaef96ae61307aab56b Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Fri, 5 Sep 2025 11:35:24 +0200 Subject: [PATCH 02/11] added tests for Arp --- pkg/features/systemstatistics/rpc_test.go | 100 ++++++++++++++++++ .../testsFiles/ARP/ARPTestDataCase1.xml | 70 ++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 pkg/features/systemstatistics/testsFiles/ARP/ARPTestDataCase1.xml diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index bc27046c..b1a5e5e6 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -385,3 +385,103 @@ func TestStatisticsTCPUnmarshaling(t *testing.T) { }) } } + +func TestStatisticsARPUnmarshaling(t *testing.T) { + type testCase struct { + name string + xmlFile string + expect SystemStatistics + } + + tests := []testCase{ + { + name: "complete_arp_statistics", + xmlFile: "testsFiles/ARP/ARPTestDataCase1.xml", + expect: SystemStatistics{ + Statistics: Statistics{ + Arp: ARP{ + DatagramsReceived: 5000, + ArpRequestsReceived: 5001, + ArpRepliesReceived: 5002, + ResolutionRequestReceived: 5003, + ResolutionRequestDropped: 5004, + UnrestrictedProxyRequests: 5005, + RestrictedProxyRequests: 5006, + ReceivedProxyRequests: 5007, + ProxyRequestsNotProxied: 5008, + RestrictedProxyRequestsNotProxied: 5009, + DatagramsWithBogusInterface: 5010, + DatagramsWithIncorrectLength: 5011, + DatagramsForNonIpProtocol: 5012, + DatagramsWithUnsupportedOpcode: 5013, + DatagramsWithBadProtocolAddressLength: 5014, + DatagramsWithBadHardwareAddressLength: 5015, + DatagramsWithMulticastSourceAddress: 5016, + DatagramsWithMulticastTargetAddress: 5017, + DatagramsWithMyOwnHardwareAddress: 5018, + DatagramsForAnAddressNotOnTheInterface: 5019, + DatagramsWithABroadcastSourceAddress: 5020, + DatagramsWithSourceAddressDuplicateToMine: 5021, + DatagramsWhichWereNotForMe: 5022, + PacketsDiscardedWaitingForResolution: 5023, + PacketsSentAfterWaitingForResolution: 5024, + ArpRequestsSent: 5025, + ArpRepliesSent: 5026, + RequestsForMemoryDenied: 5027, + RequestsDroppedOnEntry: 5028, + RequestsDroppedDuringRetry: 5029, + RequestsDroppedDueToInterfaceDeletion: 5030, + RequestsOnUnnumberedInterfaces: 5031, + NewRequestsOnUnnumberedInterfaces: 5032, + RepliesFromUnnumberedInterfaces: 5033, + RequestsOnUnnumberedInterfaceWithNonSubnettedDonor: 5034, + RepliesFromUnnumberedInterfaceWithNonSubnettedDonor: 5035, + ArpPacketsRejectedAsFamilyIsConfiguredWithDenyArp: 5036, + ArpResponsePacketsAreRejectedOnMcAeIclInterface: 5037, + ArpRepliesAreRejectedAsSourceAndDestinationIsSame: 5038, + ArpProbeForProxyAddressReachableFromTheIncomingInterface: 5039, + ArpRequestDiscardedForVrrpSourceAddress: 5040, + SelfArpRequestPacketReceivedOnIrbInterface: 5041, + ProxyArpRequestDiscardedAsSourceIpIsAProxyTarget: 5042, + ArpPacketsAreDroppedAsNexthopAllocationFailed: 5043, + ArpPacketsReceivedFromPeerVrrpRouterAndDiscarded: 5044, + ArpPacketsAreRejectedAsTargetIpArpResolveIsInProgress: 5045, + GratArpPacketsAreIgnoredAsMacAddressIsNotChanged: 5046, + ArpPacketsAreDroppedFromPeerVrrp: 5047, + ArpPacketsAreDroppedAsDriverCallFailed: 5048, + ArpPacketsAreDroppedAsSourceIsNotValidated: 5049, + ArpSystemMax: 5050, + ArpPublicMax: 5051, + ArpIriMax: 5052, + ArpMgtMax: 5053, + ArpPublicCnt: 5054, + ArpIriCnt: 5055, + ArpMgtCnt: 5056, + ArpSystemDrop: 5057, + ArpPublicDrop: 5058, + ArpIriDrop: 5059, + ArpMgtDrop: 5060, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fc, err := os.ReadFile(tc.xmlFile) + if err != nil { + log.Fatal("failed to read xml file in ARP testing due to: ", err) + } + var result SystemStatistics + err = xml.Unmarshal(fc, &result) + if err != nil { + log.Fatal("failed to unmarshal xml file in ARP testing due to: ", err) + } + + result.Statistics.Arp.Text = "" + assert.Equal(t, tc.expect.Statistics.Arp, result.Statistics.Arp, tc.name) + assert.NoError(t, err, "unmarshal should not return error") + }) + } +} diff --git a/pkg/features/systemstatistics/testsFiles/ARP/ARPTestDataCase1.xml b/pkg/features/systemstatistics/testsFiles/ARP/ARPTestDataCase1.xml new file mode 100644 index 00000000..0aa9fe73 --- /dev/null +++ b/pkg/features/systemstatistics/testsFiles/ARP/ARPTestDataCase1.xml @@ -0,0 +1,70 @@ + + + + 5000 + 5001 + 5002 + 5003 + 5004 + 5005 + 5006 + 5007 + 5008 + 5009 + 5010 + 5011 + 5012 + 5013 + 5014 + 5015 + 5016 + 5017 + 5018 + 5019 + 5020 + 5021 + 5022 + 5023 + 5024 + 5025 + 5026 + 5027 + 5028 + 5029 + 5030 + 5031 + 5032 + 5033 + 5034 + 5035 + 5036 + 5037 + 5038 + 5039 + 5040 + 5041 + 5042 + 5043 + 5044 + 5045 + 5046 + 5047 + 5048 + 5049 + 5050 + 5051 + 5052 + 5053 + 5054 + 5055 + 5056 + 5057 + 5058 + 5059 + 5060 + + + + + + From 8dc72af38297ade1da9dcc8d11e6a82dc4f044ce Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Mon, 8 Sep 2025 14:17:03 +0200 Subject: [PATCH 03/11] added icmp feature --- pkg/features/systemstatistics/collector.go | 93 ++++++++++++++++++++++ pkg/features/systemstatistics/rpc.go | 56 +++++++------ 2 files changed, 123 insertions(+), 26 deletions(-) diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index 35cf1a20..cb9ba788 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -284,6 +284,26 @@ var ( arpPublicDropDesc *prometheus.Desc arpIriDropDesc *prometheus.Desc arpMgtDropDesc *prometheus.Desc + + icmpDropsDueToRateLimitDesc *prometheus.Desc + icmpCallsToIcmpErrorDesc *prometheus.Desc + icmpErrorsNotGeneratedBecauseOldMessageWasIcmp *prometheus.Desc + icmpIcmpEchoReplyDesc *prometheus.Desc + icmpDestinationUnreachableDesc *prometheus.Desc + icmpIcmpEchoDesc *prometheus.Desc + icmpTimeStampReplyDesc *prometheus.Desc + icmpTimeExceededDesc *prometheus.Desc + icmpTimeStampDesc *prometheus.Desc + icmpAddressMaskRequestDesc *prometheus.Desc + icmpAnEndpointChangedItsCookieSecretDesc *prometheus.Desc + icmpMessagesWithBadCodeFieldsDesc *prometheus.Desc + icmpMessagesLessThanTheMinimumLengthDesc *prometheus.Desc + icmpMessagesWithBadChecksumDesc *prometheus.Desc + icmpMessagesWithBadSourceAddressDesc *prometheus.Desc + icmpMessagesWithBadLengthDesc *prometheus.Desc + icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc *prometheus.Desc + icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc *prometheus.Desc + icmpMessageResponsesGeneratedDesc *prometheus.Desc ) func init() { @@ -568,6 +588,28 @@ func init() { arpPublicDropDesc = prometheus.NewDesc(prefix+"arp_public_drop", "Number of ARP public drop", labelsARP, nil) arpIriDropDesc = prometheus.NewDesc(prefix+"arp_iri_drop", "Number of ARP iri drop", labelsARP, nil) arpMgtDropDesc = prometheus.NewDesc(prefix+"arp_mgnt_drop", "Number of ARP mgnt drop", labelsARP, nil) + + labelsICMP := []string{"target", "protocol"} + labelsICMPHistogram := []string{"target", "protocol", "histogram_type"} + icmpDropsDueToRateLimitDesc = prometheus.NewDesc(prefix+"icmp_drops_due_to_rate_limit", "Number of ICMP drops due to rate limit", labelsICMP, nil) + icmpCallsToIcmpErrorDesc = prometheus.NewDesc(prefix+"icmp_calls_to_icmp_error", "Number of ICMP calls to icmp error", labelsICMP, nil) + icmpErrorsNotGeneratedBecauseOldMessageWasIcmp = prometheus.NewDesc(prefix+"icmp_errors_not_generated_because_old_message_was_icmp", "Number of ICMP errors not generated because old message was icmp", labelsICMP, nil) + icmpIcmpEchoReplyDesc = prometheus.NewDesc(prefix+"icmp_echo_reply", "Number of ICMP echo reply", labelsICMPHistogram, nil) + icmpDestinationUnreachableDesc = prometheus.NewDesc(prefix+"icmp_destination_unreachable", "Number of icmp destination unrechable", labelsICMPHistogram, nil) + icmpIcmpEchoDesc = prometheus.NewDesc(prefix+"icmp_echo", "Number of icmp echos", labelsICMPHistogram, nil) + icmpTimeStampReplyDesc = prometheus.NewDesc(prefix+"icmp_time_stamp_reply", "Number of icmp time stamp reply", labelsICMPHistogram, nil) + icmpTimeExceededDesc = prometheus.NewDesc(prefix+"icmp_time_exceeded", "Number of icmp time exceeded", labelsICMPHistogram, nil) + icmpTimeStampDesc = prometheus.NewDesc(prefix+"icmp_time_stamp", "Number of icmp time stamps", labelsICMPHistogram, nil) + icmpAddressMaskRequestDesc = prometheus.NewDesc(prefix+"icmp_address_mask_request", "Number of icmp address mask requests", labelsICMPHistogram, nil) + icmpAnEndpointChangedItsCookieSecretDesc = prometheus.NewDesc(prefix+"icmp_an_endpoint_changed_its_cookie_secret", "Number of icmp that changed its cookie secret an ednpoint", labelsICMPHistogram, nil) + icmpMessagesWithBadCodeFieldsDesc = prometheus.NewDesc(prefix+"icmp_messages_with_bad_code_fields", "Number of icmp messages with bad code fields", labelsICMP, nil) + icmpMessagesLessThanTheMinimumLengthDesc = prometheus.NewDesc(prefix+"icmp_messages_less_than_the_minimum_length", "Number of icmp messages less than the minimum length", labelsICMP, nil) + icmpMessagesWithBadChecksumDesc = prometheus.NewDesc(prefix+"icmp_messages_with_bad_checksum", "Number of icmp messages with bad checksum", labelsICMP, nil) + icmpMessagesWithBadSourceAddressDesc = prometheus.NewDesc(prefix+"icmp_messages_with_nad_source-address", "Number of icmp messages with bad source address", labelsICMP, nil) + icmpMessagesWithBadLengthDesc = prometheus.NewDesc(prefix+"icmp_messages_with_bad_length", "Number of icmp messages with bad length", labelsICMP, nil) + icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc = prometheus.NewDesc(prefix+"icmp_echo_drops_with_broadcast_or_multicast_destination_address", "Number of icmp echo drops with broadcast or multicast destination address", labelsICMP, nil) + icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc = prometheus.NewDesc(prefix+"icmp_timestamp_drops_with_broadcast_or_multicast_destination_address", "Number of icmp timestamp drops with broadcast or multicast destination address", labelsICMP, nil) + icmpMessageResponsesGeneratedDesc = prometheus.NewDesc(prefix+"icmp_message_responses_generated", "Number of icmp message responses generated", labelsICMP, nil) } type systemstatisticsCollector struct{} @@ -855,6 +897,26 @@ func (c *systemstatisticsCollector) Describe(ch chan<- *prometheus.Desc) { ch <- arpPublicDropDesc ch <- arpIriDropDesc ch <- arpMgtDropDesc + + ch <- icmpDropsDueToRateLimitDesc + ch <- icmpCallsToIcmpErrorDesc + ch <- icmpErrorsNotGeneratedBecauseOldMessageWasIcmp + ch <- icmpIcmpEchoReplyDesc + ch <- icmpDestinationUnreachableDesc + ch <- icmpIcmpEchoDesc + ch <- icmpTimeStampReplyDesc + ch <- icmpTimeExceededDesc + ch <- icmpTimeStampDesc + ch <- icmpAddressMaskRequestDesc + ch <- icmpAnEndpointChangedItsCookieSecretDesc + ch <- icmpMessagesWithBadCodeFieldsDesc + ch <- icmpMessagesLessThanTheMinimumLengthDesc + ch <- icmpMessagesWithBadChecksumDesc + ch <- icmpMessagesWithBadSourceAddressDesc + ch <- icmpMessagesWithBadLengthDesc + ch <- icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc + ch <- icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc + ch <- icmpMessageResponsesGeneratedDesc } func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { @@ -884,6 +946,11 @@ func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- p return err } c.collectSystemStatisticsARP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics icmp", &s) + if err != nil { + return err + } + c.collectSystemStatisticsICMP(ch, labelValues, s) return nil } @@ -1179,3 +1246,29 @@ func (c *systemstatisticsCollector) collectSystemStatisticsARP(ch chan<- prometh ch <- prometheus.MustNewConstMetric(arpIriDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpIriDrop, labels...) ch <- prometheus.MustNewConstMetric(arpMgtDropDesc, prometheus.CounterValue, s.Statistics.Arp.ArpMgtDrop, labels...) } + +func (c *systemstatisticsCollector) collectSystemStatisticsICMP(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { + labels := append(labelValues, "ICMP") + ch <- prometheus.MustNewConstMetric(icmpDropsDueToRateLimitDesc, prometheus.CounterValue, s.Statistics.Icmp.DropsDueToRateLimit, labels...) + ch <- prometheus.MustNewConstMetric(icmpCallsToIcmpErrorDesc, prometheus.CounterValue, s.Statistics.Icmp.CallsToIcmpError, labels...) + ch <- prometheus.MustNewConstMetric(icmpErrorsNotGeneratedBecauseOldMessageWasIcmp, prometheus.CounterValue, s.Statistics.Icmp.ErrorsNotGeneratedBecauseOldMessageWasIcmp, labels...) + for _, histogram := range s.Statistics.Icmp.Histogram { + labels := append(labelValues, "ICMP", histogram.TypeOfHistogram) + ch <- prometheus.MustNewConstMetric(icmpIcmpEchoReplyDesc, prometheus.CounterValue, histogram.IcmpEchoReply, labels...) + ch <- prometheus.MustNewConstMetric(icmpDestinationUnreachableDesc, prometheus.CounterValue, histogram.DestinationUnreachable, labels...) + ch <- prometheus.MustNewConstMetric(icmpIcmpEchoDesc, prometheus.CounterValue, histogram.IcmpEcho, labels...) + ch <- prometheus.MustNewConstMetric(icmpTimeStampReplyDesc, prometheus.CounterValue, histogram.TimeStampReply, labels...) + ch <- prometheus.MustNewConstMetric(icmpTimeExceededDesc, prometheus.CounterValue, histogram.TimeExceeded, labels...) + ch <- prometheus.MustNewConstMetric(icmpTimeStampDesc, prometheus.CounterValue, histogram.TimeStamp, labels...) + ch <- prometheus.MustNewConstMetric(icmpAddressMaskRequestDesc, prometheus.CounterValue, histogram.AddressMaskRequest, labels...) + ch <- prometheus.MustNewConstMetric(icmpAnEndpointChangedItsCookieSecretDesc, prometheus.CounterValue, histogram.AnEndpointChangedItsCookieSecret, labels...) + } + ch <- prometheus.MustNewConstMetric(icmpMessagesWithBadCodeFieldsDesc, prometheus.CounterValue, s.Statistics.Icmp.MessagesWithBadCodeFields, labels...) + ch <- prometheus.MustNewConstMetric(icmpMessagesLessThanTheMinimumLengthDesc, prometheus.CounterValue, s.Statistics.Icmp.MessagesLessThanTheMinimumLength, labels...) + ch <- prometheus.MustNewConstMetric(icmpMessagesWithBadChecksumDesc, prometheus.CounterValue, s.Statistics.Icmp.MessagesWithBadChecksum, labels...) + ch <- prometheus.MustNewConstMetric(icmpMessagesWithBadSourceAddressDesc, prometheus.CounterValue, s.Statistics.Icmp.MessagesWithBadSourceAddress, labels...) + ch <- prometheus.MustNewConstMetric(icmpMessagesWithBadLengthDesc, prometheus.CounterValue, s.Statistics.Icmp.MessagesWithBadLength, labels...) + ch <- prometheus.MustNewConstMetric(icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc, prometheus.CounterValue, s.Statistics.Icmp.EchoDropsWithBroadcastOrMulticastDestinatonAddress, labels...) + ch <- prometheus.MustNewConstMetric(icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc, prometheus.CounterValue, s.Statistics.Icmp.TimestampDropsWithBroadcastOrMulticastDestinationAddress, labels...) + ch <- prometheus.MustNewConstMetric(icmpMessageResponsesGeneratedDesc, prometheus.CounterValue, s.Statistics.Icmp.MessageResponsesGenerated, labels...) +} diff --git a/pkg/features/systemstatistics/rpc.go b/pkg/features/systemstatistics/rpc.go index 1464034b..fec5cd8a 100644 --- a/pkg/features/systemstatistics/rpc.go +++ b/pkg/features/systemstatistics/rpc.go @@ -23,32 +23,7 @@ type Statistics struct { Tcp TCP `xml:"tcp"` Udp UDP `xml:"udp"` Ip IP `xml:"ip"` - Icmp struct { - Text string `xml:",chardata"` - DropsDueToRateLimit string `xml:"drops-due-to-rate-limit"` - CallsToIcmpError string `xml:"calls-to-icmp-error"` - ErrorsNotGeneratedBecauseOldMessageWasIcmp string `xml:"errors-not-generated-because-old-message-was-icmp"` - Histogram []struct { - Text string `xml:",chardata"` - TypeOfHistogram string `xml:"type-of-histogram"` - IcmpEchoReply string `xml:"icmp-echo-reply"` - DestinationUnreachable string `xml:"destination-unreachable"` - IcmpEcho string `xml:"icmp-echo"` - TimeStampReply string `xml:"time-stamp-reply"` - TimeExceeded string `xml:"time-exceeded"` - TimeStamp string `xml:"time-stamp"` - AddressMaskRequest string `xml:"address-mask-request"` - AnEndpointChangedItsCookiesecret string `xml:"an-endpoint-changed-its-cookiesecret"` - } `xml:"histogram"` - MessagesWithBadCodeFields string `xml:"messages-with-bad-code-fields"` - MessagesLessThanTheMinimumLength string `xml:"messages-less-than-the-minimum-length"` - MessagesWithBadChecksum string `xml:"messages-with-bad-checksum"` - MessagesWithBadSourceAddress string `xml:"messages-with-bad-source-address"` - MessagesWithBadLength string `xml:"messages-with-bad-length"` - EchoDropsWithBroadcastOrMulticastDestinatonAddress string `xml:"echo-drops-with-broadcast-or-multicast-destinaton-address"` - TimestampDropsWithBroadcastOrMulticastDestinationAddress string `xml:"timestamp-drops-with-broadcast-or-multicast-destination-address"` - MessageResponsesGenerated string `xml:"message-responses-generated"` - } `xml:"icmp"` + Icmp ICMP `xml:"icmp"` Arp ARP `xml:"arp"` Ip6 IP6 `xml:"ip6"` Icmp6 struct { @@ -452,4 +427,33 @@ type ARP struct { ArpPublicDrop float64 `xml:"arp-public-drop"` ArpIriDrop float64 `xml:"arp-iri-drop"` ArpMgtDrop float64 `xml:"arp-mgt-drop"` +} + +type ICMP struct { + Text string `xml:",chardata"` + DropsDueToRateLimit float64 `xml:"drops-due-to-rate-limit"` + CallsToIcmpError float64 `xml:"calls-to-icmp-error"` + ErrorsNotGeneratedBecauseOldMessageWasIcmp float64 `xml:"errors-not-generated-because-old-message-was-icmp"` + Histogram []ICMPInstogram `xml:"histogram"` + MessagesWithBadCodeFields float64 `xml:"messages-with-bad-code-fields"` + MessagesLessThanTheMinimumLength float64 `xml:"messages-less-than-the-minimum-length"` + MessagesWithBadChecksum float64 `xml:"messages-with-bad-checksum"` + MessagesWithBadSourceAddress float64 `xml:"messages-with-bad-source-address"` + MessagesWithBadLength float64 `xml:"messages-with-bad-length"` + EchoDropsWithBroadcastOrMulticastDestinatonAddress float64 `xml:"echo-drops-with-broadcast-or-multicast-destinaton-address"` + TimestampDropsWithBroadcastOrMulticastDestinationAddress float64 `xml:"timestamp-drops-with-broadcast-or-multicast-destination-address"` + MessageResponsesGenerated float64 `xml:"message-responses-generated"` +} + +type ICMPInstogram struct { + Text string `xml:",chardata"` + TypeOfHistogram string `xml:"type-of-histogram"` + IcmpEchoReply float64 `xml:"icmp-echo-reply"` + DestinationUnreachable float64 `xml:"destination-unreachable"` + IcmpEcho float64 `xml:"icmp-echo"` + TimeStampReply float64 `xml:"time-stamp-reply"` + TimeExceeded float64 `xml:"time-exceeded"` + TimeStamp float64 `xml:"time-stamp"` + AddressMaskRequest float64 `xml:"address-mask-request"` + AnEndpointChangedItsCookieSecret float64 `xml:"an-endpoint-changed-its-cookiesecret"` } \ No newline at end of file From db0a6eba2785fb812cc0727d5dfe15d0610bab88 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Mon, 8 Sep 2025 15:24:12 +0200 Subject: [PATCH 04/11] added tests for ICMP --- pkg/features/systemstatistics/rpc_test.go | 76 +++++++++++++++++++ .../testsFiles/ICMP/ICMPTestDataCase1.xml | 42 ++++++++++ 2 files changed, 118 insertions(+) create mode 100644 pkg/features/systemstatistics/testsFiles/ICMP/ICMPTestDataCase1.xml diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index b1a5e5e6..23fe6fc4 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -485,3 +485,79 @@ func TestStatisticsARPUnmarshaling(t *testing.T) { }) } } + +func TestStatisticsICMPUnmarshaling(t *testing.T) { + type testCase struct { + name string + xmlFile string + expect SystemStatistics + } + + tests := []testCase{ + { + name: "complete_icmp_statistics", + xmlFile: "testsFiles/ICMP/ICMPTestDataCase1.xml", + expect: SystemStatistics{ + Statistics: Statistics{ + Icmp: ICMP{ + DropsDueToRateLimit: 6000, + CallsToIcmpError: 6001, + ErrorsNotGeneratedBecauseOldMessageWasIcmp: 6002, + Histogram: []ICMPInstogram{ + { + IcmpEchoReply: 6003, + DestinationUnreachable: 6004, + IcmpEcho: 6005, + TimeStampReply: 6006, + TimeExceeded: 6007, + TimeStamp: 6008, + AddressMaskRequest: 6009, + AnEndpointChangedItsCookieSecret: 6010, + }, + { + IcmpEchoReply: 6011, + DestinationUnreachable: 6012, + IcmpEcho: 6013, + TimeStampReply: 6014, + TimeExceeded: 6015, + TimeStamp: 6016, + AddressMaskRequest: 6017, + AnEndpointChangedItsCookieSecret: 6018, + }, + }, + MessagesWithBadCodeFields: 6019, + MessagesLessThanTheMinimumLength: 6020, + MessagesWithBadChecksum: 6021, + MessagesWithBadSourceAddress: 6022, + MessagesWithBadLength: 6023, + EchoDropsWithBroadcastOrMulticastDestinatonAddress: 6024, + TimestampDropsWithBroadcastOrMulticastDestinationAddress: 6025, + MessageResponsesGenerated: 6026, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fc, err := os.ReadFile(tc.xmlFile) + if err != nil { + log.Fatal("failed to read xml file in ICMP testing due to: ", err) + } + var result SystemStatistics + err = xml.Unmarshal(fc, &result) + if err != nil { + log.Fatal("failed to unmarshal xml file in ICMP testing due to: ", err) + } + for i, _ := range result.Statistics.Icmp.Histogram { + result.Statistics.Icmp.Histogram[i].Text = "" + result.Statistics.Icmp.Histogram[i].TypeOfHistogram = "" + } + result.Statistics.Icmp.Text = "" + assert.Equal(t, tc.expect.Statistics.Icmp, result.Statistics.Icmp, tc.name) + assert.NoError(t, err, "unmarshal should not return error") + }) + } +} + diff --git a/pkg/features/systemstatistics/testsFiles/ICMP/ICMPTestDataCase1.xml b/pkg/features/systemstatistics/testsFiles/ICMP/ICMPTestDataCase1.xml new file mode 100644 index 00000000..bc435b7c --- /dev/null +++ b/pkg/features/systemstatistics/testsFiles/ICMP/ICMPTestDataCase1.xml @@ -0,0 +1,42 @@ + + + + 6000 + 6001 + 6002 + + Output Histogram + 6003 + 6004 + 6005 + 6006 + 6007 + 6008 + 6009 + 6010 + + + Output Histogram + 6011 + 6012 + 6013 + 6014 + 6015 + 6016 + 6017 + 6018 + + 6019 + 6020 + 6021 + 6022 + 6023 + 6024 + 6025 + 6026 + + + + + + From 3ace2fe5f94aab59186f8a6ddcbdaf8f0390f1f3 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Mon, 8 Sep 2025 15:29:00 +0200 Subject: [PATCH 05/11] small edit --- pkg/features/systemstatistics/rpc_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index 23fe6fc4..dd2505e6 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -492,7 +492,6 @@ func TestStatisticsICMPUnmarshaling(t *testing.T) { xmlFile string expect SystemStatistics } - tests := []testCase{ { name: "complete_icmp_statistics", @@ -559,5 +558,4 @@ func TestStatisticsICMPUnmarshaling(t *testing.T) { assert.NoError(t, err, "unmarshal should not return error") }) } -} - +} \ No newline at end of file From cf3021d040128c1cec702f97ba87876ce471bf06 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Tue, 9 Sep 2025 10:01:21 +0200 Subject: [PATCH 06/11] fixed small naming issue in ICMP and sgtarted ICMP6 --- pkg/features/systemstatistics/rpc.go | 172 +++++++++++----------- pkg/features/systemstatistics/rpc_test.go | 2 +- 2 files changed, 90 insertions(+), 84 deletions(-) diff --git a/pkg/features/systemstatistics/rpc.go b/pkg/features/systemstatistics/rpc.go index fec5cd8a..b822ec0b 100644 --- a/pkg/features/systemstatistics/rpc.go +++ b/pkg/features/systemstatistics/rpc.go @@ -26,87 +26,7 @@ type Statistics struct { Icmp ICMP `xml:"icmp"` Arp ARP `xml:"arp"` Ip6 IP6 `xml:"ip6"` - Icmp6 struct { - Text string `xml:",chardata"` - ProtocolName string `xml:"protocol-name"` - CallsToIcmp6Error string `xml:"calls-to-icmp6-error"` - ErrorsNotGeneratedBecauseOldMessageWasIcmpError string `xml:"errors-not-generated-because-old-message-was-icmp-error"` - ErrorsNotGeneratedBecauseRateLimitation string `xml:"errors-not-generated-because-rate-limitation"` - OutputHistogram struct { - Text string `xml:",chardata"` - Style string `xml:"style,attr"` - HistogramType string `xml:"histogram-type"` - UnreachableIcmp6Packets string `xml:"unreachable-icmp6-packets"` - Icmp6Echo string `xml:"icmp6-echo"` - Icmp6EchoReply string `xml:"icmp6-echo-reply"` - NeighborSolicitation string `xml:"neighbor-solicitation"` - NeighborAdvertisement string `xml:"neighbor-advertisement"` - } `xml:"output-histogram"` - Icmp6MessagesWithBadCodeFields string `xml:"icmp6-messages-with-bad-code-fields"` - MessagesLessThanMinimumLength string `xml:"messages-less-than-minimum-length"` - BadChecksums string `xml:"bad-checksums"` - Icmp6MessagesWithBadLength string `xml:"icmp6-messages-with-bad-length"` - InputHistogram struct { - Text string `xml:",chardata"` - Style string `xml:"style,attr"` - HistogramType string `xml:"histogram-type"` - UnreachableIcmp6Packets string `xml:"unreachable-icmp6-packets"` - PacketTooBig string `xml:"packet-too-big"` - TimeExceededIcmp6Packets string `xml:"time-exceeded-icmp6-packets"` - Icmp6Echo string `xml:"icmp6-echo"` - Icmp6EchoReply string `xml:"icmp6-echo-reply"` - RouterSolicitationIcmp6Packets string `xml:"router-solicitation-icmp6-packets"` - NeighborSolicitation string `xml:"neighbor-solicitation"` - NeighborAdvertisement string `xml:"neighbor-advertisement"` - } `xml:"input-histogram"` - HistogramOfErrorMessagesToBeGenerated string `xml:"histogram-of-error-messages-to-be-generated"` - NoRoute string `xml:"no-route"` - AdministrativelyProhibited string `xml:"administratively-prohibited"` - BeyondScope string `xml:"beyond-scope"` - AddressUnreachable string `xml:"address-unreachable"` - PortUnreachable string `xml:"port-unreachable"` - PacketTooBig string `xml:"packet-too-big"` - TimeExceedTransit string `xml:"time-exceed-transit"` - TimeExceedReassembly string `xml:"time-exceed-reassembly"` - ErroneousHeaderField string `xml:"erroneous-header-field"` - UnrecognizedNextHeader string `xml:"unrecognized-next-header"` - UnrecognizedOption string `xml:"unrecognized-option"` - Redirect string `xml:"redirect"` - Unknown string `xml:"unknown"` - Icmp6MessageResponsesGenerated string `xml:"icmp6-message-responses-generated"` - MessagesWithTooManyNdOptions string `xml:"messages-with-too-many-nd-options"` - NdSystemMax string `xml:"nd-system-max"` - NdPublicMax string `xml:"nd-public-max"` - NdIriMax string `xml:"nd-iri-max"` - NdMgtMax string `xml:"nd-mgt-max"` - NdPublicCnt string `xml:"nd-public-cnt"` - NdIriCnt string `xml:"nd-iri-cnt"` - NdMgtCnt string `xml:"nd-mgt-cnt"` - NdSystemDrop string `xml:"nd-system-drop"` - NdPublicDrop string `xml:"nd-public-drop"` - NdIriDrop string `xml:"nd-iri-drop"` - NdMgtDrop string `xml:"nd-mgt-drop"` - Nd6NdpProxyRequests string `xml:"nd6-ndp-proxy-requests"` - Nd6DadProxyRequests string `xml:"nd6-dad-proxy-requests"` - Nd6NdpProxyResponses string `xml:"nd6-ndp-proxy-responses"` - Nd6DadProxyConflicts string `xml:"nd6-dad-proxy-conflicts"` - Nd6DupProxyResponses string `xml:"nd6-dup-proxy-responses"` - Nd6NdpProxyResolveCnt string `xml:"nd6-ndp-proxy-resolve-cnt"` - Nd6DadProxyResolveCnt string `xml:"nd6-dad-proxy-resolve-cnt"` - Nd6DadProxyEqmacDrop string `xml:"nd6-dad-proxy-eqmac-drop"` - Nd6DadProxyNomacDrop string `xml:"nd6-dad-proxy-nomac-drop"` - Nd6NdpProxyUnrRequests string `xml:"nd6-ndp-proxy-unr-requests"` - Nd6DadProxyUnrRequests string `xml:"nd6-dad-proxy-unr-requests"` - Nd6NdpProxyUnrResponses string `xml:"nd6-ndp-proxy-unr-responses"` - Nd6DadProxyUnrConflicts string `xml:"nd6-dad-proxy-unr-conflicts"` - Nd6DadProxyUnrResponses string `xml:"nd6-dad-proxy-unr-responses"` - Nd6NdpProxyUnrResolveCnt string `xml:"nd6-ndp-proxy-unr-resolve-cnt"` - Nd6DadProxyUnrResolveCnt string `xml:"nd6-dad-proxy-unr-resolve-cnt"` - Nd6DadProxyUnrEqportDrop string `xml:"nd6-dad-proxy-unr-eqport-drop"` - Nd6DadProxyUnrNomacDrop string `xml:"nd6-dad-proxy-unr-nomac-drop"` - Nd6RequestsDroppedOnEntry string `xml:"nd6-requests-dropped-on-entry"` - Nd6RequestsDroppedDuringRetry string `xml:"nd6-requests-dropped-during-retry"` - } `xml:"icmp6"` + Icmp6 ICMP6`xml:"icmp6"` Mpls struct { Text string `xml:",chardata"` TotalMplsPacketsReceived string `xml:"total-mpls-packets-received"` @@ -434,7 +354,7 @@ type ICMP struct { DropsDueToRateLimit float64 `xml:"drops-due-to-rate-limit"` CallsToIcmpError float64 `xml:"calls-to-icmp-error"` ErrorsNotGeneratedBecauseOldMessageWasIcmp float64 `xml:"errors-not-generated-because-old-message-was-icmp"` - Histogram []ICMPInstogram `xml:"histogram"` + Histogram []ICMPHistogram `xml:"histogram"` MessagesWithBadCodeFields float64 `xml:"messages-with-bad-code-fields"` MessagesLessThanTheMinimumLength float64 `xml:"messages-less-than-the-minimum-length"` MessagesWithBadChecksum float64 `xml:"messages-with-bad-checksum"` @@ -445,7 +365,7 @@ type ICMP struct { MessageResponsesGenerated float64 `xml:"message-responses-generated"` } -type ICMPInstogram struct { +type ICMPHistogram struct { Text string `xml:",chardata"` TypeOfHistogram string `xml:"type-of-histogram"` IcmpEchoReply float64 `xml:"icmp-echo-reply"` @@ -456,4 +376,90 @@ type ICMPInstogram struct { TimeStamp float64 `xml:"time-stamp"` AddressMaskRequest float64 `xml:"address-mask-request"` AnEndpointChangedItsCookieSecret float64 `xml:"an-endpoint-changed-its-cookiesecret"` +} + +type ICMP6 struct { + Text string `xml:",chardata"` + ProtocolName string `xml:"protocol-name"` + CallsToIcmp6Error float64 `xml:"calls-to-icmp6-error"` + ErrorsNotGeneratedBecauseOldMessageWasIcmpError float64 `xml:"errors-not-generated-because-old-message-was-icmp-error"` + ErrorsNotGeneratedBecauseRateLimitation float64 `xml:"errors-not-generated-because-rate-limitation"` + OutputHistogram ICMP6OutputHistogram `xml:"output-histogram"` + Icmp6MessagesWithBadCodeFields float64 `xml:"icmp6-messages-with-bad-code-fields"` + MessagesLessThanMinimumLength float64 `xml:"messages-less-than-minimum-length"` + BadChecksums float64 `xml:"bad-checksums"` + Icmp6MessagesWithBadLength float64 `xml:"icmp6-messages-with-bad-length"` + InputHistogram ICMP6InputHistogram `xml:"input-histogram"` + HistogramOfErrorMessagesToBeGenerated float64 `xml:"histogram-of-error-messages-to-be-generated"` + NoRoute float64 `xml:"no-route"` + AdministrativelyProhibited float64 `xml:"administratively-prohibited"` + BeyondScope float64 `xml:"beyond-scope"` + AddressUnreachable float64 `xml:"address-unreachable"` + PortUnreachable float64 `xml:"port-unreachable"` + PacketTooBig float64 `xml:"packet-too-big"` + TimeExceedTransit float64 `xml:"time-exceed-transit"` + TimeExceedReassembly float64 `xml:"time-exceed-reassembly"` + ErroneousHeaderField float64 `xml:"erroneous-header-field"` + UnrecognizedNextHeader float64 `xml:"unrecognized-next-header"` + UnrecognizedOption float64 `xml:"unrecognized-option"` + Redirect float64 `xml:"redirect"` + Unknown float64 `xml:"unknown"` + Icmp6MessageResponsesGenerated float64 `xml:"icmp6-message-responses-generated"` + MessagesWithTooManyNdOptions float64 `xml:"messages-with-too-many-nd-options"` + NdSystemMax float64 `xml:"nd-system-max"` + NdPublicMax float64 `xml:"nd-public-max"` + NdIriMax float64 `xml:"nd-iri-max"` + NdMgtMax float64 `xml:"nd-mgt-max"` + NdPublicCnt float64 `xml:"nd-public-cnt"` + NdIriCnt float64 `xml:"nd-iri-cnt"` + NdMgtCnt float64 `xml:"nd-mgt-cnt"` + NdSystemDrop float64 `xml:"nd-system-drop"` + NdPublicDrop float64 `xml:"nd-public-drop"` + NdIriDrop float64 `xml:"nd-iri-drop"` + NdMgtDrop float64 `xml:"nd-mgt-drop"` + Nd6NdpProxyRequests float64 `xml:"nd6-ndp-proxy-requests"` + Nd6DadProxyRequests float64 `xml:"nd6-dad-proxy-requests"` + Nd6NdpProxyResponses float64 `xml:"nd6-ndp-proxy-responses"` + Nd6DadProxyConflicts float64 `xml:"nd6-dad-proxy-conflicts"` + Nd6DupProxyResponses float64 `xml:"nd6-dup-proxy-responses"` + Nd6NdpProxyResolveCnt float64 `xml:"nd6-ndp-proxy-resolve-cnt"` + Nd6DadProxyResolveCnt float64 `xml:"nd6-dad-proxy-resolve-cnt"` + Nd6DadProxyEqmacDrop float64 `xml:"nd6-dad-proxy-eqmac-drop"` + Nd6DadProxyNomacDrop float64 `xml:"nd6-dad-proxy-nomac-drop"` + Nd6NdpProxyUnrRequests float64 `xml:"nd6-ndp-proxy-unr-requests"` + Nd6DadProxyUnrRequests float64 `xml:"nd6-dad-proxy-unr-requests"` + Nd6NdpProxyUnrResponses float64 `xml:"nd6-ndp-proxy-unr-responses"` + Nd6DadProxyUnrConflicts float64 `xml:"nd6-dad-proxy-unr-conflicts"` + Nd6DadProxyUnrResponses float64 `xml:"nd6-dad-proxy-unr-responses"` + Nd6NdpProxyUnrResolveCnt float64 `xml:"nd6-ndp-proxy-unr-resolve-cnt"` + Nd6DadProxyUnrResolveCnt float64 `xml:"nd6-dad-proxy-unr-resolve-cnt"` + Nd6DadProxyUnrEqportDrop float64 `xml:"nd6-dad-proxy-unr-eqport-drop"` + Nd6DadProxyUnrNomacDrop float64 `xml:"nd6-dad-proxy-unr-nomac-drop"` + Nd6RequestsDroppedOnEntry float64 `xml:"nd6-requests-dropped-on-entry"` + Nd6RequestsDroppedDuringRetry float64 `xml:"nd6-requests-dropped-during-retry"` +} + +type ICMP6OutputHistogram struct { + Text string `xml:",chardata"` + Style string `xml:"style,attr"` + HistogramType string `xml:"histogram-type"` + UnreachableIcmp6Packets float64 `xml:"unreachable-icmp6-packets"` + Icmp6Echo float64 `xml:"icmp6-echo"` + Icmp6EchoReply float64 `xml:"icmp6-echo-reply"` + NeighborSolicitation float64 `xml:"neighbor-solicitation"` + NeighborAdvertisement float64 `xml:"neighbor-advertisement"` +} + +type ICMP6InputHistogram struct { + Text string `xml:",chardata"` + Style string `xml:"style,attr"` + HistogramType string `xml:"histogram-type"` + UnreachableIcmp6Packets float64 `xml:"unreachable-icmp6-packets"` + PacketTooBig float64 `xml:"packet-too-big"` + TimeExceededIcmp6Packets float64 `xml:"time-exceeded-icmp6-packets"` + Icmp6Echo float64 `xml:"icmp6-echo"` + Icmp6EchoReply float64 `xml:"icmp6-echo-reply"` + RouterSolicitationIcmp6Packets float64 `xml:"router-solicitation-icmp6-packets"` + NeighborSolicitation float64 `xml:"neighbor-solicitation"` + NeighborAdvertisement float64 `xml:"neighbor-advertisement"` } \ No newline at end of file diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index dd2505e6..2c771c24 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -502,7 +502,7 @@ func TestStatisticsICMPUnmarshaling(t *testing.T) { DropsDueToRateLimit: 6000, CallsToIcmpError: 6001, ErrorsNotGeneratedBecauseOldMessageWasIcmp: 6002, - Histogram: []ICMPInstogram{ + Histogram: []ICMPHistogram{ { IcmpEchoReply: 6003, DestinationUnreachable: 6004, From 046a88cb9899cf3d5522b7ba5a88101a35bff912 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Wed, 10 Sep 2025 13:06:54 +0200 Subject: [PATCH 07/11] finished icmp6 but without tests --- pkg/features/systemstatistics/collector.go | 280 +++++++++++++++++++++ pkg/features/systemstatistics/rpc.go | 2 +- 2 files changed, 281 insertions(+), 1 deletion(-) diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index cb9ba788..b454b855 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -304,6 +304,73 @@ var ( icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc *prometheus.Desc icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc *prometheus.Desc icmpMessageResponsesGeneratedDesc *prometheus.Desc + + icmp6CallsToIcmp6ErrorDesc *prometheus.Desc + icmp6ErrorsNotGeneratedBecauseOldMessageWasIcmpErrorDesc *prometheus.Desc + icmp6ErrorsNotGeneratedBecauseRateLimitationDesc *prometheus.Desc + icmp6UnreachableIcmp6PacketsOutputHistoDesc *prometheus.Desc + icmp6Icmp6EchoOutputHistoDesc *prometheus.Desc + icmp6Icmp6EchoReplyOutputHistoDesc *prometheus.Desc + icmp6NeighborSolicitationOutputHistoDesc *prometheus.Desc + icmp6NeighborAdvertisementOutputHistoDesc *prometheus.Desc + icmp6Icmp6MessagesWithBadCodeFieldsDesc *prometheus.Desc + icmp6MessagesLessThanMinimumLengthDesc *prometheus.Desc + icmp6BadChecksumsDesc *prometheus.Desc + icmp6Icmp6MessagesWithBadLengthDesc *prometheus.Desc + icmp6UnreachableIcmp6PacketInputHistosDesc *prometheus.Desc + icmp6PacketTooBigInputHistoDesc *prometheus.Desc + icmp6TimeExceededIcmp6PacketsInputHistoDesc *prometheus.Desc + icmp6Icmp6EchoInputHistoDesc *prometheus.Desc + icmp6Icmp6EchoReplyInputHistoDesc *prometheus.Desc + icmp6RouterSolicitationIcmp6PacketsInputHistoDesc *prometheus.Desc + icmp6NeighborSolicitationInputHistoDesc *prometheus.Desc + icmp6NeighborAdvertisementInputHistoDesc *prometheus.Desc + icmp6NoRouteDesc *prometheus.Desc + icmp6AdministrativelyProhibitedDesc *prometheus.Desc + icmp6BeyondScopeDesc *prometheus.Desc + icmp6AddressUnreachableDesc *prometheus.Desc + icmp6PortUnreachableDesc *prometheus.Desc + icmp6PacketTooBigDesc *prometheus.Desc + icmp6TimeExceedTransitDesc *prometheus.Desc + icmp6TimeExceedReassemblyDesc *prometheus.Desc + icmp6ErroneousHeaderFieldDesc *prometheus.Desc + icmp6UnrecognizedNextHeaderDesc *prometheus.Desc + icmp6UnrecognizedOptionDesc *prometheus.Desc + icmp6RedirectDesc *prometheus.Desc + icmp6UnknownDesc *prometheus.Desc + icmp6Icmp6MessageResponsesGeneratedDesc *prometheus.Desc + icmp6MessagesWithTooManyNdOptionsDesc *prometheus.Desc + icmp6NdSystemMaxDesc *prometheus.Desc + icmp6NdPublicMaxDesc *prometheus.Desc + icmp6NdIriMaxDesc *prometheus.Desc + icmp6NdMgtMaxDesc *prometheus.Desc + icmp6NdPublicCntDesc *prometheus.Desc + icmp6NdIriCntDesc *prometheus.Desc + icmp6NdMgtCntDesc *prometheus.Desc + icmp6NdSystemDropDesc *prometheus.Desc + icmp6NdPublicDropDesc *prometheus.Desc + icmp6NdIriDropDesc *prometheus.Desc + icmp6NdMgtDropDesc *prometheus.Desc + icmp6Nd6NdpProxyRequestsDesc *prometheus.Desc + icmp6Nd6DadProxyRequestsDesc *prometheus.Desc + icmp6Nd6NdpProxyResponsesDesc *prometheus.Desc + icmp6Nd6DadProxyConflictsDesc *prometheus.Desc + icmp6Nd6DupProxyResponsesDesc *prometheus.Desc + icmp6Nd6NdpProxyResolveCntDesc *prometheus.Desc + icmp6Nd6DadProxyResolveCntDesc *prometheus.Desc + icmp6Nd6DadProxyEqmacDropDesc *prometheus.Desc + icmp6Nd6DadProxyNomacDropDesc *prometheus.Desc + icmp6Nd6NdpProxyUnrRequestsDesc *prometheus.Desc + icmp6Nd6DadProxyUnrRequestsDesc *prometheus.Desc + icmp6Nd6NdpProxyUnrResponsesDesc *prometheus.Desc + icmp6Nd6DadProxyUnrConflictsDesc *prometheus.Desc + icmp6Nd6DadProxyUnrResponsesDesc *prometheus.Desc + icmp6Nd6NdpProxyUnrResolveCntDesc *prometheus.Desc + icmp6Nd6DadProxyUnrResolveCntDesc *prometheus.Desc + icmp6Nd6DadProxyUnrEqportDropDesc *prometheus.Desc + icmp6Nd6DadProxyUnrNomacDropDesc *prometheus.Desc + icmp6Nd6RequestsDroppedOnEntryDesc *prometheus.Desc + icmp6Nd6RequestsDroppedDuringRetryDesc *prometheus.Desc ) func init() { @@ -610,6 +677,75 @@ func init() { icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc = prometheus.NewDesc(prefix+"icmp_echo_drops_with_broadcast_or_multicast_destination_address", "Number of icmp echo drops with broadcast or multicast destination address", labelsICMP, nil) icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc = prometheus.NewDesc(prefix+"icmp_timestamp_drops_with_broadcast_or_multicast_destination_address", "Number of icmp timestamp drops with broadcast or multicast destination address", labelsICMP, nil) icmpMessageResponsesGeneratedDesc = prometheus.NewDesc(prefix+"icmp_message_responses_generated", "Number of icmp message responses generated", labelsICMP, nil) + + labelsICMP6 := []string{"target", "protocol"} + icmp6CallsToIcmp6ErrorDesc = prometheus.NewDesc(prefix+"icmp6_calles_to_icmp6_error", "Number of icmp6 calls to icmp6 error", labelsICMP6, nil) + icmp6ErrorsNotGeneratedBecauseOldMessageWasIcmpErrorDesc = prometheus.NewDesc(prefix+"icmp6_errors_not_generated_because_old_message_was_icmp_error", "Number of icmp6 errors not generated because old message was icmp error", labelsICMP6, nil) + icmp6ErrorsNotGeneratedBecauseRateLimitationDesc = prometheus.NewDesc(prefix+"icmp6_errors_not_generated_because_rate_limitation", "Number of icmp6 errors not generated becasue of rate limition", labelsICMP6, nil) + labelsICMP6Histogram := []string{"target", "protocol", "histogram_type"} + icmp6UnreachableIcmp6PacketsOutputHistoDesc = prometheus.NewDesc(prefix+"icmp6_unreachable_icmp6_packets", "Number of icmp6 unreachable icmp6 packets", labelsICMP6Histogram, nil) + icmp6Icmp6EchoOutputHistoDesc = prometheus.NewDesc(prefix+"icmp6_icmp6_echo", "Number of icmp6 echos", labelsICMP6Histogram, nil) + icmp6Icmp6EchoReplyOutputHistoDesc = prometheus.NewDesc(prefix+"icmp6_icmp6_echo_reply", "Number of icmp6 echo replies", labelsICMP6Histogram, nil) + icmp6NeighborSolicitationOutputHistoDesc = prometheus.NewDesc(prefix+"icmp6_neighbor_solicitation", "Number of icmp6 neighbor solicitation", labelsICMP6Histogram, nil) + icmp6NeighborAdvertisementOutputHistoDesc = prometheus.NewDesc(prefix+"icmp6_neighbor_advertisement", "Number of icmp6 neighbor advertisement", labelsICMP6Histogram, nil) + icmp6Icmp6MessagesWithBadCodeFieldsDesc = prometheus.NewDesc(prefix+"icmp6_messages_with_bad_code_fields", "Number of icmp6 messages with bad code fields", labelsICMP6, nil) + icmp6MessagesLessThanMinimumLengthDesc = prometheus.NewDesc(prefix+"icmp6_messages_less_than_minimum_length", "Number of icmp6 messages less than minimum length", labelsICMP6, nil) + icmp6BadChecksumsDesc = prometheus.NewDesc(prefix+"icmp6_bad_checksums", "Number of icmp6 bad checksums", labelsICMP6, nil) + icmp6Icmp6MessagesWithBadLengthDesc = prometheus.NewDesc(prefix+"icmp6_messages_with_bad_length", "Number of icmp6 messages with bad length", labelsICMP6, nil) + icmp6UnreachableIcmp6PacketInputHistosDesc = prometheus.NewDesc(prefix+"icmp6_unreachable_icmp6_packet_input_histogram", "Number of icmp6 unreachable icmp6 packets input histogram", labelsICMP6Histogram, nil) + icmp6PacketTooBigInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_packet_too_big_input_histogram", "Number of icmp6 packets too big input histogram", labelsICMP6Histogram, nil) + icmp6TimeExceededIcmp6PacketsInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_time_exceeded_icmp6_packets_input_histogram", "Number of icmp6 time exceeded packets input histogram", labelsICMP6Histogram, nil) + icmp6Icmp6EchoInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_icmp6_echo_input_histogram", "Number of icmp6 echos input histogram", labelsICMP6Histogram, nil) + icmp6Icmp6EchoReplyInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_echo_reply_input_histogram", "Number of icmp6 echo replies input histogram", labelsICMP6Histogram, nil) + icmp6RouterSolicitationIcmp6PacketsInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_router_solicitation_icmp6_packets_input_histogram", "Number of icmp6 router solicitation packets input histogram", labelsICMP6Histogram, nil) + icmp6NeighborSolicitationInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_neighbor_solicitation_input_histogram", "Number of icmp6 neighbor solicitation packets input histogram", labelsICMP6Histogram, nil) + icmp6NeighborAdvertisementInputHistoDesc = prometheus.NewDesc(prefix+"icmp6_neighbor_advertisement_input_histogram", "Number of icmp6 neighbor advertisement packets input histogram", labelsICMP6Histogram, nil) + icmp6NoRouteDesc = prometheus.NewDesc(prefix+"icmp6_no_route", "Number ofr icmp6 without route", labelsICMP6, nil) + icmp6AdministrativelyProhibitedDesc = prometheus.NewDesc(prefix+"icmp6_administratively_prohibited", "Number of icmp6 adiminiostratively prohibited", labelsICMP6, nil) + icmp6BeyondScopeDesc = prometheus.NewDesc(prefix+"icmp6_beyond_scope", "Number of icmp6 beyond scope", labelsICMP6, nil) + icmp6AddressUnreachableDesc = prometheus.NewDesc(prefix+"icmp6_address_unreachable", "Number of icmp6 address unreachable", labelsICMP6, nil) + icmp6PortUnreachableDesc = prometheus.NewDesc(prefix+"icmp6_port_unreachable", "Number of icmp6 port unreachable", labelsICMP6, nil) + icmp6PacketTooBigDesc = prometheus.NewDesc(prefix+"icmp6_packet_too_big", "Number of ICMP6 packets that are too big", labelsICMP6, nil) + icmp6TimeExceedTransitDesc = prometheus.NewDesc(prefix+"icmp6_time_exceed_transit", "Number of icmp6 packets whose time exceed transit", labelsICMP6, nil) + icmp6TimeExceedReassemblyDesc = prometheus.NewDesc(prefix+"icmp6_time_exceed_reassembly", "Number of icmp6 packets whose time exceed reassembly", labelsICMP6, nil) + icmp6ErroneousHeaderFieldDesc = prometheus.NewDesc(prefix+"icmp6_errors_on_header_file", "Number of icmp6 with errors on header file", labelsICMP6, nil) + icmp6UnrecognizedNextHeaderDesc = prometheus.NewDesc(prefix+"icmp6_unrecognized_next_header", "Number of icmp6 with unrecognized next header", labelsICMP6, nil) + icmp6UnrecognizedOptionDesc = prometheus.NewDesc(prefix+"icmp6_unrecognized_option", "Number of icmp6 with unrecognized option", labelsICMP6, nil) + icmp6RedirectDesc = prometheus.NewDesc(prefix+"icmp6_redirect", "Number of icmp6 redirect", labelsICMP6, nil) + icmp6UnknownDesc = prometheus.NewDesc(prefix+"icmp6_unknown", "Number of icmp6 unknown", labelsICMP6, nil) + icmp6Icmp6MessageResponsesGeneratedDesc = prometheus.NewDesc(prefix+"icmp6_message_responses_generated", "Number of icmp6 message responses generated", labelsICMP6, nil) + icmp6MessagesWithTooManyNdOptionsDesc = prometheus.NewDesc(prefix+"icmp6_message_with_to_many_nd_options", "Number of icmp6 messages with too many nd options", labelsICMP6, nil) + icmp6NdSystemMaxDesc = prometheus.NewDesc(prefix+"icmp6_nd_system_max", "Number of icmp6 nd system max", labelsICMP6, nil) + icmp6NdPublicMaxDesc = prometheus.NewDesc(prefix+"icmp6_nd_public_max", "Number of icmp6 nd public max", labelsICMP6, nil) + icmp6NdIriMaxDesc = prometheus.NewDesc(prefix+"icmp6_nd_iri_max", "Number of icmp6 nd iri max", labelsICMP6, nil) + icmp6NdMgtMaxDesc = prometheus.NewDesc(prefix+"icmp6_nd_mgt_max", "Number of icmp6 nd mgt max", labelsICMP6, nil) + icmp6NdPublicCntDesc = prometheus.NewDesc(prefix+"icmp6_nd_public_cnt", "Number of icmp6 nd public cnt", labelsICMP6, nil) + icmp6NdIriCntDesc = prometheus.NewDesc(prefix+"icmp6_nd_iri_cnt", "Number of icmp6 nd iri cnt", labelsICMP6, nil) + icmp6NdMgtCntDesc = prometheus.NewDesc(prefix+"icmp6_nd_mgt_cnt", "Number of icmp6 nt mgt cnt", labelsICMP6, nil) + icmp6NdSystemDropDesc = prometheus.NewDesc(prefix+"icmp6_nd_system_drop", "Number of icmp6 nd system drop", labelsICMP6, nil) + icmp6NdPublicDropDesc = prometheus.NewDesc(prefix+"icmp6_nd_public_drop", "Number of icmp6 nd public drop", labelsICMP6, nil) + icmp6NdIriDropDesc = prometheus.NewDesc(prefix+"icmp6_nd_iri_drop", "Number of icmp6 nd iri drops", labelsICMP6, nil) + icmp6NdMgtDropDesc = prometheus.NewDesc(prefix+"icmp6_nd_mgt_drop", "Number of icmp6 nd mgt drop", labelsICMP6, nil) + icmp6Nd6NdpProxyRequestsDesc = prometheus.NewDesc(prefix+"icmp6_ndp_proxy_requests", "Number of icmp6 ndp proxy requests", labelsICMP6, nil) + icmp6Nd6DadProxyRequestsDesc = prometheus.NewDesc(prefix+"icmp6_nd_dad_proxy_requests", "Number of icmp6 nd dad proxy requests", labelsICMP6, nil) + icmp6Nd6NdpProxyResponsesDesc = prometheus.NewDesc(prefix+"icmp6_nd6_ndp_proxy_responses", "Number of icmp6 ndp proxy responses", labelsICMP6, nil) + icmp6Nd6DadProxyConflictsDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_conflicts", "Number of icmp6 nd6 dad proxy conflicts", labelsICMP6, nil) + icmp6Nd6DupProxyResponsesDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dup_proxy_response", "Number of icmp6 nd6 dup proxy responses", labelsICMP6, nil) + icmp6Nd6NdpProxyResolveCntDesc = prometheus.NewDesc(prefix+"icmp6_nd6_ndp_proxy_resolve_cnt", "Number of icmp6 nd6 ndp proxy resolve cnt", labelsICMP6, nil) + icmp6Nd6DadProxyResolveCntDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_resolve", "Number of icmp nd6 dad proxy resolve", labelsICMP6, nil) + icmp6Nd6DadProxyEqmacDropDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_eqmac_drop", "Number of icmp6 nd6 dad proxy eqmac drop", labelsICMP6, nil) + icmp6Nd6DadProxyNomacDropDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_nomac_drop", "Number of icmp6 nd6 dad proxy nomac drop", labelsICMP6, nil) + icmp6Nd6NdpProxyUnrRequestsDesc = prometheus.NewDesc(prefix+"icmp6_nd6_ndp_proxy_unr_requests", "Number of icmp6 nd6 ndp proxy unr requests", labelsICMP6, nil) + icmp6Nd6DadProxyUnrRequestsDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_requests", "Number of icmp6 nd6 dad proxy unr requests", labelsICMP6, nil) + icmp6Nd6NdpProxyUnrResponsesDesc = prometheus.NewDesc(prefix+"icmp6_nd6_ndp_proxy_unr_responses", "Number of icmp6 nd6 ndp proxy unr responses", labelsICMP6, nil) + icmp6Nd6DadProxyUnrConflictsDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_conflicts", "Number of icmp6 nd6 dad proxy unr conflicts", labelsICMP6, nil) + icmp6Nd6DadProxyUnrResponsesDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_responses", "Number of icmp6 nd6 dad proxy unr responses", labelsICMP6, nil) + icmp6Nd6NdpProxyUnrResolveCntDesc = prometheus.NewDesc(prefix+"icmp6_nd6_ndp_proxy_unr_resolve_cnt", "Number of icmp6 nd6 ndp proxy unr resolve cnt", labelsICMP6, nil) + icmp6Nd6DadProxyUnrResolveCntDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_resolve_cnt", "Number of icmp6 nd6 dad proxy unr resolve cnt", labelsICMP6, nil) + icmp6Nd6DadProxyUnrEqportDropDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_eqport_drop", "Number of icmp6 nd6 dad proxy unr eqport drop", labelsICMP6, nil) + icmp6Nd6DadProxyUnrNomacDropDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_nomac_droop", "Number of icmp6 nd6 dad proxy unr nomac drop", labelsICMP6, nil) + icmp6Nd6RequestsDroppedOnEntryDesc = prometheus.NewDesc(prefix+"icmp6_nd6_requests_dropped_on_entry", "Number of icmp6 nd6 requests dropped on entry", labelsICMP6, nil) + icmp6Nd6RequestsDroppedDuringRetryDesc = prometheus.NewDesc(prefix+"icmp6_nd6_requests_dropped_during_retry", "Number of icmp6 nd6 requests dropped during retry", labelsICMP6, nil) } type systemstatisticsCollector struct{} @@ -917,6 +1053,72 @@ func (c *systemstatisticsCollector) Describe(ch chan<- *prometheus.Desc) { ch <- icmpEchoDropsWithBroadcastOrMulticastDestinatonAddressDesc ch <- icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc ch <- icmpMessageResponsesGeneratedDesc + ch <- icmp6CallsToIcmp6ErrorDesc + ch <- icmp6ErrorsNotGeneratedBecauseOldMessageWasIcmpErrorDesc + ch <- icmp6ErrorsNotGeneratedBecauseRateLimitationDesc + ch <- icmp6UnreachableIcmp6PacketsOutputHistoDesc + ch <- icmp6Icmp6EchoOutputHistoDesc + ch <- icmp6Icmp6EchoReplyOutputHistoDesc + ch <- icmp6NeighborSolicitationOutputHistoDesc + ch <- icmp6NeighborAdvertisementOutputHistoDesc + ch <- icmp6Icmp6MessagesWithBadCodeFieldsDesc + ch <- icmp6MessagesLessThanMinimumLengthDesc + ch <- icmp6BadChecksumsDesc + ch <- icmp6Icmp6MessagesWithBadLengthDesc + ch <- icmp6UnreachableIcmp6PacketInputHistosDesc + ch <- icmp6PacketTooBigInputHistoDesc + ch <- icmp6TimeExceededIcmp6PacketsInputHistoDesc + ch <- icmp6Icmp6EchoInputHistoDesc + ch <- icmp6Icmp6EchoReplyInputHistoDesc + ch <- icmp6RouterSolicitationIcmp6PacketsInputHistoDesc + ch <- icmp6NeighborSolicitationInputHistoDesc + ch <- icmp6NeighborAdvertisementInputHistoDesc + ch <- icmp6NoRouteDesc + ch <- icmp6AdministrativelyProhibitedDesc + ch <- icmp6BeyondScopeDesc + ch <- icmp6AddressUnreachableDesc + ch <- icmp6PortUnreachableDesc + ch <- icmp6PacketTooBigDesc + ch <- icmp6TimeExceedTransitDesc + ch <- icmp6TimeExceedReassemblyDesc + ch <- icmp6ErroneousHeaderFieldDesc + ch <- icmp6UnrecognizedNextHeaderDesc + ch <- icmp6UnrecognizedOptionDesc + ch <- icmp6RedirectDesc + ch <- icmp6UnknownDesc + ch <- icmp6Icmp6MessageResponsesGeneratedDesc + ch <- icmp6MessagesWithTooManyNdOptionsDesc + ch <- icmp6NdSystemMaxDesc + ch <- icmp6NdPublicMaxDesc + ch <- icmp6NdIriMaxDesc + ch <- icmp6NdMgtMaxDesc + ch <- icmp6NdPublicCntDesc + ch <- icmp6NdIriCntDesc + ch <- icmp6NdMgtCntDesc + ch <- icmp6NdSystemDropDesc + ch <- icmp6NdPublicDropDesc + ch <- icmp6NdIriDropDesc + ch <- icmp6NdMgtDropDesc + ch <- icmp6Nd6NdpProxyRequestsDesc + ch <- icmp6Nd6DadProxyRequestsDesc + ch <- icmp6Nd6NdpProxyResponsesDesc + ch <- icmp6Nd6DadProxyConflictsDesc + ch <- icmp6Nd6DupProxyResponsesDesc + ch <- icmp6Nd6NdpProxyResolveCntDesc + ch <- icmp6Nd6DadProxyResolveCntDesc + ch <- icmp6Nd6DadProxyEqmacDropDesc + ch <- icmp6Nd6DadProxyNomacDropDesc + ch <- icmp6Nd6NdpProxyUnrRequestsDesc + ch <- icmp6Nd6DadProxyUnrRequestsDesc + ch <- icmp6Nd6NdpProxyUnrResponsesDesc + ch <- icmp6Nd6DadProxyUnrConflictsDesc + ch <- icmp6Nd6DadProxyUnrResponsesDesc + ch <- icmp6Nd6NdpProxyUnrResolveCntDesc + ch <- icmp6Nd6DadProxyUnrResolveCntDesc + ch <- icmp6Nd6DadProxyUnrEqportDropDesc + ch <- icmp6Nd6DadProxyUnrNomacDropDesc + ch <- icmp6Nd6RequestsDroppedOnEntryDesc + ch <- icmp6Nd6RequestsDroppedDuringRetryDesc } func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { @@ -951,6 +1153,11 @@ func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- p return err } c.collectSystemStatisticsICMP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics icmp6", &s) + if err != nil { + return err + } + c.collectSystemStatisticsICMP6(ch, labelValues, s) return nil } @@ -1272,3 +1479,76 @@ func (c *systemstatisticsCollector) collectSystemStatisticsICMP(ch chan<- promet ch <- prometheus.MustNewConstMetric(icmpTimestampDropsWithBroadcastOrMulticastDestinationAddressDesc, prometheus.CounterValue, s.Statistics.Icmp.TimestampDropsWithBroadcastOrMulticastDestinationAddress, labels...) ch <- prometheus.MustNewConstMetric(icmpMessageResponsesGeneratedDesc, prometheus.CounterValue, s.Statistics.Icmp.MessageResponsesGenerated, labels...) } + +func (c *systemstatisticsCollector) collectSystemStatisticsICMP6(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { + labels := append(labelValues, "ICMP6") + ch <- prometheus.MustNewConstMetric(icmp6CallsToIcmp6ErrorDesc, prometheus.CounterValue, s.Statistics.Icmp6.CallsToIcmp6Error, labels...) + ch <- prometheus.MustNewConstMetric(icmp6ErrorsNotGeneratedBecauseOldMessageWasIcmpErrorDesc, prometheus.CounterValue, s.Statistics.Icmp6.ErrorsNotGeneratedBecauseOldMessageWasIcmpError, labels...) + ch <- prometheus.MustNewConstMetric(icmp6ErrorsNotGeneratedBecauseRateLimitationDesc, prometheus.CounterValue, s.Statistics.Icmp6.ErrorsNotGeneratedBecauseRateLimitation, labels...) + labels = append(labels, "Output Histogram") + ch <- prometheus.MustNewConstMetric(icmp6UnreachableIcmp6PacketsOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.UnreachableIcmp6Packets, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6EchoOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.Icmp6Echo, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6EchoReplyOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.Icmp6EchoReply, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NeighborSolicitationOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.NeighborSolicitation, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NeighborAdvertisementOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.NeighborAdvertisement, labels...) + labels = labels[:len(labels)-1] + ch <- prometheus.MustNewConstMetric(icmp6Icmp6MessagesWithBadCodeFieldsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Icmp6MessagesWithBadCodeFields, labels...) + ch <- prometheus.MustNewConstMetric(icmp6MessagesLessThanMinimumLengthDesc, prometheus.CounterValue, s.Statistics.Icmp6.MessagesLessThanMinimumLength, labels...) + ch <- prometheus.MustNewConstMetric(icmp6BadChecksumsDesc, prometheus.CounterValue, s.Statistics.Icmp6.BadChecksums, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6MessagesWithBadLengthDesc, prometheus.CounterValue, s.Statistics.Icmp6.Icmp6MessagesWithBadLength, labels...) + labels = append(labels, "Input Histogram") + ch <- prometheus.MustNewConstMetric(icmp6UnreachableIcmp6PacketInputHistosDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.UnreachableIcmp6Packets, labels...) + ch <- prometheus.MustNewConstMetric(icmp6PacketTooBigInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.PacketTooBig, labels...) + ch <- prometheus.MustNewConstMetric(icmp6TimeExceededIcmp6PacketsInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.TimeExceededIcmp6Packets, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6EchoInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.Icmp6EchoReply, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6EchoReplyInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.Icmp6EchoReply, labels...) + ch <- prometheus.MustNewConstMetric(icmp6RouterSolicitationIcmp6PacketsInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.RouterSolicitationIcmp6Packets, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NeighborSolicitationInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.NeighborSolicitation, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NeighborAdvertisementInputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.InputHistogram.NeighborAdvertisement, labels...) + labels = labels[:len(labels)-1] + ch <- prometheus.MustNewConstMetric(icmp6NoRouteDesc, prometheus.CounterValue, s.Statistics.Icmp6.NoRoute, labels...) + ch <- prometheus.MustNewConstMetric(icmp6AdministrativelyProhibitedDesc, prometheus.CounterValue, s.Statistics.Icmp6.AdministrativelyProhibited, labels...) + ch <- prometheus.MustNewConstMetric(icmp6BeyondScopeDesc, prometheus.CounterValue, s.Statistics.Icmp6.BeyondScope, labels...) + ch <- prometheus.MustNewConstMetric(icmp6AddressUnreachableDesc, prometheus.CounterValue, s.Statistics.Icmp6.AddressUnreachable, labels...) + ch <- prometheus.MustNewConstMetric(icmp6PortUnreachableDesc, prometheus.CounterValue, s.Statistics.Icmp6.PortUnreachable, labels...) + ch <- prometheus.MustNewConstMetric(icmp6PacketTooBigDesc, prometheus.CounterValue, s.Statistics.Icmp6.PacketTooBig, labels...) + ch <- prometheus.MustNewConstMetric(icmp6TimeExceedTransitDesc, prometheus.CounterValue, s.Statistics.Icmp6.TimeExceedTransit, labels...) + ch <- prometheus.MustNewConstMetric(icmp6TimeExceedReassemblyDesc, prometheus.CounterValue, s.Statistics.Icmp6.TimeExceedReassembly, labels...) + ch <- prometheus.MustNewConstMetric(icmp6ErroneousHeaderFieldDesc, prometheus.CounterValue, s.Statistics.Icmp6.ErroneousHeaderField, labels...) + ch <- prometheus.MustNewConstMetric(icmp6UnrecognizedNextHeaderDesc, prometheus.CounterValue, s.Statistics.Icmp6.UnrecognizedNextHeader, labels...) + ch <- prometheus.MustNewConstMetric(icmp6UnrecognizedOptionDesc, prometheus.CounterValue, s.Statistics.Icmp6.UnrecognizedOption, labels...) + ch <- prometheus.MustNewConstMetric(icmp6RedirectDesc, prometheus.CounterValue, s.Statistics.Icmp6.Redirect, labels...) + ch <- prometheus.MustNewConstMetric(icmp6UnknownDesc, prometheus.CounterValue, s.Statistics.Icmp6.Unknown, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Icmp6MessageResponsesGeneratedDesc, prometheus.CounterValue, s.Statistics.Icmp6.Icmp6MessageResponsesGenerated, labels...) + ch <- prometheus.MustNewConstMetric(icmp6MessagesWithTooManyNdOptionsDesc, prometheus.CounterValue, s.Statistics.Icmp6.MessagesWithTooManyNdOptions, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdSystemMaxDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdSystemMax, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdPublicMaxDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdPublicMax, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdIriMaxDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdIriMax, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdMgtMaxDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdMgtMax, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdPublicCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdPublicCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdIriCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdIriCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdMgtCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdMgtCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdSystemDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdSystemDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdPublicDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdPublicDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdIriDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdIriDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6NdMgtDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.NdMgtDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyRequestsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyRequests, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyRequestsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyRequests, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyResponsesDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyResponses, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyConflictsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyConflicts, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DupProxyResponsesDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DupProxyResponses, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyResolveCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyResolveCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyResolveCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyResolveCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyEqmacDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyEqmacDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyNomacDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyNomacDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyUnrRequestsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyUnrRequests, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrRequestsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrRequests, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyUnrResponsesDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyUnrResponses, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrConflictsDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrConflicts, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrResponsesDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrResponses, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6NdpProxyUnrResolveCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6NdpProxyUnrResolveCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrResolveCntDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrResolveCnt, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrNomacDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrNomacDrop, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedOnEntryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedOnEntry, labels...) + ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedDuringRetryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedDuringRetry, labels...) +} diff --git a/pkg/features/systemstatistics/rpc.go b/pkg/features/systemstatistics/rpc.go index b822ec0b..6ce77417 100644 --- a/pkg/features/systemstatistics/rpc.go +++ b/pkg/features/systemstatistics/rpc.go @@ -390,7 +390,7 @@ type ICMP6 struct { BadChecksums float64 `xml:"bad-checksums"` Icmp6MessagesWithBadLength float64 `xml:"icmp6-messages-with-bad-length"` InputHistogram ICMP6InputHistogram `xml:"input-histogram"` - HistogramOfErrorMessagesToBeGenerated float64 `xml:"histogram-of-error-messages-to-be-generated"` + HistogramOfErrorMessagesToBeGenerated string `xml:"histogram-of-error-messages-to-be-generated"` NoRoute float64 `xml:"no-route"` AdministrativelyProhibited float64 `xml:"administratively-prohibited"` BeyondScope float64 `xml:"beyond-scope"` From 3349129227711858643ec5b6c2ac39acbaec0651 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Wed, 10 Sep 2025 14:04:12 +0200 Subject: [PATCH 08/11] added tests for icmp6 --- pkg/features/systemstatistics/collector.go | 2 +- pkg/features/systemstatistics/rpc_test.go | 148 ++++++++++++++++-- .../testsFiles/ICMP6/ICMP6TestDataCase1.xml | 82 ++++++++++ 3 files changed, 214 insertions(+), 18 deletions(-) create mode 100644 pkg/features/systemstatistics/testsFiles/ICMP6/ICMP6TestDataCase1.xml diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index b454b855..808d2aad 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -1551,4 +1551,4 @@ func (c *systemstatisticsCollector) collectSystemStatisticsICMP6(ch chan<- prome ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrNomacDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrNomacDrop, labels...) ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedOnEntryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedOnEntry, labels...) ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedDuringRetryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedDuringRetry, labels...) -} +} \ No newline at end of file diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index 2c771c24..de8a53ef 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -514,24 +514,24 @@ func TestStatisticsICMPUnmarshaling(t *testing.T) { AnEndpointChangedItsCookieSecret: 6010, }, { - IcmpEchoReply: 6011, - DestinationUnreachable: 6012, - IcmpEcho: 6013, - TimeStampReply: 6014, - TimeExceeded: 6015, - TimeStamp: 6016, - AddressMaskRequest: 6017, - AnEndpointChangedItsCookieSecret: 6018, + IcmpEchoReply: 6011, + DestinationUnreachable: 6012, + IcmpEcho: 6013, + TimeStampReply: 6014, + TimeExceeded: 6015, + TimeStamp: 6016, + AddressMaskRequest: 6017, + AnEndpointChangedItsCookieSecret: 6018, + }, }, - }, - MessagesWithBadCodeFields: 6019, - MessagesLessThanTheMinimumLength: 6020, - MessagesWithBadChecksum: 6021, - MessagesWithBadSourceAddress: 6022, - MessagesWithBadLength: 6023, - EchoDropsWithBroadcastOrMulticastDestinatonAddress: 6024, + MessagesWithBadCodeFields: 6019, + MessagesLessThanTheMinimumLength: 6020, + MessagesWithBadChecksum: 6021, + MessagesWithBadSourceAddress: 6022, + MessagesWithBadLength: 6023, + EchoDropsWithBroadcastOrMulticastDestinatonAddress: 6024, TimestampDropsWithBroadcastOrMulticastDestinationAddress: 6025, - MessageResponsesGenerated: 6026, + MessageResponsesGenerated: 6026, }, }, }, @@ -558,4 +558,118 @@ func TestStatisticsICMPUnmarshaling(t *testing.T) { assert.NoError(t, err, "unmarshal should not return error") }) } -} \ No newline at end of file +} + +func TestStatisticsICMP6Unmarshaling(t *testing.T) { + type testCase struct { + name string + xmlFile string + expect SystemStatistics + } + tests := []testCase{ + { + name: "complete_icmp6_statistics", + xmlFile: "testsFiles/ICMP6/ICMP6TestDataCase1.xml", + expect: SystemStatistics{ + Statistics: Statistics{ + Icmp6: ICMP6{ + CallsToIcmp6Error: 7000, + ErrorsNotGeneratedBecauseOldMessageWasIcmpError: 7001, + ErrorsNotGeneratedBecauseRateLimitation: 7002, + OutputHistogram: ICMP6OutputHistogram{ + UnreachableIcmp6Packets: 7003, + Icmp6Echo: 7004, + Icmp6EchoReply: 7005, + NeighborSolicitation: 7006, + NeighborAdvertisement: 7007, + }, + Icmp6MessagesWithBadCodeFields: 7008, + MessagesLessThanMinimumLength: 7009, + BadChecksums: 7010, + Icmp6MessagesWithBadLength: 7011, + InputHistogram: ICMP6InputHistogram{ + UnreachableIcmp6Packets: 7012, + PacketTooBig: 7013, + TimeExceededIcmp6Packets: 7014, + Icmp6Echo: 7015, + Icmp6EchoReply: 7016, + RouterSolicitationIcmp6Packets: 7017, + NeighborSolicitation: 7018, + NeighborAdvertisement: 7019, + }, + NoRoute: 7020, + AdministrativelyProhibited: 7021, + BeyondScope: 7022, + AddressUnreachable: 7023, + PortUnreachable: 7024, + PacketTooBig: 7025, + TimeExceedTransit: 7026, + TimeExceedReassembly: 7027, + ErroneousHeaderField: 7028, + UnrecognizedNextHeader: 7029, + UnrecognizedOption: 7030, + Redirect: 7031, + Unknown: 7032, + Icmp6MessageResponsesGenerated: 7033, + MessagesWithTooManyNdOptions: 7034, + NdSystemMax: 7035, + NdPublicMax: 7036, + NdIriMax: 7037, + NdMgtMax: 7038, + NdPublicCnt: 7039, + NdIriCnt: 7040, + NdMgtCnt: 7041, + NdSystemDrop: 7042, + NdPublicDrop: 7043, + NdIriDrop: 7044, + NdMgtDrop: 7045, + Nd6NdpProxyRequests: 7046, + Nd6DadProxyRequests: 7047, + Nd6NdpProxyResponses: 7048, + Nd6DadProxyConflicts: 7049, + Nd6DupProxyResponses: 7050, + Nd6NdpProxyResolveCnt: 7051, + Nd6DadProxyResolveCnt: 7052, + Nd6DadProxyEqmacDrop: 7053, + Nd6DadProxyNomacDrop: 7054, + Nd6NdpProxyUnrRequests: 7055, + Nd6DadProxyUnrRequests: 7056, + Nd6NdpProxyUnrResponses: 7057, + Nd6DadProxyUnrConflicts: 7058, + Nd6DadProxyUnrResponses: 7059, + Nd6NdpProxyUnrResolveCnt: 7060, + Nd6DadProxyUnrResolveCnt: 7061, + Nd6DadProxyUnrEqportDrop: 7062, + Nd6DadProxyUnrNomacDrop: 7063, + Nd6RequestsDroppedOnEntry: 7064, + Nd6RequestsDroppedDuringRetry: 7065, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fc, err := os.ReadFile(tc.xmlFile) + if err != nil { + log.Fatal("failed to read xml file in ICMP6 testing due to: ", err) + } + var result SystemStatistics + err = xml.Unmarshal(fc, &result) + if err != nil { + log.Fatal("failed to unmarshal xml file in ICMP6 testing due to: ", err) + } + result.Statistics.Icmp6.Text = "" + result.Statistics.Icmp6.HistogramOfErrorMessagesToBeGenerated = "" + result.Statistics.Icmp6.InputHistogram.Text = "" + result.Statistics.Icmp6.OutputHistogram.Text = "" + result.Statistics.Icmp6.InputHistogram.HistogramType = "" + result.Statistics.Icmp6.OutputHistogram.HistogramType = "" + result.Statistics.Icmp6.InputHistogram.Style = "" + result.Statistics.Icmp6.OutputHistogram.Style = "" + assert.Equal(t, tc.expect.Statistics.Icmp6, result.Statistics.Icmp6, tc.name) + assert.NoError(t, err, "unmarshal should not return error") + }) + } +} diff --git a/pkg/features/systemstatistics/testsFiles/ICMP6/ICMP6TestDataCase1.xml b/pkg/features/systemstatistics/testsFiles/ICMP6/ICMP6TestDataCase1.xml new file mode 100644 index 00000000..e0b5141e --- /dev/null +++ b/pkg/features/systemstatistics/testsFiles/ICMP6/ICMP6TestDataCase1.xml @@ -0,0 +1,82 @@ + + + + 7000 + 7001 + 7002 + + Output histogram: + 7003 + 7004 + 7005 + 7006 + 7007 + + 7008 + 7009 + 7010 + 7011 + + Input histogram: + 7012 + 7013 + 7014 + 7015 + 7016 + 7017 + 7018 + 7019 + + Histogram of error messages to be generated: + 7020 + 7021 + 7022 + 7023 + 7024 + 7025 + 7026 + 7027 + 7028 + 7029 + 7030 + 7031 + 7032 + 7033 + 7034 + 7035 + 7036 + 7037 + 7038 + 7039 + 7040 + 7041 + 7042 + 7043 + 7044 + 7045 + 7046 + 7047 + 7048 + 7049 + 7050 + 7051 + 7052 + 7053 + 7054 + 7055 + 7056 + 7057 + 7058 + 7059 + 7060 + 7061 + 7062 + 7063 + 7064 + 7065 + + + + + + From 98ba946a7412ab2e8a1114f0eab757706339b2b1 Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Thu, 11 Sep 2025 10:22:34 +0200 Subject: [PATCH 09/11] finished mpls, no tests yet --- pkg/features/systemstatistics/collector.go | 90 +++++++++++++++++++++- pkg/features/systemstatistics/rpc.go | 42 +++++----- 2 files changed, 111 insertions(+), 21 deletions(-) diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index 808d2aad..0ac941c4 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -371,6 +371,24 @@ var ( icmp6Nd6DadProxyUnrNomacDropDesc *prometheus.Desc icmp6Nd6RequestsDroppedOnEntryDesc *prometheus.Desc icmp6Nd6RequestsDroppedDuringRetryDesc *prometheus.Desc + + mplsTotalMplsPacketsReceivedDesc *prometheus.Desc + mplsPacketsForwardedDesc *prometheus.Desc + mplsPacketsDroppedDesc *prometheus.Desc + mplsPacketsWithHeaderTooSmallDesc *prometheus.Desc + mplsAfterTaggingPacketsCanNotFitLinkMtuDesc *prometheus.Desc + mplsPacketsWithIpv4ExplicitNullTagDesc *prometheus.Desc + mplsPacketsWithIpv4ExplicitNullChecksumErrorsDesc *prometheus.Desc + mplsPacketsWithRouterAlertTagDesc *prometheus.Desc + mplsLspPingPacketsDesc *prometheus.Desc + mplsPacketsWithTtlExpiredDesc *prometheus.Desc + mplsPacketsWithTagEncodingErrorDesc *prometheus.Desc + mplsPacketsDiscardedDueToNoRouteDesc *prometheus.Desc + mplsPacketsUsedFirstNexthopInEcmpUnilistDesc *prometheus.Desc + mplsPacketsDroppedDueToIflDownDesc *prometheus.Desc + mplsPacketsDroppedAtMplsSocketSendDesc *prometheus.Desc + mplsPacketsForwardedAtMplsSocketSendDesc *prometheus.Desc + mplsPacketsDroppedAtP2mpCnhOutputDesc *prometheus.Desc ) func init() { @@ -746,6 +764,25 @@ func init() { icmp6Nd6DadProxyUnrNomacDropDesc = prometheus.NewDesc(prefix+"icmp6_nd6_dad_proxy_unr_nomac_droop", "Number of icmp6 nd6 dad proxy unr nomac drop", labelsICMP6, nil) icmp6Nd6RequestsDroppedOnEntryDesc = prometheus.NewDesc(prefix+"icmp6_nd6_requests_dropped_on_entry", "Number of icmp6 nd6 requests dropped on entry", labelsICMP6, nil) icmp6Nd6RequestsDroppedDuringRetryDesc = prometheus.NewDesc(prefix+"icmp6_nd6_requests_dropped_during_retry", "Number of icmp6 nd6 requests dropped during retry", labelsICMP6, nil) + + labelsMPLS := []string{"target", "protocol"} + mplsTotalMplsPacketsReceivedDesc = prometheus.NewDesc(prefix+"mpls_total_mpls_packets_received", "Number of mpls packets received", labelsMPLS, nil) + mplsPacketsForwardedDesc = prometheus.NewDesc(prefix+"mpls_packets_forwarded", "Number of mpls packets forwarded", labelsMPLS, nil) + mplsPacketsDroppedDesc = prometheus.NewDesc(prefix+"mpls_packets_dropped", "Number of mpls packets dropped", labelsMPLS, nil) + mplsPacketsWithHeaderTooSmallDesc = prometheus.NewDesc(prefix+"mpls_packets_with_header_too_small", "Number of mpls packets with header too small", labelsMPLS, nil) + mplsAfterTaggingPacketsCanNotFitLinkMtuDesc = prometheus.NewDesc(prefix+"mpls_after_tagging_packets_can_not_fit_link_mtu", "Number of mpls after tagging packets can not fit link mtu", labelsMPLS, nil) + mplsPacketsWithIpv4ExplicitNullTagDesc = prometheus.NewDesc(prefix+"mpls_packets_with_ipv4_explicit_null_tag", "Number of mpls packets with ipv4 explicit null tag", labelsMPLS, nil) + mplsPacketsWithIpv4ExplicitNullChecksumErrorsDesc = prometheus.NewDesc(prefix+"mpls_packets_with_ipv4_explicit_null_checksum_errors", "Number of mpls packets with ipv4 explicit null checksum errors", labelsMPLS, nil) + mplsPacketsWithRouterAlertTagDesc = prometheus.NewDesc(prefix+"mpls_packets_with_router_alert_tag", "Number of mpls packets with router alert tag", labelsMPLS, nil) + mplsLspPingPacketsDesc = prometheus.NewDesc(prefix+"mpls_lsp_ping_packets", "Number of mpls lsp ping packets", labelsMPLS, nil) + mplsPacketsWithTtlExpiredDesc = prometheus.NewDesc(prefix+"mpls_packets_with_ttl_expired", "Number of mpls packets with ttl expired", labelsMPLS, nil) + mplsPacketsWithTagEncodingErrorDesc = prometheus.NewDesc(prefix+"mpls_packets_with_tag_encoding_error", "Number of mpls packets with tag encoding error", labelsMPLS, nil) + mplsPacketsDiscardedDueToNoRouteDesc = prometheus.NewDesc(prefix+"mpls_packets_discarded_due_to_no_route", "Number of mpls packets discarded due to no route", labelsMPLS, nil) + mplsPacketsUsedFirstNexthopInEcmpUnilistDesc = prometheus.NewDesc(prefix+"mpls_packets_used_first_next_hop_in_ecmp_unilist", "Number of mpls packets used first nexthop in ecmp unilist", labelsMPLS, nil) + mplsPacketsDroppedDueToIflDownDesc = prometheus.NewDesc(prefix+"mpls_packets_dropped_due_to_ifl_down", "Number of mpls packets dropped due to ifl down", labelsMPLS, nil) + mplsPacketsDroppedAtMplsSocketSendDesc = prometheus.NewDesc(prefix+"mpls_packets_dropped_at_mpls_socket_send", "Number of mpls packets dropped at mpls socket send", labelsMPLS, nil) + mplsPacketsForwardedAtMplsSocketSendDesc = prometheus.NewDesc(prefix+"mpls_packets_forwarded_at_mpls_socket_send", "Number of mpls packets forwarded at mpls socket send", labelsMPLS, nil) + mplsPacketsDroppedAtP2mpCnhOutputDesc = prometheus.NewDesc(prefix+"mpls_packets_dropped_at_p2mp_cnh_output", "Number of mpls packets dropped at p2mp cnh output", labelsMPLS, nil) } type systemstatisticsCollector struct{} @@ -1119,6 +1156,24 @@ func (c *systemstatisticsCollector) Describe(ch chan<- *prometheus.Desc) { ch <- icmp6Nd6DadProxyUnrNomacDropDesc ch <- icmp6Nd6RequestsDroppedOnEntryDesc ch <- icmp6Nd6RequestsDroppedDuringRetryDesc + + ch <- mplsTotalMplsPacketsReceivedDesc + ch <- mplsPacketsForwardedDesc + ch <- mplsPacketsDroppedDesc + ch <- mplsPacketsWithHeaderTooSmallDesc + ch <- mplsAfterTaggingPacketsCanNotFitLinkMtuDesc + ch <- mplsPacketsWithIpv4ExplicitNullTagDesc + ch <- mplsPacketsWithIpv4ExplicitNullChecksumErrorsDesc + ch <- mplsPacketsWithRouterAlertTagDesc + ch <- mplsLspPingPacketsDesc + ch <- mplsPacketsWithTtlExpiredDesc + ch <- mplsPacketsWithTagEncodingErrorDesc + ch <- mplsPacketsDiscardedDueToNoRouteDesc + ch <- mplsPacketsUsedFirstNexthopInEcmpUnilistDesc + ch <- mplsPacketsDroppedDueToIflDownDesc + ch <- mplsPacketsDroppedAtMplsSocketSendDesc + ch <- mplsPacketsForwardedAtMplsSocketSendDesc + ch <- mplsPacketsDroppedAtP2mpCnhOutputDesc } func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { @@ -1128,36 +1183,48 @@ func (c *systemstatisticsCollector) Collect(client collector.Client, ch chan<- p return err } c.collectSystemStatisticsIPV4(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics ip6", &s) if err != nil { return err } c.collectSystemStatisticsIPV6(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics udp", &s) if err != nil { return err } c.collectSystemStatisticsUDP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics tcp", &s) if err != nil { return err } c.collectSystemStatisticsTCP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics arp", &s) if err != nil { return err } c.collectSystemStatisticsARP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics icmp", &s) if err != nil { return err } c.collectSystemStatisticsICMP(ch, labelValues, s) + err = client.RunCommandAndParse("show system statistics icmp6", &s) if err != nil { return err } c.collectSystemStatisticsICMP6(ch, labelValues, s) + + err = client.RunCommandAndParse("show system statistics mpls", &s) + if err != nil { + return err + } + c.collectSystemStatisticsMPLS(ch, labelValues, s) return nil } @@ -1551,4 +1618,25 @@ func (c *systemstatisticsCollector) collectSystemStatisticsICMP6(ch chan<- prome ch <- prometheus.MustNewConstMetric(icmp6Nd6DadProxyUnrNomacDropDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6DadProxyUnrNomacDrop, labels...) ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedOnEntryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedOnEntry, labels...) ch <- prometheus.MustNewConstMetric(icmp6Nd6RequestsDroppedDuringRetryDesc, prometheus.CounterValue, s.Statistics.Icmp6.Nd6RequestsDroppedDuringRetry, labels...) -} \ No newline at end of file +} + +func (c *systemstatisticsCollector) collectSystemStatisticsMPLS(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { + labels := append(labelValues, "MPLS") + ch <- prometheus.MustNewConstMetric(mplsTotalMplsPacketsReceivedDesc, prometheus.CounterValue, s.Statistics.Mpls.TotalMplsPacketsReceived, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsForwardedDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsForwarded, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsDropped, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithHeaderTooSmallDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithHeaderTooSmall, labels...) + ch <- prometheus.MustNewConstMetric(mplsAfterTaggingPacketsCanNotFitLinkMtuDesc, prometheus.CounterValue, s.Statistics.Mpls.AfterTaggingPacketsCanNotFitLinkMtu, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithIpv4ExplicitNullTagDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithIpv4ExplicitNullTag, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithIpv4ExplicitNullChecksumErrorsDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithIpv4ExplicitNullChecksumErrors, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithRouterAlertTagDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithRouterAlertTag, labels...) + ch <- prometheus.MustNewConstMetric(mplsLspPingPacketsDesc, prometheus.CounterValue, s.Statistics.Mpls.LspPingPackets, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithTtlExpiredDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithTtlExpired, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsWithTagEncodingErrorDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsWithTagEncodingError, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsDiscardedDueToNoRouteDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsDiscardedDueToNoRoute, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsUsedFirstNexthopInEcmpUnilistDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsUsedFirstNexthopInEcmpUnilist, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsDroppedDueToIflDownDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsDroppedDueToIflDown, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsDroppedAtMplsSocketSendDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsDroppedAtMplsSocketSend, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsForwardedAtMplsSocketSendDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsForwardedAtMplsSocketSend, labels...) + ch <- prometheus.MustNewConstMetric(mplsPacketsDroppedAtP2mpCnhOutputDesc, prometheus.CounterValue, s.Statistics.Mpls.PacketsDroppedAtP2mpCnhOutput, labels...) +} diff --git a/pkg/features/systemstatistics/rpc.go b/pkg/features/systemstatistics/rpc.go index 6ce77417..8e5900bd 100644 --- a/pkg/features/systemstatistics/rpc.go +++ b/pkg/features/systemstatistics/rpc.go @@ -27,26 +27,7 @@ type Statistics struct { Arp ARP `xml:"arp"` Ip6 IP6 `xml:"ip6"` Icmp6 ICMP6`xml:"icmp6"` - Mpls struct { - Text string `xml:",chardata"` - TotalMplsPacketsReceived string `xml:"total-mpls-packets-received"` - PacketsForwarded string `xml:"packets-forwarded"` - PacketsDropped string `xml:"packets-dropped"` - PacketsWithHeaderTooSmall string `xml:"packets-with-header-too-small"` - AfterTaggingPacketsCanNotFitLinkMtu string `xml:"after-tagging-packets-can-not-fit-link-mtu"` - PacketsWithIpv4ExplicitNullTag string `xml:"packets-with-ipv4-explicit-null-tag"` - PacketsWithIpv4ExplicitNullChecksumErrors string `xml:"packets-with-ipv4-explicit-null-checksum-errors"` - PacketsWithRouterAlertTag string `xml:"packets-with-router-alert-tag"` - LspPingPackets string `xml:"lsp-ping-packets"` - PacketsWithTtlExpired string `xml:"packets-with-ttl-expired"` - PacketsWithTagEncodingError string `xml:"packets-with-tag-encoding-error"` - PacketsDiscardedDueToNoRoute string `xml:"packets-discarded-due-to-no-route"` - PacketsUsedFirstNexthopInEcmpUnilist string `xml:"packets-used-first-nexthop-in-ecmp-unilist"` - PacketsDroppedDueToIflDown string `xml:"packets-dropped-due-to-ifl-down"` - PacketsDroppedAtMplsSocketSend string `xml:"packets-dropped-at-mpls-socket-send"` - PacketsForwardedAtMplsSocketSend string `xml:"packets-forwarded-at-mpls-socket-send"` - PacketsDroppedAtP2mpCnhOutput string `xml:"packets-dropped-at-p2mp-cnh-output"` - } `xml:"mpls"` + Mpls MPLS`xml:"mpls"` } type IP struct { @@ -462,4 +443,25 @@ type ICMP6InputHistogram struct { RouterSolicitationIcmp6Packets float64 `xml:"router-solicitation-icmp6-packets"` NeighborSolicitation float64 `xml:"neighbor-solicitation"` NeighborAdvertisement float64 `xml:"neighbor-advertisement"` +} + +type MPLS struct { + Text string `xml:",chardata"` + TotalMplsPacketsReceived float64 `xml:"total-mpls-packets-received"` + PacketsForwarded float64 `xml:"packets-forwarded"` + PacketsDropped float64 `xml:"packets-dropped"` + PacketsWithHeaderTooSmall float64 `xml:"packets-with-header-too-small"` + AfterTaggingPacketsCanNotFitLinkMtu float64 `xml:"after-tagging-packets-can-not-fit-link-mtu"` + PacketsWithIpv4ExplicitNullTag float64 `xml:"packets-with-ipv4-explicit-null-tag"` + PacketsWithIpv4ExplicitNullChecksumErrors float64 `xml:"packets-with-ipv4-explicit-null-checksum-errors"` + PacketsWithRouterAlertTag float64 `xml:"packets-with-router-alert-tag"` + LspPingPackets float64 `xml:"lsp-ping-packets"` + PacketsWithTtlExpired float64 `xml:"packets-with-ttl-expired"` + PacketsWithTagEncodingError float64 `xml:"packets-with-tag-encoding-error"` + PacketsDiscardedDueToNoRoute float64 `xml:"packets-discarded-due-to-no-route"` + PacketsUsedFirstNexthopInEcmpUnilist float64 `xml:"packets-used-first-nexthop-in-ecmp-unilist"` + PacketsDroppedDueToIflDown float64 `xml:"packets-dropped-due-to-ifl-down"` + PacketsDroppedAtMplsSocketSend float64 `xml:"packets-dropped-at-mpls-socket-send"` + PacketsForwardedAtMplsSocketSend float64 `xml:"packets-forwarded-at-mpls-socket-send"` + PacketsDroppedAtP2mpCnhOutput float64 `xml:"packets-dropped-at-p2mp-cnh-output"` } \ No newline at end of file From 9af467d7a9da29de0d6af0be119b97630ed3111b Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Thu, 11 Sep 2025 11:24:11 +0200 Subject: [PATCH 10/11] added tests for mpls --- pkg/features/systemstatistics/rpc_test.go | 146 ++++++++++++------ .../testsFiles/MPLS/MPLSTestDataCase1.xml | 26 ++++ 2 files changed, 126 insertions(+), 46 deletions(-) create mode 100644 pkg/features/systemstatistics/testsFiles/MPLS/MPLSTestDataCase1.xml diff --git a/pkg/features/systemstatistics/rpc_test.go b/pkg/features/systemstatistics/rpc_test.go index de8a53ef..ddbeb16c 100644 --- a/pkg/features/systemstatistics/rpc_test.go +++ b/pkg/features/systemstatistics/rpc_test.go @@ -597,52 +597,52 @@ func TestStatisticsICMP6Unmarshaling(t *testing.T) { NeighborSolicitation: 7018, NeighborAdvertisement: 7019, }, - NoRoute: 7020, - AdministrativelyProhibited: 7021, - BeyondScope: 7022, - AddressUnreachable: 7023, - PortUnreachable: 7024, - PacketTooBig: 7025, - TimeExceedTransit: 7026, - TimeExceedReassembly: 7027, - ErroneousHeaderField: 7028, - UnrecognizedNextHeader: 7029, - UnrecognizedOption: 7030, - Redirect: 7031, - Unknown: 7032, - Icmp6MessageResponsesGenerated: 7033, - MessagesWithTooManyNdOptions: 7034, - NdSystemMax: 7035, - NdPublicMax: 7036, - NdIriMax: 7037, - NdMgtMax: 7038, - NdPublicCnt: 7039, - NdIriCnt: 7040, - NdMgtCnt: 7041, - NdSystemDrop: 7042, - NdPublicDrop: 7043, - NdIriDrop: 7044, - NdMgtDrop: 7045, - Nd6NdpProxyRequests: 7046, - Nd6DadProxyRequests: 7047, - Nd6NdpProxyResponses: 7048, - Nd6DadProxyConflicts: 7049, - Nd6DupProxyResponses: 7050, - Nd6NdpProxyResolveCnt: 7051, - Nd6DadProxyResolveCnt: 7052, - Nd6DadProxyEqmacDrop: 7053, - Nd6DadProxyNomacDrop: 7054, - Nd6NdpProxyUnrRequests: 7055, - Nd6DadProxyUnrRequests: 7056, - Nd6NdpProxyUnrResponses: 7057, - Nd6DadProxyUnrConflicts: 7058, - Nd6DadProxyUnrResponses: 7059, - Nd6NdpProxyUnrResolveCnt: 7060, - Nd6DadProxyUnrResolveCnt: 7061, - Nd6DadProxyUnrEqportDrop: 7062, - Nd6DadProxyUnrNomacDrop: 7063, - Nd6RequestsDroppedOnEntry: 7064, - Nd6RequestsDroppedDuringRetry: 7065, + NoRoute: 7020, + AdministrativelyProhibited: 7021, + BeyondScope: 7022, + AddressUnreachable: 7023, + PortUnreachable: 7024, + PacketTooBig: 7025, + TimeExceedTransit: 7026, + TimeExceedReassembly: 7027, + ErroneousHeaderField: 7028, + UnrecognizedNextHeader: 7029, + UnrecognizedOption: 7030, + Redirect: 7031, + Unknown: 7032, + Icmp6MessageResponsesGenerated: 7033, + MessagesWithTooManyNdOptions: 7034, + NdSystemMax: 7035, + NdPublicMax: 7036, + NdIriMax: 7037, + NdMgtMax: 7038, + NdPublicCnt: 7039, + NdIriCnt: 7040, + NdMgtCnt: 7041, + NdSystemDrop: 7042, + NdPublicDrop: 7043, + NdIriDrop: 7044, + NdMgtDrop: 7045, + Nd6NdpProxyRequests: 7046, + Nd6DadProxyRequests: 7047, + Nd6NdpProxyResponses: 7048, + Nd6DadProxyConflicts: 7049, + Nd6DupProxyResponses: 7050, + Nd6NdpProxyResolveCnt: 7051, + Nd6DadProxyResolveCnt: 7052, + Nd6DadProxyEqmacDrop: 7053, + Nd6DadProxyNomacDrop: 7054, + Nd6NdpProxyUnrRequests: 7055, + Nd6DadProxyUnrRequests: 7056, + Nd6NdpProxyUnrResponses: 7057, + Nd6DadProxyUnrConflicts: 7058, + Nd6DadProxyUnrResponses: 7059, + Nd6NdpProxyUnrResolveCnt: 7060, + Nd6DadProxyUnrResolveCnt: 7061, + Nd6DadProxyUnrEqportDrop: 7062, + Nd6DadProxyUnrNomacDrop: 7063, + Nd6RequestsDroppedOnEntry: 7064, + Nd6RequestsDroppedDuringRetry: 7065, }, }, }, @@ -673,3 +673,57 @@ func TestStatisticsICMP6Unmarshaling(t *testing.T) { }) } } + +func TestStatisticsMPLSUnmarshaling(t *testing.T) { + type testCase struct { + name string + xmlFile string + expect SystemStatistics + } + tests := []testCase{ + { + name: "complete_mpls_statistics", + xmlFile: "testsFiles/MPLS/MPLSTestDataCase1.xml", + expect: SystemStatistics{ + Statistics: Statistics{ + Mpls: MPLS{ + TotalMplsPacketsReceived: 8000, + PacketsForwarded: 8001, + PacketsDropped: 8002, + PacketsWithHeaderTooSmall: 8003, + AfterTaggingPacketsCanNotFitLinkMtu: 8004, + PacketsWithIpv4ExplicitNullTag: 8005, + PacketsWithIpv4ExplicitNullChecksumErrors: 8006, + PacketsWithRouterAlertTag: 8007, + LspPingPackets: 8008, + PacketsWithTtlExpired: 8009, + PacketsWithTagEncodingError: 8010, + PacketsDiscardedDueToNoRoute: 8011, + PacketsUsedFirstNexthopInEcmpUnilist: 8012, + PacketsDroppedDueToIflDown: 8013, + PacketsDroppedAtMplsSocketSend: 8014, + PacketsForwardedAtMplsSocketSend: 8015, + PacketsDroppedAtP2mpCnhOutput: 8016, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fc, err := os.ReadFile(tc.xmlFile) + if err != nil { + log.Fatal("failed to read xml file in MPLS testing due to: ", err) + } + var result SystemStatistics + err = xml.Unmarshal(fc, &result) + if err != nil { + log.Fatal("failed to unmarshal xml file in MPLS testing due to: ", err) + } + result.Statistics.Mpls.Text = "" + assert.Equal(t, tc.expect.Statistics.Mpls, result.Statistics.Mpls, tc.name) + assert.NoError(t, err, "unmarshal should not return error") + }) + } +} diff --git a/pkg/features/systemstatistics/testsFiles/MPLS/MPLSTestDataCase1.xml b/pkg/features/systemstatistics/testsFiles/MPLS/MPLSTestDataCase1.xml new file mode 100644 index 00000000..b79041db --- /dev/null +++ b/pkg/features/systemstatistics/testsFiles/MPLS/MPLSTestDataCase1.xml @@ -0,0 +1,26 @@ + + + + 8000 + 8001 + 8002 + 8003 + 8004 + 8005 + 8006 + 8007 + 8008 + 8009 + 8010 + 8011 + 8012 + 8013 + 8014 + 8015 + 8016 + + + + + + From 086b4748a1b73eca669e0c7e8abdf21459b0203b Mon Sep 17 00:00:00 2001 From: Vincent Vilenchik Date: Thu, 11 Sep 2025 16:24:19 +0200 Subject: [PATCH 11/11] changed some counters to gauge + updated variable names for TCP --- pkg/features/systemstatistics/collector.go | 934 ++++++++++----------- 1 file changed, 467 insertions(+), 467 deletions(-) diff --git a/pkg/features/systemstatistics/collector.go b/pkg/features/systemstatistics/collector.go index 0ac941c4..f6e4a734 100644 --- a/pkg/features/systemstatistics/collector.go +++ b/pkg/features/systemstatistics/collector.go @@ -106,122 +106,122 @@ var ( udpDatagramsDeliveredDesc *prometheus.Desc udpDatagramsOutputDesc *prometheus.Desc - tcpPacketsSent *prometheus.Desc - tcpSentDataPackets *prometheus.Desc - tcpDataPacketsBytes *prometheus.Desc - tcpSentDataPacketsRetransmitted *prometheus.Desc - tcpRetransmittedBytes *prometheus.Desc - tcpSentDataUnnecessaryRetransmitted *prometheus.Desc - tcpSentResendsByMtuDiscovery *prometheus.Desc - tcpSentAckOnlyPackets *prometheus.Desc - tcpSentPacketsDelayed *prometheus.Desc - tcpSentUrgOnlyPackets *prometheus.Desc - tcpSentWindowProbePackets *prometheus.Desc - tcpSentWindowUpdatePackets *prometheus.Desc - tcpSentControlPackets *prometheus.Desc - tcpPacketsReceived *prometheus.Desc - tcpReceivedAcks *prometheus.Desc - tcpAcksBytes *prometheus.Desc - tcpReceivedDuplicateAcks *prometheus.Desc - tcpReceivedAcksForUnsentData *prometheus.Desc - tcpPacketsReceivedInSequence *prometheus.Desc - tcpInSequenceBytes *prometheus.Desc - tcpReceivedCompletelyDuplicatePacket *prometheus.Desc - tcpDuplicateInBytes *prometheus.Desc - tcpReceivedOldDuplicatePackets *prometheus.Desc - tcpReceivedPacketsWithSomeDupliacteData *prometheus.Desc - tcpSomeDuplicateInBytes *prometheus.Desc - tcpReceivedOutOfOrderPackets *prometheus.Desc - tcpOutOfOrderInBytes *prometheus.Desc - tcpReceivedPacketsOfDataAfterWindow *prometheus.Desc - tcpBytes *prometheus.Desc - tcpReceivedWindowProbes *prometheus.Desc - tcpReceivedWindowUpdatePackets *prometheus.Desc - tcpPacketsReceivedAfterClose *prometheus.Desc - tcpReceivedDiscardedForBadChecksum *prometheus.Desc - tcpReceivedDiscardedForBadHeaderOffset *prometheus.Desc - tcpReceivedDiscardedBecausePacketTooShort *prometheus.Desc - tcpConnectionRequests *prometheus.Desc - tcpConnectionAccepts *prometheus.Desc - tcpBadConnectionAttempts *prometheus.Desc - tcpListenQueueOverflows *prometheus.Desc - tcpBadRstWindow *prometheus.Desc - tcpConnectionsEstablished *prometheus.Desc - tcpConnectionsClosed *prometheus.Desc - tcpDrops *prometheus.Desc - tcpConnectionsUpdatedRttOnClose *prometheus.Desc - tcpConnectionsUpdatedVarianceOnClose *prometheus.Desc - tcpConnectionsUpdatedSsthreshOnClose *prometheus.Desc - tcpEmbryonicConnectionsDropped *prometheus.Desc - tcpSegmentsUpdatedRtt *prometheus.Desc - tcpAttempts *prometheus.Desc - tcpRetransmitTimeouts *prometheus.Desc - tcpConnectionsDroppedByRetransmitTimeout *prometheus.Desc - tcpPersistTimeouts *prometheus.Desc - tcpConnectionsDroppedByPersistTimeout *prometheus.Desc - tcpKeepaliveTimeouts *prometheus.Desc - tcpKeepaliveProbesSent *prometheus.Desc - tcpKeepaliveConnectionsDropped *prometheus.Desc - tcpAckHeaderPredictions *prometheus.Desc - tcpDataPacketHeaderPredictions *prometheus.Desc - tcpSyncacheEntriesAdded *prometheus.Desc - tcpRetransmitted *prometheus.Desc - tcpDupsyn *prometheus.Desc - tcpDropped *prometheus.Desc - tcpCompleted *prometheus.Desc - tcpBucketOverflow *prometheus.Desc - tcpCacheOverflow *prometheus.Desc - tcpReset *prometheus.Desc - tcpStale *prometheus.Desc - tcpAborted *prometheus.Desc - tcpBadack *prometheus.Desc - tcpUnreach *prometheus.Desc - tcpZoneFailures *prometheus.Desc - tcpCookiesSent *prometheus.Desc - tcpCookiesReceived *prometheus.Desc - tcpSackRecoveryEpisodes *prometheus.Desc - tcpSegmentRetransmits *prometheus.Desc - tcpByteRetransmits *prometheus.Desc - tcpSackOptionsReceived *prometheus.Desc - tcpSackOptionsSent *prometheus.Desc - tcpSackScoreboardOverflow *prometheus.Desc - tcpAcksSentInResponseButNotExactRsts *prometheus.Desc - tcpAcksSentInResponseToSynsOnEstablishedConnections *prometheus.Desc - tcpRcvPacketsDroppedDueToBadAddress *prometheus.Desc - tcpOutOfSequenceSegmentDrops *prometheus.Desc - tcpRstPackets *prometheus.Desc - tcpIcmpPacketsIgnored *prometheus.Desc - tcpSendPacketsDropped *prometheus.Desc - tcpRcvPacketsDropped *prometheus.Desc - tcpOutgoingSegmentsDropped *prometheus.Desc - tcpReceivedSynfinDropped *prometheus.Desc - tcpReceivedIpsecDropped *prometheus.Desc - tcpReceivedMacDropped *prometheus.Desc - tcpReceivedMinttlExceeded *prometheus.Desc - tcpListenstateBadflagsDropped *prometheus.Desc - tcpFinwaitstateBadflagsDropped *prometheus.Desc - tcpReceivedDosAttack *prometheus.Desc - tcpReceivedBadSynack *prometheus.Desc - tcpSyncacheZoneFull *prometheus.Desc - tcpReceivedRstFirewallfilter *prometheus.Desc - tcpReceivedNoackTimewait *prometheus.Desc - tcpReceivedNoTimewaitState *prometheus.Desc - tcpReceivedRstTimewaitState *prometheus.Desc - tcpReceivedTimewaitDrops *prometheus.Desc - tcpReceivedBadaddrTimewaitState *prometheus.Desc - tcpReceivedAckoffInSynSentrcvd *prometheus.Desc - tcpReceivedBadaddrFirewall *prometheus.Desc - tcpReceivedNosynSynSent *prometheus.Desc - tcpReceivedBadrstSynSent *prometheus.Desc - tcpReceivedBadrstListenState *prometheus.Desc - tcpOptionMaxsegmentLength *prometheus.Desc - tcpOptionWindowLength *prometheus.Desc - tcpOptionTimestampLength *prometheus.Desc - tcpOptionMd5Length *prometheus.Desc - tcpOptionAuthLength *prometheus.Desc - tcpOptionSackpermittedLength *prometheus.Desc - tcpOptionSackLength *prometheus.Desc - tcpOptionAuthoptionLength *prometheus.Desc + tcpPacketsSentDesc *prometheus.Desc + tcpSentDataPacketsDesc *prometheus.Desc + tcpDataPacketsBytesDesc *prometheus.Desc + tcpSentDataPacketsRetransmittedDesc *prometheus.Desc + tcpRetransmittedBytesDesc *prometheus.Desc + tcpSentDataUnnecessaryRetransmittedDesc *prometheus.Desc + tcpSentResendsByMtuDiscoveryDesc *prometheus.Desc + tcpSentAckOnlyPacketsDesc *prometheus.Desc + tcpSentPacketsDelayedDesc *prometheus.Desc + tcpSentUrgOnlyPacketsDesc *prometheus.Desc + tcpSentWindowProbePacketsDesc *prometheus.Desc + tcpSentWindowUpdatePacketsDesc *prometheus.Desc + tcpSentControlPacketsDesc *prometheus.Desc + tcpPacketsReceivedDesc *prometheus.Desc + tcpReceivedAcksDesc *prometheus.Desc + tcpAcksBytesDesc *prometheus.Desc + tcpReceivedDuplicateAcksDesc *prometheus.Desc + tcpReceivedAcksForUnsentDataDesc *prometheus.Desc + tcpPacketsReceivedInSequenceDesc *prometheus.Desc + tcpInSequenceBytesDesc *prometheus.Desc + tcpReceivedCompletelyDuplicatePacketDesc *prometheus.Desc + tcpDuplicateInBytesDesc *prometheus.Desc + tcpReceivedOldDuplicatePacketsDesc *prometheus.Desc + tcpReceivedPacketsWithSomeDupliacteDataDesc *prometheus.Desc + tcpSomeDuplicateInBytesDesc *prometheus.Desc + tcpReceivedOutOfOrderPacketsDesc *prometheus.Desc + tcpOutOfOrderInBytesDesc *prometheus.Desc + tcpReceivedPacketsOfDataAfterWindowDesc *prometheus.Desc + tcpBytesDesc *prometheus.Desc + tcpReceivedWindowProbesDesc *prometheus.Desc + tcpReceivedWindowUpdatePacketsDesc *prometheus.Desc + tcpPacketsReceivedAfterCloseDesc *prometheus.Desc + tcpReceivedDiscardedForBadChecksumDesc *prometheus.Desc + tcpReceivedDiscardedForBadHeaderOffsetDesc *prometheus.Desc + tcpReceivedDiscardedBecausePacketTooShortDesc *prometheus.Desc + tcpConnectionRequestsDesc *prometheus.Desc + tcpConnectionAcceptsDesc *prometheus.Desc + tcpBadConnectionAttemptsDesc *prometheus.Desc + tcpListenQueueOverflowsDesc *prometheus.Desc + tcpBadRstWindowDesc *prometheus.Desc + tcpConnectionsEstablishedDesc *prometheus.Desc + tcpConnectionsClosedDesc *prometheus.Desc + tcpDropsDesc *prometheus.Desc + tcpConnectionsUpdatedRttOnCloseDesc *prometheus.Desc + tcpConnectionsUpdatedVarianceOnCloseDesc *prometheus.Desc + tcpConnectionsUpdatedSsthreshOnCloseDesc *prometheus.Desc + tcpEmbryonicConnectionsDroppedDesc *prometheus.Desc + tcpSegmentsUpdatedRttDesc *prometheus.Desc + tcpAttemptsDesc *prometheus.Desc + tcpRetransmitTimeoutsDesc *prometheus.Desc + tcpConnectionsDroppedByRetransmitTimeoutDesc *prometheus.Desc + tcpPersistTimeoutsDesc *prometheus.Desc + tcpConnectionsDroppedByPersistTimeoutDesc *prometheus.Desc + tcpKeepaliveTimeoutsDesc *prometheus.Desc + tcpKeepaliveProbesSentDesc *prometheus.Desc + tcpKeepaliveConnectionsDroppedDesc *prometheus.Desc + tcpAckHeaderPredictionsDesc *prometheus.Desc + tcpDataPacketHeaderPredictionsDesc *prometheus.Desc + tcpSyncacheEntriesAddedDesc *prometheus.Desc + tcpRetransmittedDesc *prometheus.Desc + tcpDupsynDesc *prometheus.Desc + tcpDroppedDesc *prometheus.Desc + tcpCompletedDesc *prometheus.Desc + tcpBucketOverflowDesc *prometheus.Desc + tcpCacheOverflowDesc *prometheus.Desc + tcpResetDesc *prometheus.Desc + tcpStaleDesc *prometheus.Desc + tcpAbortedDesc *prometheus.Desc + tcpBadackDesc *prometheus.Desc + tcpUnreachDesc *prometheus.Desc + tcpZoneFailuresDesc *prometheus.Desc + tcpCookiesSentDesc *prometheus.Desc + tcpCookiesReceivedDesc *prometheus.Desc + tcpSackRecoveryEpisodesDesc *prometheus.Desc + tcpSegmentRetransmitsDesc *prometheus.Desc + tcpByteRetransmitsDesc *prometheus.Desc + tcpSackOptionsReceivedDesc *prometheus.Desc + tcpSackOptionsSentDesc *prometheus.Desc + tcpSackScoreboardOverflowDesc *prometheus.Desc + tcpAcksSentInResponseButNotExactRstsDesc *prometheus.Desc + tcpAcksSentInResponseToSynsOnEstablishedConnectionsDesc *prometheus.Desc + tcpRcvPacketsDroppedDueToBadAddressDesc *prometheus.Desc + tcpOutOfSequenceSegmentDropsDesc *prometheus.Desc + tcpRstPacketsDesc *prometheus.Desc + tcpIcmpPacketsIgnoredDesc *prometheus.Desc + tcpSendPacketsDroppedDesc *prometheus.Desc + tcpRcvPacketsDroppedDesc *prometheus.Desc + tcpOutgoingSegmentsDroppedDesc *prometheus.Desc + tcpReceivedSynfinDroppedDesc *prometheus.Desc + tcpReceivedIpsecDroppedDesc *prometheus.Desc + tcpReceivedMacDroppedDesc *prometheus.Desc + tcpReceivedMinttlExceededDesc *prometheus.Desc + tcpListenstateBadflagsDroppedDesc *prometheus.Desc + tcpFinwaitstateBadflagsDroppedDesc *prometheus.Desc + tcpReceivedDosAttackDesc *prometheus.Desc + tcpReceivedBadSynackDesc *prometheus.Desc + tcpSyncacheZoneFullDesc *prometheus.Desc + tcpReceivedRstFirewallfilterDesc *prometheus.Desc + tcpReceivedNoackTimewaitDesc *prometheus.Desc + tcpReceivedNoTimewaitStateDesc *prometheus.Desc + tcpReceivedRstTimewaitStateDesc *prometheus.Desc + tcpReceivedTimewaitDropsDesc *prometheus.Desc + tcpReceivedBadaddrTimewaitStateDesc *prometheus.Desc + tcpReceivedAckoffInSynSentrcvdDesc *prometheus.Desc + tcpReceivedBadaddrFirewallDesc *prometheus.Desc + tcpReceivedNosynSynSentDesc *prometheus.Desc + tcpReceivedBadrstSynSentDesc *prometheus.Desc + tcpReceivedBadrstListenStateDesc *prometheus.Desc + tcpOptionMaxsegmentLengthDesc *prometheus.Desc + tcpOptionWindowLengthDesc *prometheus.Desc + tcpOptionTimestampLengthDesc *prometheus.Desc + tcpOptionMd5LengthDesc *prometheus.Desc + tcpOptionAuthLengthDesc *prometheus.Desc + tcpOptionSackpermittedLengthDesc *prometheus.Desc + tcpOptionSackLengthDesc *prometheus.Desc + tcpOptionAuthoptionLengthDesc *prometheus.Desc arpDatagramsReceivedDesc *prometheus.Desc arpRequestsReceivedDesc *prometheus.Desc @@ -494,122 +494,122 @@ func init() { udpDatagramsOutputDesc = prometheus.NewDesc(prefix+"udp_datagrams_output", "Number of UDP datagrams output", labelsUDP, nil) labelsTCP := []string{"target", "protocol"} - tcpPacketsSent = prometheus.NewDesc(prefix+"tcp_packets_sent", "Number of TCP packets sent", labelsTCP, nil) - tcpSentDataPackets = prometheus.NewDesc(prefix+"tcp_sent_data_packets", "Number of TCP sent data packets", labelsTCP, nil) - tcpDataPacketsBytes = prometheus.NewDesc(prefix+"tcp_data_packets_bytes", "Number of TCP data packets bytes", labelsTCP, nil) - tcpSentDataPacketsRetransmitted = prometheus.NewDesc(prefix+"tcp_sent_data_packets_retransmitted", "Number of TCP sent data packets retransmitted", labelsTCP, nil) - tcpRetransmittedBytes = prometheus.NewDesc(prefix+"tcp_retransmitted_bytes", "Number of TCP retransmitted bytes", labelsTCP, nil) - tcpSentDataUnnecessaryRetransmitted = prometheus.NewDesc(prefix+"tcp_sent_data_unnecessary_retransmitted", "Number of tcp data unnecessary retransmitted packets", labelsTCP, nil) - tcpSentResendsByMtuDiscovery = prometheus.NewDesc(prefix+"tcp_sent_resends_by_mtu_discovery", "Number of tcp sent resends by mtu discovery", labelsTCP, nil) - tcpSentAckOnlyPackets = prometheus.NewDesc(prefix+"tcp_sent_ack_only_packets", "Number of tcp sent ack only packets", labelsTCP, nil) - tcpSentPacketsDelayed = prometheus.NewDesc(prefix+"tcp_sent_packets_delayed", "Number of tcp sent packets delayed", labelsTCP, nil) - tcpSentUrgOnlyPackets = prometheus.NewDesc(prefix+"tcp_sent_urg_only_packets", "Number of tcp sent urg only packets", labelsTCP, nil) - tcpSentWindowProbePackets = prometheus.NewDesc(prefix+"tcp_sent_window_probe_packets", "Number of tcp sent window probe packets", labelsTCP, nil) - tcpSentWindowUpdatePackets = prometheus.NewDesc(prefix+"tcp_sent_window_update_packets", "Number of tcp sent window update packets", labelsTCP, nil) - tcpSentControlPackets = prometheus.NewDesc(prefix+"tcp_sent_control_packets", "Number of tcp sent control packets", labelsTCP, nil) - tcpPacketsReceived = prometheus.NewDesc(prefix+"tcp_packets_received", "Number of TCP packets received", labelsTCP, nil) - tcpReceivedAcks = prometheus.NewDesc(prefix+"tcp_received_acks", "Number of TCP received acks", labelsTCP, nil) - tcpAcksBytes = prometheus.NewDesc(prefix+"tcp_acks_bytes", "Number of TCP acks bytes", labelsTCP, nil) - tcpReceivedDuplicateAcks = prometheus.NewDesc(prefix+"tcp_received_duplicate_acks", "Number of TCP received duplicate acks", labelsTCP, nil) - tcpReceivedAcksForUnsentData = prometheus.NewDesc(prefix+"tcp_received_acks_for_unsent_data", "Number of TCP received acks for unsent data", labelsTCP, nil) - tcpPacketsReceivedInSequence = prometheus.NewDesc(prefix+"tcp_packets_received_in_sequence", "Number of TCP packets received in sequence", labelsTCP, nil) - tcpInSequenceBytes = prometheus.NewDesc(prefix+"tcp_in_sequence_bytes", "Number of TCP in sequence bytes", labelsTCP, nil) - tcpReceivedCompletelyDuplicatePacket = prometheus.NewDesc(prefix+"tcp_received_completely_duplicate_packet", "Number of TCP received completely duplicate packet", labelsTCP, nil) - tcpDuplicateInBytes = prometheus.NewDesc(prefix+"tcp_duplicate_in_bytes", "Number of TCP duplicate in bytes", labelsTCP, nil) - tcpReceivedOldDuplicatePackets = prometheus.NewDesc(prefix+"tcp_received_old_duplicate_packets", "Number of TCP received old duplicate packets", labelsTCP, nil) - tcpReceivedPacketsWithSomeDupliacteData = prometheus.NewDesc(prefix+"tcp_received_packet_with_some_duplicate_data", "Number of TCP received packet with some duplicate data", labelsTCP, nil) - tcpSomeDuplicateInBytes = prometheus.NewDesc(prefix+"tcp_some_duplicate_in_bytes", "Number of TCP some duplicate in bytes", labelsTCP, nil) - tcpReceivedOutOfOrderPackets = prometheus.NewDesc(prefix+"tcp_received_out_of_order_packets", "Number of TCP received out of order packets", labelsTCP, nil) - tcpOutOfOrderInBytes = prometheus.NewDesc(prefix+"tcp_out_of_order_in_bytes", "Number of TCP out of order in bytes", labelsTCP, nil) - tcpReceivedPacketsOfDataAfterWindow = prometheus.NewDesc(prefix+"tcp_received_packets_of_data_after_window", "Number of TCP received packets of data after window", labelsTCP, nil) - tcpBytes = prometheus.NewDesc(prefix+"tcp_bytes", "Number of TCP bytes", labelsTCP, nil) - tcpReceivedWindowProbes = prometheus.NewDesc(prefix+"tcp_received_window_probes", "Number of TCP received window probes", labelsTCP, nil) - tcpReceivedWindowUpdatePackets = prometheus.NewDesc(prefix+"tcp_received_window_update_packets", "Number of TCP received window update packets", labelsTCP, nil) - tcpPacketsReceivedAfterClose = prometheus.NewDesc(prefix+"tcp_packets_received_after_close", "Number of TCP packets received after close", labelsTCP, nil) - tcpReceivedDiscardedForBadChecksum = prometheus.NewDesc(prefix+"tcp_received_discarded_for_bad_checksum", "Number of TCP received discarded for bad checksum", labelsTCP, nil) - tcpReceivedDiscardedForBadHeaderOffset = prometheus.NewDesc(prefix+"tcp_received_discarded_for_bad_header_offset", "Number of TCP received discarded for bad header offset", labelsTCP, nil) - tcpReceivedDiscardedBecausePacketTooShort = prometheus.NewDesc(prefix+"tcp_received_discarded_because_packet_too_short", "Number of TCP received discarded because packet too short", labelsTCP, nil) - tcpConnectionRequests = prometheus.NewDesc(prefix+"tcp_connection_requests", "Number of TCP connection requests", labelsTCP, nil) - tcpConnectionAccepts = prometheus.NewDesc(prefix+"tcp_connection_accepts", "Number of TCP connection accepts", labelsTCP, nil) - tcpBadConnectionAttempts = prometheus.NewDesc(prefix+"tcp_bad_connection_attempts", "Number of TCP bad connection attempts", labelsTCP, nil) - tcpListenQueueOverflows = prometheus.NewDesc(prefix+"tcp_listen_queue_overflows", "Number of TCP listen queue overflows", labelsTCP, nil) - tcpBadRstWindow = prometheus.NewDesc(prefix+"tcp_bad_rst_window", "Number of TCP bad rst window", labelsTCP, nil) - tcpConnectionsEstablished = prometheus.NewDesc(prefix+"tcp_connections_established", "Number of TCP connections established", labelsTCP, nil) - tcpConnectionsClosed = prometheus.NewDesc(prefix+"tcp_connections_closed", "Number of TCP connections closed", labelsTCP, nil) - tcpDrops = prometheus.NewDesc(prefix+"tcp_drops", "Number of TCP drops", labelsTCP, nil) - tcpConnectionsUpdatedRttOnClose = prometheus.NewDesc(prefix+"tcp_connections_updated_rtt_on_close", "Number of TCP connections updated rtt on close", labelsTCP, nil) - tcpConnectionsUpdatedVarianceOnClose = prometheus.NewDesc(prefix+"tcp_connections_updated_variance_on_close", "Number of TCP connections updated variance on close", labelsTCP, nil) - tcpConnectionsUpdatedSsthreshOnClose = prometheus.NewDesc(prefix+"tcp_connections_updated_ssthresh_on_close", "Number of TCP connections updated ssthresh on close", labelsTCP, nil) - tcpEmbryonicConnectionsDropped = prometheus.NewDesc(prefix+"tcp_embryonic_connections_dropped", "Number of TCP embryonic connections dropped", labelsTCP, nil) - tcpSegmentsUpdatedRtt = prometheus.NewDesc(prefix+"tcp_segments_updated_rtt", "Number of TCP segments updated rtt", labelsTCP, nil) - tcpAttempts = prometheus.NewDesc(prefix+"tcp_attempts", "Number of TCP attempts", labelsTCP, nil) - tcpRetransmitTimeouts = prometheus.NewDesc(prefix+"tcp_retransmit_timeouts", "Number of TCP retransmit timeouts", labelsTCP, nil) - tcpConnectionsDroppedByRetransmitTimeout = prometheus.NewDesc(prefix+"tcp_connections_dropped_by_retransmit_timeout", "Number of TCP connections dropped by retransmit timeout", labelsTCP, nil) - tcpPersistTimeouts = prometheus.NewDesc(prefix+"tcp_persist_timeouts", "Number of TCP persist timeouts", labelsTCP, nil) - tcpConnectionsDroppedByPersistTimeout = prometheus.NewDesc(prefix+"tcp_connections_dropped_by_persist_timeout", "Number of TCP connections dropped by persist timeout", labelsTCP, nil) - tcpKeepaliveTimeouts = prometheus.NewDesc(prefix+"tcp_keepalive_timeouts", "Number of TCP keepalive timeouts", labelsTCP, nil) - tcpKeepaliveProbesSent = prometheus.NewDesc(prefix+"tcp_keepalive_probes_sent", "Number of TCP keepalive probes sent", labelsTCP, nil) - tcpKeepaliveConnectionsDropped = prometheus.NewDesc(prefix+"tcp_keepalive_connections_dropped", "Number of TCP keepalive connections dropped", labelsTCP, nil) - tcpAckHeaderPredictions = prometheus.NewDesc(prefix+"tcp_ack_header_predictions", "Number of TCP ack header predictions", labelsTCP, nil) - tcpDataPacketHeaderPredictions = prometheus.NewDesc(prefix+"tcp_data_packet_header_predictions", "Number of TCP data packet header predictions", labelsTCP, nil) - tcpSyncacheEntriesAdded = prometheus.NewDesc(prefix+"tcp_syncache_entries_added", "Number of TCP syncache entries added", labelsTCP, nil) - tcpRetransmitted = prometheus.NewDesc(prefix+"tcp_retransmitted", "Number of TCP retransmitted", labelsTCP, nil) - tcpDupsyn = prometheus.NewDesc(prefix+"tcp_dupsyn", "Number of TCP dupsyn", labelsTCP, nil) - tcpDropped = prometheus.NewDesc(prefix+"tcp_dropped", "Number of TCP dropped", labelsTCP, nil) - tcpCompleted = prometheus.NewDesc(prefix+"tcp_completed", "Number of TCP completed", labelsTCP, nil) - tcpBucketOverflow = prometheus.NewDesc(prefix+"tcp_bucket_overflow", "Number of TCP bucket overflow", labelsTCP, nil) - tcpCacheOverflow = prometheus.NewDesc(prefix+"tcp_cache_overflow", "Number of TCP cache overflow", labelsTCP, nil) - tcpReset = prometheus.NewDesc(prefix+"tcp_reset", "Number of TCP reset", labelsTCP, nil) - tcpStale = prometheus.NewDesc(prefix+"tcp_stale", "Number of TCP stale", labelsTCP, nil) - tcpAborted = prometheus.NewDesc(prefix+"tcp_aborted", "Number of TCP aborted", labelsTCP, nil) - tcpBadack = prometheus.NewDesc(prefix+"tcp_badack", "Number of TCP badack", labelsTCP, nil) - tcpUnreach = prometheus.NewDesc(prefix+"tcp_unreach", "Number of TCP unreach", labelsTCP, nil) - tcpZoneFailures = prometheus.NewDesc(prefix+"tcp_zone_failures", "Number of TCP zone failures", labelsTCP, nil) - tcpCookiesSent = prometheus.NewDesc(prefix+"tcp_cookies_sent", "Number of TCP cookies sent", labelsTCP, nil) - tcpCookiesReceived = prometheus.NewDesc(prefix+"tcp_cookies_received", "Number of TCP cookies received", labelsTCP, nil) - tcpSackRecoveryEpisodes = prometheus.NewDesc(prefix+"tcp_sack_recovery_episodes", "Number of TCP sack recovery episodes", labelsTCP, nil) - tcpSegmentRetransmits = prometheus.NewDesc(prefix+"tcp_segment_retransmits", "Number of TCP segment retransmits", labelsTCP, nil) - tcpByteRetransmits = prometheus.NewDesc(prefix+"tcp_byte_retransmits", "Number of TCP byte retransmits", labelsTCP, nil) - tcpSackOptionsReceived = prometheus.NewDesc(prefix+"tcp_sack_options_received", "Number of TCP sack options received", labelsTCP, nil) - tcpSackOptionsSent = prometheus.NewDesc(prefix+"tcp_sack_options_sent", "Number of TCP sack options sent", labelsTCP, nil) - tcpSackScoreboardOverflow = prometheus.NewDesc(prefix+"tcp_sack_scoreboard_overflow", "Number of TCP sack scoreboard overflow", labelsTCP, nil) - tcpAcksSentInResponseButNotExactRsts = prometheus.NewDesc(prefix+"tcp_acks_sent_in_response_but_not_exact_rsts", "Number of TCP acks sent in response but not exact rsts", labelsTCP, nil) - tcpAcksSentInResponseToSynsOnEstablishedConnections = prometheus.NewDesc(prefix+"tcp_ack_sent_in_response_to_syns_on_established_connections", "Number of TCP acks sent in response to syns on established connections", labelsTCP, nil) - tcpRcvPacketsDroppedDueToBadAddress = prometheus.NewDesc(prefix+"tcp_rcv_packets_dropped_due_to_bad_address", "Number of TCP rcv packets dropped due to bad address", labelsTCP, nil) - tcpOutOfSequenceSegmentDrops = prometheus.NewDesc(prefix+"tcp_out_of_sequence_segment_drops", "Number of TCP out of sequence segment drops", labelsTCP, nil) - tcpRstPackets = prometheus.NewDesc(prefix+"tcp_rst_packets", "Number of TCP rst packets", labelsTCP, nil) - tcpIcmpPacketsIgnored = prometheus.NewDesc(prefix+"tcp_icmp_packets_ignored", "Number of TCP icmp packets ignored", labelsTCP, nil) - tcpSendPacketsDropped = prometheus.NewDesc(prefix+"tcp_send_packets_dropped", "Number of TCP send packets dropped", labelsTCP, nil) - tcpRcvPacketsDropped = prometheus.NewDesc(prefix+"tcp_rcv_packets_dropped", "Number of TCP rcv packets dropped", labelsTCP, nil) - tcpOutgoingSegmentsDropped = prometheus.NewDesc(prefix+"tcp_outgoing_segments_dropped", "Number of TCP outgoing segments dropped", labelsTCP, nil) - tcpReceivedSynfinDropped = prometheus.NewDesc(prefix+"tcp_received_synfin_dropped", "Number of TCP received synfin dropped", labelsTCP, nil) - tcpReceivedIpsecDropped = prometheus.NewDesc(prefix+"tcp_received_ipsec_dropped", "Number of TCP received ipsec dropped", labelsTCP, nil) - tcpReceivedMacDropped = prometheus.NewDesc(prefix+"tcp_received_mac_dropped", "Number of TCP received mac dropped", labelsTCP, nil) - tcpReceivedMinttlExceeded = prometheus.NewDesc(prefix+"tcp_received_minttl_exceeded", "Number of TCP received minttl exceeded", labelsTCP, nil) - tcpListenstateBadflagsDropped = prometheus.NewDesc(prefix+"tcp_listenstate_badflags_dropped", "Number of TCP listenstate badflags dropped", labelsTCP, nil) - tcpFinwaitstateBadflagsDropped = prometheus.NewDesc(prefix+"tcp_finwaitstate_badflags_dropped", "Number of TCP finwaitstate badflags dropped", labelsTCP, nil) - tcpReceivedDosAttack = prometheus.NewDesc(prefix+"tcp_received_dos_attack", "Number of tcp received dos attack", labelsTCP, nil) - tcpReceivedBadSynack = prometheus.NewDesc(prefix+"tcp_received_bad_synack", "Number of tcp received bad synack", labelsTCP, nil) - tcpSyncacheZoneFull = prometheus.NewDesc(prefix+"tcp_syncache_zone_full", "Number of TCP syncache zone full", labelsTCP, nil) - tcpReceivedRstFirewallfilter = prometheus.NewDesc(prefix+"tcp_received_rst_firewallfilter", "Number of TCP received rst firewallfilter", labelsTCP, nil) - tcpReceivedNoackTimewait = prometheus.NewDesc(prefix+"tcp_received_noack_timewait", "Number of TCP received noack timewait", labelsTCP, nil) - tcpReceivedNoTimewaitState = prometheus.NewDesc(prefix+"tcp_received_no_timewait_state", "Number of TCP received no timewait state", labelsTCP, nil) - tcpReceivedRstTimewaitState = prometheus.NewDesc(prefix+"tcp_received_rst_timewait_state", "Number of TCP received rst timewait state", labelsTCP, nil) - tcpReceivedTimewaitDrops = prometheus.NewDesc(prefix+"tcp_received_timewait_drops", "Number of TCP received timewait drops", labelsTCP, nil) - tcpReceivedBadaddrTimewaitState = prometheus.NewDesc(prefix+"tcp_received_badaddr_timewait_state", "Number of TCP received badaddr timewait state", labelsTCP, nil) - tcpReceivedAckoffInSynSentrcvd = prometheus.NewDesc(prefix+"tcp_received_ackoff_insyn_sentrcvd", "Number of TCP received ackoff in syn sentrcvd", labelsTCP, nil) - tcpReceivedBadaddrFirewall = prometheus.NewDesc(prefix+"tcp_received_badaddr_firewall", "Number of TCP received badaddr firewall", labelsTCP, nil) - tcpReceivedNosynSynSent = prometheus.NewDesc(prefix+"tcp_received_nosyn_synsent", "Number of TCP received nosyn synsent", labelsTCP, nil) - tcpReceivedBadrstSynSent = prometheus.NewDesc(prefix+"tcp_received_badrst_synsent", "Number of TCP received badrst synsent", labelsTCP, nil) - tcpReceivedBadrstListenState = prometheus.NewDesc(prefix+"tcp_received_badrst_listenstate", "Number of TCP received badrst listenstate", labelsTCP, nil) - tcpOptionMaxsegmentLength = prometheus.NewDesc(prefix+"tcp_option_maxsegment_length", "Number of TCP option maxsegment length", labelsTCP, nil) - tcpOptionWindowLength = prometheus.NewDesc(prefix+"tcp_option_window_length", "Number of TCP option window length", labelsTCP, nil) - tcpOptionTimestampLength = prometheus.NewDesc(prefix+"tcp_option_timestamp_length", "Number of TCP option timestamp length", labelsTCP, nil) - tcpOptionMd5Length = prometheus.NewDesc(prefix+"tcp_option_md5_length", "Number of TCP option md5 length", labelsTCP, nil) - tcpOptionAuthLength = prometheus.NewDesc(prefix+"tcp_option_auth_length", "Number of TCP option auth length", labelsTCP, nil) - tcpOptionSackpermittedLength = prometheus.NewDesc(prefix+"tcp_option_sackpermitted_length", "Number of TCP option sackpermitted length", labelsTCP, nil) - tcpOptionSackLength = prometheus.NewDesc(prefix+"tcp_option_sack_length", "Number of TCP option sack length", labelsTCP, nil) - tcpOptionAuthoptionLength = prometheus.NewDesc(prefix+"tcp_option_authoption_length", "Number of TCP option authoption length", labelsTCP, nil) + tcpPacketsSentDesc = prometheus.NewDesc(prefix+"tcp_packets_sent", "Number of TCP packets sent", labelsTCP, nil) + tcpSentDataPacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_data_packets", "Number of TCP sent data packets", labelsTCP, nil) + tcpDataPacketsBytesDesc = prometheus.NewDesc(prefix+"tcp_data_packets_bytes", "Number of TCP data packets bytes", labelsTCP, nil) + tcpSentDataPacketsRetransmittedDesc = prometheus.NewDesc(prefix+"tcp_sent_data_packets_retransmitted", "Number of TCP sent data packets retransmitted", labelsTCP, nil) + tcpRetransmittedBytesDesc = prometheus.NewDesc(prefix+"tcp_retransmitted_bytes", "Number of TCP retransmitted bytes", labelsTCP, nil) + tcpSentDataUnnecessaryRetransmittedDesc = prometheus.NewDesc(prefix+"tcp_sent_data_unnecessary_retransmitted", "Number of tcp data unnecessary retransmitted packets", labelsTCP, nil) + tcpSentResendsByMtuDiscoveryDesc = prometheus.NewDesc(prefix+"tcp_sent_resends_by_mtu_discovery", "Number of tcp sent resends by mtu discovery", labelsTCP, nil) + tcpSentAckOnlyPacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_ack_only_packets", "Number of tcp sent ack only packets", labelsTCP, nil) + tcpSentPacketsDelayedDesc = prometheus.NewDesc(prefix+"tcp_sent_packets_delayed", "Number of tcp sent packets delayed", labelsTCP, nil) + tcpSentUrgOnlyPacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_urg_only_packets", "Number of tcp sent urg only packets", labelsTCP, nil) + tcpSentWindowProbePacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_window_probe_packets", "Number of tcp sent window probe packets", labelsTCP, nil) + tcpSentWindowUpdatePacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_window_update_packets", "Number of tcp sent window update packets", labelsTCP, nil) + tcpSentControlPacketsDesc = prometheus.NewDesc(prefix+"tcp_sent_control_packets", "Number of tcp sent control packets", labelsTCP, nil) + tcpPacketsReceivedDesc = prometheus.NewDesc(prefix+"tcp_packets_received", "Number of TCP packets received", labelsTCP, nil) + tcpReceivedAcksDesc = prometheus.NewDesc(prefix+"tcp_received_acks", "Number of TCP received acks", labelsTCP, nil) + tcpAcksBytesDesc = prometheus.NewDesc(prefix+"tcp_acks_bytes", "Number of TCP acks bytes", labelsTCP, nil) + tcpReceivedDuplicateAcksDesc = prometheus.NewDesc(prefix+"tcp_received_duplicate_acks", "Number of TCP received duplicate acks", labelsTCP, nil) + tcpReceivedAcksForUnsentDataDesc = prometheus.NewDesc(prefix+"tcp_received_acks_for_unsent_data", "Number of TCP received acks for unsent data", labelsTCP, nil) + tcpPacketsReceivedInSequenceDesc = prometheus.NewDesc(prefix+"tcp_packets_received_in_sequence", "Number of TCP packets received in sequence", labelsTCP, nil) + tcpInSequenceBytesDesc = prometheus.NewDesc(prefix+"tcp_in_sequence_bytes", "Number of TCP in sequence bytes", labelsTCP, nil) + tcpReceivedCompletelyDuplicatePacketDesc = prometheus.NewDesc(prefix+"tcp_received_completely_duplicate_packet", "Number of TCP received completely duplicate packet", labelsTCP, nil) + tcpDuplicateInBytesDesc = prometheus.NewDesc(prefix+"tcp_duplicate_in_bytes", "Number of TCP duplicate in bytes", labelsTCP, nil) + tcpReceivedOldDuplicatePacketsDesc = prometheus.NewDesc(prefix+"tcp_received_old_duplicate_packets", "Number of TCP received old duplicate packets", labelsTCP, nil) + tcpReceivedPacketsWithSomeDupliacteDataDesc = prometheus.NewDesc(prefix+"tcp_received_packet_with_some_duplicate_data", "Number of TCP received packet with some duplicate data", labelsTCP, nil) + tcpSomeDuplicateInBytesDesc = prometheus.NewDesc(prefix+"tcp_some_duplicate_in_bytes", "Number of TCP some duplicate in bytes", labelsTCP, nil) + tcpReceivedOutOfOrderPacketsDesc = prometheus.NewDesc(prefix+"tcp_received_out_of_order_packets", "Number of TCP received out of order packets", labelsTCP, nil) + tcpOutOfOrderInBytesDesc = prometheus.NewDesc(prefix+"tcp_out_of_order_in_bytes", "Number of TCP out of order in bytes", labelsTCP, nil) + tcpReceivedPacketsOfDataAfterWindowDesc = prometheus.NewDesc(prefix+"tcp_received_packets_of_data_after_window", "Number of TCP received packets of data after window", labelsTCP, nil) + tcpBytesDesc = prometheus.NewDesc(prefix+"tcp_bytes", "Number of TCP bytes", labelsTCP, nil) + tcpReceivedWindowProbesDesc = prometheus.NewDesc(prefix+"tcp_received_window_probes", "Number of TCP received window probes", labelsTCP, nil) + tcpReceivedWindowUpdatePacketsDesc = prometheus.NewDesc(prefix+"tcp_received_window_update_packets", "Number of TCP received window update packets", labelsTCP, nil) + tcpPacketsReceivedAfterCloseDesc = prometheus.NewDesc(prefix+"tcp_packets_received_after_close", "Number of TCP packets received after close", labelsTCP, nil) + tcpReceivedDiscardedForBadChecksumDesc = prometheus.NewDesc(prefix+"tcp_received_discarded_for_bad_checksum", "Number of TCP received discarded for bad checksum", labelsTCP, nil) + tcpReceivedDiscardedForBadHeaderOffsetDesc = prometheus.NewDesc(prefix+"tcp_received_discarded_for_bad_header_offset", "Number of TCP received discarded for bad header offset", labelsTCP, nil) + tcpReceivedDiscardedBecausePacketTooShortDesc = prometheus.NewDesc(prefix+"tcp_received_discarded_because_packet_too_short", "Number of TCP received discarded because packet too short", labelsTCP, nil) + tcpConnectionRequestsDesc = prometheus.NewDesc(prefix+"tcp_connection_requests", "Number of TCP connection requests", labelsTCP, nil) + tcpConnectionAcceptsDesc = prometheus.NewDesc(prefix+"tcp_connection_accepts", "Number of TCP connection accepts", labelsTCP, nil) + tcpBadConnectionAttemptsDesc = prometheus.NewDesc(prefix+"tcp_bad_connection_attempts", "Number of TCP bad connection attempts", labelsTCP, nil) + tcpListenQueueOverflowsDesc = prometheus.NewDesc(prefix+"tcp_listen_queue_overflows", "Number of TCP listen queue overflows", labelsTCP, nil) + tcpBadRstWindowDesc = prometheus.NewDesc(prefix+"tcp_bad_rst_window", "Number of TCP bad rst window", labelsTCP, nil) + tcpConnectionsEstablishedDesc = prometheus.NewDesc(prefix+"tcp_connections_established", "Number of TCP connections established", labelsTCP, nil) + tcpConnectionsClosedDesc = prometheus.NewDesc(prefix+"tcp_connections_closed", "Number of TCP connections closed", labelsTCP, nil) + tcpDropsDesc = prometheus.NewDesc(prefix+"tcp_drops", "Number of TCP drops", labelsTCP, nil) + tcpConnectionsUpdatedRttOnCloseDesc = prometheus.NewDesc(prefix+"tcp_connections_updated_rtt_on_close", "Number of TCP connections updated rtt on close", labelsTCP, nil) + tcpConnectionsUpdatedVarianceOnCloseDesc = prometheus.NewDesc(prefix+"tcp_connections_updated_variance_on_close", "Number of TCP connections updated variance on close", labelsTCP, nil) + tcpConnectionsUpdatedSsthreshOnCloseDesc = prometheus.NewDesc(prefix+"tcp_connections_updated_ssthresh_on_close", "Number of TCP connections updated ssthresh on close", labelsTCP, nil) + tcpEmbryonicConnectionsDroppedDesc = prometheus.NewDesc(prefix+"tcp_embryonic_connections_dropped", "Number of TCP embryonic connections dropped", labelsTCP, nil) + tcpSegmentsUpdatedRttDesc = prometheus.NewDesc(prefix+"tcp_segments_updated_rtt", "Number of TCP segments updated rtt", labelsTCP, nil) + tcpAttemptsDesc = prometheus.NewDesc(prefix+"tcp_attempts", "Number of TCP attempts", labelsTCP, nil) + tcpRetransmitTimeoutsDesc = prometheus.NewDesc(prefix+"tcp_retransmit_timeouts", "Number of TCP retransmit timeouts", labelsTCP, nil) + tcpConnectionsDroppedByRetransmitTimeoutDesc = prometheus.NewDesc(prefix+"tcp_connections_dropped_by_retransmit_timeout", "Number of TCP connections dropped by retransmit timeout", labelsTCP, nil) + tcpPersistTimeoutsDesc = prometheus.NewDesc(prefix+"tcp_persist_timeouts", "Number of TCP persist timeouts", labelsTCP, nil) + tcpConnectionsDroppedByPersistTimeoutDesc = prometheus.NewDesc(prefix+"tcp_connections_dropped_by_persist_timeout", "Number of TCP connections dropped by persist timeout", labelsTCP, nil) + tcpKeepaliveTimeoutsDesc = prometheus.NewDesc(prefix+"tcp_keepalive_timeouts", "Number of TCP keepalive timeouts", labelsTCP, nil) + tcpKeepaliveProbesSentDesc = prometheus.NewDesc(prefix+"tcp_keepalive_probes_sent", "Number of TCP keepalive probes sent", labelsTCP, nil) + tcpKeepaliveConnectionsDroppedDesc = prometheus.NewDesc(prefix+"tcp_keepalive_connections_dropped", "Number of TCP keepalive connections dropped", labelsTCP, nil) + tcpAckHeaderPredictionsDesc = prometheus.NewDesc(prefix+"tcp_ack_header_predictions", "Number of TCP ack header predictions", labelsTCP, nil) + tcpDataPacketHeaderPredictionsDesc = prometheus.NewDesc(prefix+"tcp_data_packet_header_predictions", "Number of TCP data packet header predictions", labelsTCP, nil) + tcpSyncacheEntriesAddedDesc = prometheus.NewDesc(prefix+"tcp_syncache_entries_added", "Number of TCP syncache entries added", labelsTCP, nil) + tcpRetransmittedDesc = prometheus.NewDesc(prefix+"tcp_retransmitted", "Number of TCP retransmitted", labelsTCP, nil) + tcpDupsynDesc = prometheus.NewDesc(prefix+"tcp_dupsyn", "Number of TCP dupsyn", labelsTCP, nil) + tcpDroppedDesc = prometheus.NewDesc(prefix+"tcp_dropped", "Number of TCP dropped", labelsTCP, nil) + tcpCompletedDesc = prometheus.NewDesc(prefix+"tcp_completed", "Number of TCP completed", labelsTCP, nil) + tcpBucketOverflowDesc = prometheus.NewDesc(prefix+"tcp_bucket_overflow", "Number of TCP bucket overflow", labelsTCP, nil) + tcpCacheOverflowDesc = prometheus.NewDesc(prefix+"tcp_cache_overflow", "Number of TCP cache overflow", labelsTCP, nil) + tcpResetDesc = prometheus.NewDesc(prefix+"tcp_reset", "Number of TCP reset", labelsTCP, nil) + tcpStaleDesc = prometheus.NewDesc(prefix+"tcp_stale", "Number of TCP stale", labelsTCP, nil) + tcpAbortedDesc = prometheus.NewDesc(prefix+"tcp_aborted", "Number of TCP aborted", labelsTCP, nil) + tcpBadackDesc = prometheus.NewDesc(prefix+"tcp_badack", "Number of TCP badack", labelsTCP, nil) + tcpUnreachDesc = prometheus.NewDesc(prefix+"tcp_unreach", "Number of TCP unreach", labelsTCP, nil) + tcpZoneFailuresDesc = prometheus.NewDesc(prefix+"tcp_zone_failures", "Number of TCP zone failures", labelsTCP, nil) + tcpCookiesSentDesc = prometheus.NewDesc(prefix+"tcp_cookies_sent", "Number of TCP cookies sent", labelsTCP, nil) + tcpCookiesReceivedDesc = prometheus.NewDesc(prefix+"tcp_cookies_received", "Number of TCP cookies received", labelsTCP, nil) + tcpSackRecoveryEpisodesDesc = prometheus.NewDesc(prefix+"tcp_sack_recovery_episodes", "Number of TCP sack recovery episodes", labelsTCP, nil) + tcpSegmentRetransmitsDesc = prometheus.NewDesc(prefix+"tcp_segment_retransmits", "Number of TCP segment retransmits", labelsTCP, nil) + tcpByteRetransmitsDesc = prometheus.NewDesc(prefix+"tcp_byte_retransmits", "Number of TCP byte retransmits", labelsTCP, nil) + tcpSackOptionsReceivedDesc = prometheus.NewDesc(prefix+"tcp_sack_options_received", "Number of TCP sack options received", labelsTCP, nil) + tcpSackOptionsSentDesc = prometheus.NewDesc(prefix+"tcp_sack_options_sent", "Number of TCP sack options sent", labelsTCP, nil) + tcpSackScoreboardOverflowDesc = prometheus.NewDesc(prefix+"tcp_sack_scoreboard_overflow", "Number of TCP sack scoreboard overflow", labelsTCP, nil) + tcpAcksSentInResponseButNotExactRstsDesc = prometheus.NewDesc(prefix+"tcp_acks_sent_in_response_but_not_exact_rsts", "Number of TCP acks sent in response but not exact rsts", labelsTCP, nil) + tcpAcksSentInResponseToSynsOnEstablishedConnectionsDesc = prometheus.NewDesc(prefix+"tcp_ack_sent_in_response_to_syns_on_established_connections", "Number of TCP acks sent in response to syns on established connections", labelsTCP, nil) + tcpRcvPacketsDroppedDueToBadAddressDesc = prometheus.NewDesc(prefix+"tcp_rcv_packets_dropped_due_to_bad_address", "Number of TCP rcv packets dropped due to bad address", labelsTCP, nil) + tcpOutOfSequenceSegmentDropsDesc = prometheus.NewDesc(prefix+"tcp_out_of_sequence_segment_drops", "Number of TCP out of sequence segment drops", labelsTCP, nil) + tcpRstPacketsDesc = prometheus.NewDesc(prefix+"tcp_rst_packets", "Number of TCP rst packets", labelsTCP, nil) + tcpIcmpPacketsIgnoredDesc = prometheus.NewDesc(prefix+"tcp_icmp_packets_ignored", "Number of TCP icmp packets ignored", labelsTCP, nil) + tcpSendPacketsDroppedDesc = prometheus.NewDesc(prefix+"tcp_send_packets_dropped", "Number of TCP send packets dropped", labelsTCP, nil) + tcpRcvPacketsDroppedDesc = prometheus.NewDesc(prefix+"tcp_rcv_packets_dropped", "Number of TCP rcv packets dropped", labelsTCP, nil) + tcpOutgoingSegmentsDroppedDesc = prometheus.NewDesc(prefix+"tcp_outgoing_segments_dropped", "Number of TCP outgoing segments dropped", labelsTCP, nil) + tcpReceivedSynfinDroppedDesc = prometheus.NewDesc(prefix+"tcp_received_synfin_dropped", "Number of TCP received synfin dropped", labelsTCP, nil) + tcpReceivedIpsecDroppedDesc = prometheus.NewDesc(prefix+"tcp_received_ipsec_dropped", "Number of TCP received ipsec dropped", labelsTCP, nil) + tcpReceivedMacDroppedDesc = prometheus.NewDesc(prefix+"tcp_received_mac_dropped", "Number of TCP received mac dropped", labelsTCP, nil) + tcpReceivedMinttlExceededDesc = prometheus.NewDesc(prefix+"tcp_received_minttl_exceeded", "Number of TCP received minttl exceeded", labelsTCP, nil) + tcpListenstateBadflagsDroppedDesc = prometheus.NewDesc(prefix+"tcp_listenstate_badflags_dropped", "Number of TCP listenstate badflags dropped", labelsTCP, nil) + tcpFinwaitstateBadflagsDroppedDesc = prometheus.NewDesc(prefix+"tcp_finwaitstate_badflags_dropped", "Number of TCP finwaitstate badflags dropped", labelsTCP, nil) + tcpReceivedDosAttackDesc = prometheus.NewDesc(prefix+"tcp_received_dos_attack", "Number of tcp received dos attack", labelsTCP, nil) + tcpReceivedBadSynackDesc = prometheus.NewDesc(prefix+"tcp_received_bad_synack", "Number of tcp received bad synack", labelsTCP, nil) + tcpSyncacheZoneFullDesc = prometheus.NewDesc(prefix+"tcp_syncache_zone_full", "Number of TCP syncache zone full", labelsTCP, nil) + tcpReceivedRstFirewallfilterDesc = prometheus.NewDesc(prefix+"tcp_received_rst_firewallfilter", "Number of TCP received rst firewallfilter", labelsTCP, nil) + tcpReceivedNoackTimewaitDesc = prometheus.NewDesc(prefix+"tcp_received_noack_timewait", "Number of TCP received noack timewait", labelsTCP, nil) + tcpReceivedNoTimewaitStateDesc = prometheus.NewDesc(prefix+"tcp_received_no_timewait_state", "Number of TCP received no timewait state", labelsTCP, nil) + tcpReceivedRstTimewaitStateDesc = prometheus.NewDesc(prefix+"tcp_received_rst_timewait_state", "Number of TCP received rst timewait state", labelsTCP, nil) + tcpReceivedTimewaitDropsDesc = prometheus.NewDesc(prefix+"tcp_received_timewait_drops", "Number of TCP received timewait drops", labelsTCP, nil) + tcpReceivedBadaddrTimewaitStateDesc = prometheus.NewDesc(prefix+"tcp_received_badaddr_timewait_state", "Number of TCP received badaddr timewait state", labelsTCP, nil) + tcpReceivedAckoffInSynSentrcvdDesc = prometheus.NewDesc(prefix+"tcp_received_ackoff_insyn_sentrcvd", "Number of TCP received ackoff in syn sentrcvd", labelsTCP, nil) + tcpReceivedBadaddrFirewallDesc = prometheus.NewDesc(prefix+"tcp_received_badaddr_firewall", "Number of TCP received badaddr firewall", labelsTCP, nil) + tcpReceivedNosynSynSentDesc = prometheus.NewDesc(prefix+"tcp_received_nosyn_synsent", "Number of TCP received nosyn synsent", labelsTCP, nil) + tcpReceivedBadrstSynSentDesc = prometheus.NewDesc(prefix+"tcp_received_badrst_synsent", "Number of TCP received badrst synsent", labelsTCP, nil) + tcpReceivedBadrstListenStateDesc = prometheus.NewDesc(prefix+"tcp_received_badrst_listenstate", "Number of TCP received badrst listenstate", labelsTCP, nil) + tcpOptionMaxsegmentLengthDesc = prometheus.NewDesc(prefix+"tcp_option_maxsegment_length", "Number of TCP option maxsegment length", labelsTCP, nil) + tcpOptionWindowLengthDesc = prometheus.NewDesc(prefix+"tcp_option_window_length", "Number of TCP option window length", labelsTCP, nil) + tcpOptionTimestampLengthDesc = prometheus.NewDesc(prefix+"tcp_option_timestamp_length", "Number of TCP option timestamp length", labelsTCP, nil) + tcpOptionMd5LengthDesc = prometheus.NewDesc(prefix+"tcp_option_md5_length", "Number of TCP option md5 length", labelsTCP, nil) + tcpOptionAuthLengthDesc = prometheus.NewDesc(prefix+"tcp_option_auth_length", "Number of TCP option auth length", labelsTCP, nil) + tcpOptionSackpermittedLengthDesc = prometheus.NewDesc(prefix+"tcp_option_sackpermitted_length", "Number of TCP option sackpermitted length", labelsTCP, nil) + tcpOptionSackLengthDesc = prometheus.NewDesc(prefix+"tcp_option_sack_length", "Number of TCP option sack length", labelsTCP, nil) + tcpOptionAuthoptionLengthDesc = prometheus.NewDesc(prefix+"tcp_option_authoption_length", "Number of TCP option authoption length", labelsTCP, nil) labelsARP := []string{"target", "protocol"} arpDatagramsReceivedDesc = prometheus.NewDesc(prefix+"arp_datagrams_received", "Number of ARP datagrams received", labelsARP, nil) @@ -893,122 +893,122 @@ func (c *systemstatisticsCollector) Describe(ch chan<- *prometheus.Desc) { ch <- udpDatagramsDeliveredDesc ch <- udpDatagramsOutputDesc - ch <- tcpPacketsSent - ch <- tcpSentDataPackets - ch <- tcpDataPacketsBytes - ch <- tcpSentDataPacketsRetransmitted - ch <- tcpRetransmittedBytes - ch <- tcpSentDataUnnecessaryRetransmitted - ch <- tcpSentResendsByMtuDiscovery - ch <- tcpSentAckOnlyPackets - ch <- tcpSentPacketsDelayed - ch <- tcpSentUrgOnlyPackets - ch <- tcpSentWindowProbePackets - ch <- tcpSentWindowUpdatePackets - ch <- tcpSentControlPackets - ch <- tcpPacketsReceived - ch <- tcpReceivedAcks - ch <- tcpAcksBytes - ch <- tcpReceivedDuplicateAcks - ch <- tcpReceivedAcksForUnsentData - ch <- tcpPacketsReceivedInSequence - ch <- tcpInSequenceBytes - ch <- tcpReceivedCompletelyDuplicatePacket - ch <- tcpDuplicateInBytes - ch <- tcpReceivedOldDuplicatePackets - ch <- tcpReceivedPacketsWithSomeDupliacteData - ch <- tcpSomeDuplicateInBytes - ch <- tcpReceivedOutOfOrderPackets - ch <- tcpOutOfOrderInBytes - ch <- tcpReceivedPacketsOfDataAfterWindow - ch <- tcpBytes - ch <- tcpReceivedWindowProbes - ch <- tcpReceivedWindowUpdatePackets - ch <- tcpPacketsReceivedAfterClose - ch <- tcpReceivedDiscardedForBadChecksum - ch <- tcpReceivedDiscardedForBadHeaderOffset - ch <- tcpReceivedDiscardedBecausePacketTooShort - ch <- tcpConnectionRequests - ch <- tcpConnectionAccepts - ch <- tcpBadConnectionAttempts - ch <- tcpListenQueueOverflows - ch <- tcpBadRstWindow - ch <- tcpConnectionsEstablished - ch <- tcpConnectionsClosed - ch <- tcpDrops - ch <- tcpConnectionsUpdatedRttOnClose - ch <- tcpConnectionsUpdatedVarianceOnClose - ch <- tcpConnectionsUpdatedSsthreshOnClose - ch <- tcpEmbryonicConnectionsDropped - ch <- tcpSegmentsUpdatedRtt - ch <- tcpAttempts - ch <- tcpRetransmitTimeouts - ch <- tcpConnectionsDroppedByRetransmitTimeout - ch <- tcpPersistTimeouts - ch <- tcpConnectionsDroppedByPersistTimeout - ch <- tcpKeepaliveTimeouts - ch <- tcpKeepaliveProbesSent - ch <- tcpKeepaliveConnectionsDropped - ch <- tcpAckHeaderPredictions - ch <- tcpDataPacketHeaderPredictions - ch <- tcpSyncacheEntriesAdded - ch <- tcpRetransmitted - ch <- tcpDupsyn - ch <- tcpDropped - ch <- tcpCompleted - ch <- tcpBucketOverflow - ch <- tcpCacheOverflow - ch <- tcpReset - ch <- tcpStale - ch <- tcpAborted - ch <- tcpBadack - ch <- tcpUnreach - ch <- tcpZoneFailures - ch <- tcpCookiesSent - ch <- tcpCookiesReceived - ch <- tcpSackRecoveryEpisodes - ch <- tcpSegmentRetransmits - ch <- tcpByteRetransmits - ch <- tcpSackOptionsReceived - ch <- tcpSackOptionsSent - ch <- tcpSackScoreboardOverflow - ch <- tcpAcksSentInResponseButNotExactRsts - ch <- tcpAcksSentInResponseToSynsOnEstablishedConnections - ch <- tcpRcvPacketsDroppedDueToBadAddress - ch <- tcpOutOfSequenceSegmentDrops - ch <- tcpRstPackets - ch <- tcpIcmpPacketsIgnored - ch <- tcpSendPacketsDropped - ch <- tcpRcvPacketsDropped - ch <- tcpOutgoingSegmentsDropped - ch <- tcpReceivedSynfinDropped - ch <- tcpReceivedIpsecDropped - ch <- tcpReceivedMacDropped - ch <- tcpReceivedMinttlExceeded - ch <- tcpListenstateBadflagsDropped - ch <- tcpFinwaitstateBadflagsDropped - ch <- tcpReceivedDosAttack - ch <- tcpReceivedBadSynack - ch <- tcpSyncacheZoneFull - ch <- tcpReceivedRstFirewallfilter - ch <- tcpReceivedNoackTimewait - ch <- tcpReceivedNoTimewaitState - ch <- tcpReceivedRstTimewaitState - ch <- tcpReceivedTimewaitDrops - ch <- tcpReceivedBadaddrTimewaitState - ch <- tcpReceivedAckoffInSynSentrcvd - ch <- tcpReceivedBadaddrFirewall - ch <- tcpReceivedNosynSynSent - ch <- tcpReceivedBadrstSynSent - ch <- tcpReceivedBadrstListenState - ch <- tcpOptionMaxsegmentLength - ch <- tcpOptionWindowLength - ch <- tcpOptionTimestampLength - ch <- tcpOptionMd5Length - ch <- tcpOptionAuthLength - ch <- tcpOptionSackpermittedLength - ch <- tcpOptionSackLength - ch <- tcpOptionAuthoptionLength + ch <- tcpPacketsSentDesc + ch <- tcpSentDataPacketsDesc + ch <- tcpDataPacketsBytesDesc + ch <- tcpSentDataPacketsRetransmittedDesc + ch <- tcpRetransmittedBytesDesc + ch <- tcpSentDataUnnecessaryRetransmittedDesc + ch <- tcpSentResendsByMtuDiscoveryDesc + ch <- tcpSentAckOnlyPacketsDesc + ch <- tcpSentPacketsDelayedDesc + ch <- tcpSentUrgOnlyPacketsDesc + ch <- tcpSentWindowProbePacketsDesc + ch <- tcpSentWindowUpdatePacketsDesc + ch <- tcpSentControlPacketsDesc + ch <- tcpPacketsReceivedDesc + ch <- tcpReceivedAcksDesc + ch <- tcpAcksBytesDesc + ch <- tcpReceivedDuplicateAcksDesc + ch <- tcpReceivedAcksForUnsentDataDesc + ch <- tcpPacketsReceivedInSequenceDesc + ch <- tcpInSequenceBytesDesc + ch <- tcpReceivedCompletelyDuplicatePacketDesc + ch <- tcpDuplicateInBytesDesc + ch <- tcpReceivedOldDuplicatePacketsDesc + ch <- tcpReceivedPacketsWithSomeDupliacteDataDesc + ch <- tcpSomeDuplicateInBytesDesc + ch <- tcpReceivedOutOfOrderPacketsDesc + ch <- tcpOutOfOrderInBytesDesc + ch <- tcpReceivedPacketsOfDataAfterWindowDesc + ch <- tcpBytesDesc + ch <- tcpReceivedWindowProbesDesc + ch <- tcpReceivedWindowUpdatePacketsDesc + ch <- tcpPacketsReceivedAfterCloseDesc + ch <- tcpReceivedDiscardedForBadChecksumDesc + ch <- tcpReceivedDiscardedForBadHeaderOffsetDesc + ch <- tcpReceivedDiscardedBecausePacketTooShortDesc + ch <- tcpConnectionRequestsDesc + ch <- tcpConnectionAcceptsDesc + ch <- tcpBadConnectionAttemptsDesc + ch <- tcpListenQueueOverflowsDesc + ch <- tcpBadRstWindowDesc + ch <- tcpConnectionsEstablishedDesc + ch <- tcpConnectionsClosedDesc + ch <- tcpDropsDesc + ch <- tcpConnectionsUpdatedRttOnCloseDesc + ch <- tcpConnectionsUpdatedVarianceOnCloseDesc + ch <- tcpConnectionsUpdatedSsthreshOnCloseDesc + ch <- tcpEmbryonicConnectionsDroppedDesc + ch <- tcpSegmentsUpdatedRttDesc + ch <- tcpAttemptsDesc + ch <- tcpRetransmitTimeoutsDesc + ch <- tcpConnectionsDroppedByRetransmitTimeoutDesc + ch <- tcpPersistTimeoutsDesc + ch <- tcpConnectionsDroppedByPersistTimeoutDesc + ch <- tcpKeepaliveTimeoutsDesc + ch <- tcpKeepaliveProbesSentDesc + ch <- tcpKeepaliveConnectionsDroppedDesc + ch <- tcpAckHeaderPredictionsDesc + ch <- tcpDataPacketHeaderPredictionsDesc + ch <- tcpSyncacheEntriesAddedDesc + ch <- tcpRetransmittedDesc + ch <- tcpDupsynDesc + ch <- tcpDroppedDesc + ch <- tcpCompletedDesc + ch <- tcpBucketOverflowDesc + ch <- tcpCacheOverflowDesc + ch <- tcpResetDesc + ch <- tcpStaleDesc + ch <- tcpAbortedDesc + ch <- tcpBadackDesc + ch <- tcpUnreachDesc + ch <- tcpZoneFailuresDesc + ch <- tcpCookiesSentDesc + ch <- tcpCookiesReceivedDesc + ch <- tcpSackRecoveryEpisodesDesc + ch <- tcpSegmentRetransmitsDesc + ch <- tcpByteRetransmitsDesc + ch <- tcpSackOptionsReceivedDesc + ch <- tcpSackOptionsSentDesc + ch <- tcpSackScoreboardOverflowDesc + ch <- tcpAcksSentInResponseButNotExactRstsDesc + ch <- tcpAcksSentInResponseToSynsOnEstablishedConnectionsDesc + ch <- tcpRcvPacketsDroppedDueToBadAddressDesc + ch <- tcpOutOfSequenceSegmentDropsDesc + ch <- tcpRstPacketsDesc + ch <- tcpIcmpPacketsIgnoredDesc + ch <- tcpSendPacketsDroppedDesc + ch <- tcpRcvPacketsDroppedDesc + ch <- tcpOutgoingSegmentsDroppedDesc + ch <- tcpReceivedSynfinDroppedDesc + ch <- tcpReceivedIpsecDroppedDesc + ch <- tcpReceivedMacDroppedDesc + ch <- tcpReceivedMinttlExceededDesc + ch <- tcpListenstateBadflagsDroppedDesc + ch <- tcpFinwaitstateBadflagsDroppedDesc + ch <- tcpReceivedDosAttackDesc + ch <- tcpReceivedBadSynackDesc + ch <- tcpSyncacheZoneFullDesc + ch <- tcpReceivedRstFirewallfilterDesc + ch <- tcpReceivedNoackTimewaitDesc + ch <- tcpReceivedNoTimewaitStateDesc + ch <- tcpReceivedRstTimewaitStateDesc + ch <- tcpReceivedTimewaitDropsDesc + ch <- tcpReceivedBadaddrTimewaitStateDesc + ch <- tcpReceivedAckoffInSynSentrcvdDesc + ch <- tcpReceivedBadaddrFirewallDesc + ch <- tcpReceivedNosynSynSentDesc + ch <- tcpReceivedBadrstSynSentDesc + ch <- tcpReceivedBadrstListenStateDesc + ch <- tcpOptionMaxsegmentLengthDesc + ch <- tcpOptionWindowLengthDesc + ch <- tcpOptionTimestampLengthDesc + ch <- tcpOptionMd5LengthDesc + ch <- tcpOptionAuthLengthDesc + ch <- tcpOptionSackpermittedLengthDesc + ch <- tcpOptionSackLengthDesc + ch <- tcpOptionAuthoptionLengthDesc ch <- arpDatagramsReceivedDesc ch <- arpRequestsReceivedDesc @@ -1262,7 +1262,7 @@ func (c *systemstatisticsCollector) collectSystemStatisticsIPV4(ch chan<- promet ch <- prometheus.MustNewConstMetric(ipv4TimestampOptionsDesc, prometheus.CounterValue, s.Statistics.Ip.TimestampOptions, labels...) ch <- prometheus.MustNewConstMetric(ipv4TimestampAndAddressOptionsDesc, prometheus.CounterValue, s.Statistics.Ip.TimestampAndAddressOptions, labels...) ch <- prometheus.MustNewConstMetric(ipv4TimestampAndPrespecifiedAddressOptionsDesc, prometheus.CounterValue, s.Statistics.Ip.TimestampAndPrespecifiedAddressOptions, labels...) - ch <- prometheus.MustNewConstMetric(ipv4OptionPacketsDroppedDueToRateLimitDesc, prometheus.CounterValue, s.Statistics.Ip.OptionPacketsDroppedDueToRateLimit, labels...) + ch <- prometheus.MustNewConstMetric(ipv4OptionPacketsDroppedDueToRateLimitDesc, prometheus.GaugeValue, s.Statistics.Ip.OptionPacketsDroppedDueToRateLimit, labels...) ch <- prometheus.MustNewConstMetric(ipv4RouterAlertOptionDesc, prometheus.CounterValue, s.Statistics.Ip.RouterAlertOptions, labels...) ch <- prometheus.MustNewConstMetric(ipv4MulticastPacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Ip.MulticastPacketsDropped, labels...) ch <- prometheus.MustNewConstMetric(ipv4PacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Ip.PacketsDropped, labels...) @@ -1286,7 +1286,7 @@ func (c *systemstatisticsCollector) collectSystemStatisticsIPV6(ch chan<- promet ch <- prometheus.MustNewConstMetric(ipv6FragmentsReceivedDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6FragmentsReceived, labels...) ch <- prometheus.MustNewConstMetric(ipv6DuplicateOrOutOfSpaceFragmentsDroppedDesc, prometheus.CounterValue, s.Statistics.Ip6.DuplicateOrOutOfSpaceFragmentsDropped, labels...) ch <- prometheus.MustNewConstMetric(ipv6FragmentsDroppedAfterTimeoutDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6FragmentsDroppedAfterTimeout, labels...) - ch <- prometheus.MustNewConstMetric(ipv6FragmentsThatExceededLimitDesc, prometheus.CounterValue, s.Statistics.Ip6.FragmentsThatExceededLimit, labels...) + ch <- prometheus.MustNewConstMetric(ipv6FragmentsThatExceededLimitDesc, prometheus.GaugeValue, s.Statistics.Ip6.FragmentsThatExceededLimit, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsReassembledOkDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6PacketsReassembledOk, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsForThisHostDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6PacketsForThisHost, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsForwardedDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6PacketsForwarded, labels...) @@ -1316,7 +1316,7 @@ func (c *systemstatisticsCollector) collectSystemStatisticsIPV6(ch chan<- promet ch <- prometheus.MustNewConstMetric(ipv6ForwardCacheHitDesc, prometheus.CounterValue, s.Statistics.Ip6.ForwardCacheHit, labels...) ch <- prometheus.MustNewConstMetric(ipv6ForwardCacheMissDesc, prometheus.CounterValue, s.Statistics.Ip6.ForwardCacheMiss, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsDestinedToDeadNextHopDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6PacketsDestinedToDeadNextHop, labels...) - ch <- prometheus.MustNewConstMetric(ipv6OptionPacketsDroppedDueToRateLimitDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6OptionPacketsDroppedDueToRateLimit, labels...) + ch <- prometheus.MustNewConstMetric(ipv6OptionPacketsDroppedDueToRateLimitDesc, prometheus.GaugeValue, s.Statistics.Ip6.Ip6OptionPacketsDroppedDueToRateLimit, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Ip6.Ip6PacketsDropped, labels...) ch <- prometheus.MustNewConstMetric(ipv6PacketsDroppedDueToBadProtocolDesc, prometheus.CounterValue, s.Statistics.Ip6.PacketsDroppedDueToBadProtocol, labels...) ch <- prometheus.MustNewConstMetric(ipv6TransitRePacketDroppedOnMgmtInterfaceDesc, prometheus.CounterValue, s.Statistics.Ip6.TransitRePacketDroppedOnMgmtInterface, labels...) @@ -1340,120 +1340,120 @@ func (c *systemstatisticsCollector) collectSystemStatisticsUDP(ch chan<- prometh func (c *systemstatisticsCollector) collectSystemStatisticsTCP(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { l := append(labelValues, "tcp") - ch <- prometheus.MustNewConstMetric(tcpPacketsSent, prometheus.CounterValue, s.Statistics.Tcp.PacketsSent, l...) - ch <- prometheus.MustNewConstMetric(tcpSentDataPackets, prometheus.CounterValue, s.Statistics.Tcp.SentDataPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpDataPacketsBytes, prometheus.CounterValue, s.Statistics.Tcp.DataPacketsBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpSentDataPacketsRetransmitted, prometheus.CounterValue, s.Statistics.Tcp.SentDataPacketsRetransmitted, l...) - ch <- prometheus.MustNewConstMetric(tcpRetransmittedBytes, prometheus.CounterValue, s.Statistics.Tcp.RetransmittedBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpSentDataUnnecessaryRetransmitted, prometheus.CounterValue, s.Statistics.Tcp.SentDataUnnecessaryRetransmitted, l...) - ch <- prometheus.MustNewConstMetric(tcpSentResendsByMtuDiscovery, prometheus.CounterValue, s.Statistics.Tcp.SentResendsByMtuDiscovery, l...) - ch <- prometheus.MustNewConstMetric(tcpSentAckOnlyPackets, prometheus.CounterValue, s.Statistics.Tcp.SentAckOnlyPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpSentPacketsDelayed, prometheus.CounterValue, s.Statistics.Tcp.SentPacketsDelayed, l...) - ch <- prometheus.MustNewConstMetric(tcpSentUrgOnlyPackets, prometheus.CounterValue, s.Statistics.Tcp.SentUrgOnlyPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpSentWindowProbePackets, prometheus.CounterValue, s.Statistics.Tcp.SentWindowProbePackets, l...) - ch <- prometheus.MustNewConstMetric(tcpSentWindowUpdatePackets, prometheus.CounterValue, s.Statistics.Tcp.SentWindowUpdatePackets, l...) - ch <- prometheus.MustNewConstMetric(tcpSentControlPackets, prometheus.CounterValue, s.Statistics.Tcp.SentControlPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpPacketsReceived, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceived, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedAcks, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAcks, l...) - ch <- prometheus.MustNewConstMetric(tcpAcksBytes, prometheus.CounterValue, s.Statistics.Tcp.AcksBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedDuplicateAcks, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDuplicateAcks, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedAcksForUnsentData, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAcksForUnsentData, l...) - ch <- prometheus.MustNewConstMetric(tcpPacketsReceivedInSequence, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceivedInSequence, l...) - ch <- prometheus.MustNewConstMetric(tcpInSequenceBytes, prometheus.CounterValue, s.Statistics.Tcp.InSequenceBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedCompletelyDuplicatePacket, prometheus.CounterValue, s.Statistics.Tcp.ReceivedCompletelyDuplicatePacket, l...) - ch <- prometheus.MustNewConstMetric(tcpDuplicateInBytes, prometheus.CounterValue, s.Statistics.Tcp.DuplicateInBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedOldDuplicatePackets, prometheus.CounterValue, s.Statistics.Tcp.ReceivedOldDuplicatePackets, l...) - ch <- prometheus.MustNewConstMetric(tcpSomeDuplicateInBytes, prometheus.CounterValue, s.Statistics.Tcp.SomeDuplicateInBytes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedOutOfOrderPackets, prometheus.CounterValue, s.Statistics.Tcp.ReceivedOutOfOrderPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedPacketsOfDataAfterWindow, prometheus.CounterValue, s.Statistics.Tcp.ReceivedPacketsOfDataAfterWindow, l...) - ch <- prometheus.MustNewConstMetric(tcpBytes, prometheus.CounterValue, s.Statistics.Tcp.Bytes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedWindowProbes, prometheus.CounterValue, s.Statistics.Tcp.ReceivedWindowProbes, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedWindowUpdatePackets, prometheus.CounterValue, s.Statistics.Tcp.ReceivedWindowUpdatePackets, l...) - ch <- prometheus.MustNewConstMetric(tcpPacketsReceivedAfterClose, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceivedAfterClose, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedForBadChecksum, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedForBadChecksum, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedForBadHeaderOffset, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedForBadHeaderOffset, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedBecausePacketTooShort, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedBecausePacketTooShort, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionRequests, prometheus.CounterValue, s.Statistics.Tcp.ConnectionRequests, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionAccepts, prometheus.CounterValue, s.Statistics.Tcp.ConnectionAccepts, l...) - ch <- prometheus.MustNewConstMetric(tcpBadConnectionAttempts, prometheus.CounterValue, s.Statistics.Tcp.BadConnectionAttempts, l...) - ch <- prometheus.MustNewConstMetric(tcpListenQueueOverflows, prometheus.CounterValue, s.Statistics.Tcp.ListenQueueOverflows, l...) - ch <- prometheus.MustNewConstMetric(tcpBadRstWindow, prometheus.CounterValue, s.Statistics.Tcp.BadRstWindow, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsEstablished, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsEstablished, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsClosed, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsClosed, l...) - ch <- prometheus.MustNewConstMetric(tcpDrops, prometheus.CounterValue, s.Statistics.Tcp.Drops, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedRttOnClose, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedRttOnClose, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedVarianceOnClose, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedVarianceOnClose, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedSsthreshOnClose, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedSsthreshOnClose, l...) - ch <- prometheus.MustNewConstMetric(tcpEmbryonicConnectionsDropped, prometheus.CounterValue, s.Statistics.Tcp.EmbryonicConnectionsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpSegmentsUpdatedRtt, prometheus.CounterValue, s.Statistics.Tcp.SegmentsUpdatedRtt, l...) - ch <- prometheus.MustNewConstMetric(tcpAttempts, prometheus.CounterValue, s.Statistics.Tcp.Attempts, l...) - ch <- prometheus.MustNewConstMetric(tcpRetransmitTimeouts, prometheus.CounterValue, s.Statistics.Tcp.RetransmitTimeouts, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsDroppedByRetransmitTimeout, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsDroppedByRetransmitTimeout, l...) - ch <- prometheus.MustNewConstMetric(tcpPersistTimeouts, prometheus.CounterValue, s.Statistics.Tcp.PersistTimeouts, l...) - ch <- prometheus.MustNewConstMetric(tcpConnectionsDroppedByPersistTimeout, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsDroppedByPersistTimeout, l...) - ch <- prometheus.MustNewConstMetric(tcpKeepaliveTimeouts, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveTimeouts, l...) - ch <- prometheus.MustNewConstMetric(tcpKeepaliveProbesSent, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveProbesSent, l...) - ch <- prometheus.MustNewConstMetric(tcpKeepaliveConnectionsDropped, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveConnectionsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpAckHeaderPredictions, prometheus.CounterValue, s.Statistics.Tcp.AckHeaderPredictions, l...) - ch <- prometheus.MustNewConstMetric(tcpDataPacketHeaderPredictions, prometheus.CounterValue, s.Statistics.Tcp.DataPacketHeaderPredictions, l...) - ch <- prometheus.MustNewConstMetric(tcpSyncacheEntriesAdded, prometheus.CounterValue, s.Statistics.Tcp.SyncacheEntriesAdded, l...) - ch <- prometheus.MustNewConstMetric(tcpRetransmitted, prometheus.CounterValue, s.Statistics.Tcp.Retransmitted, l...) - ch <- prometheus.MustNewConstMetric(tcpDupsyn, prometheus.CounterValue, s.Statistics.Tcp.Dupsyn, l...) - ch <- prometheus.MustNewConstMetric(tcpDropped, prometheus.CounterValue, s.Statistics.Tcp.Dropped, l...) - ch <- prometheus.MustNewConstMetric(tcpCompleted, prometheus.CounterValue, s.Statistics.Tcp.Completed, l...) - ch <- prometheus.MustNewConstMetric(tcpBucketOverflow, prometheus.CounterValue, s.Statistics.Tcp.BucketOverflow, l...) - ch <- prometheus.MustNewConstMetric(tcpCacheOverflow, prometheus.CounterValue, s.Statistics.Tcp.CacheOverflow, l...) - ch <- prometheus.MustNewConstMetric(tcpReset, prometheus.CounterValue, s.Statistics.Tcp.Reset, l...) - ch <- prometheus.MustNewConstMetric(tcpStale, prometheus.CounterValue, s.Statistics.Tcp.Stale, l...) - ch <- prometheus.MustNewConstMetric(tcpAborted, prometheus.CounterValue, s.Statistics.Tcp.Aborted, l...) - ch <- prometheus.MustNewConstMetric(tcpBadack, prometheus.CounterValue, s.Statistics.Tcp.Badack, l...) - ch <- prometheus.MustNewConstMetric(tcpUnreach, prometheus.CounterValue, s.Statistics.Tcp.Unreach, l...) - ch <- prometheus.MustNewConstMetric(tcpZoneFailures, prometheus.CounterValue, s.Statistics.Tcp.ZoneFailures, l...) - ch <- prometheus.MustNewConstMetric(tcpCookiesSent, prometheus.CounterValue, s.Statistics.Tcp.CookiesSent, l...) - ch <- prometheus.MustNewConstMetric(tcpCookiesReceived, prometheus.CounterValue, s.Statistics.Tcp.CookiesReceived, l...) - ch <- prometheus.MustNewConstMetric(tcpSackRecoveryEpisodes, prometheus.CounterValue, s.Statistics.Tcp.SackRecoveryEpisodes, l...) - ch <- prometheus.MustNewConstMetric(tcpSegmentRetransmits, prometheus.CounterValue, s.Statistics.Tcp.SegmentRetransmits, l...) - ch <- prometheus.MustNewConstMetric(tcpByteRetransmits, prometheus.CounterValue, s.Statistics.Tcp.ByteRetransmits, l...) - ch <- prometheus.MustNewConstMetric(tcpSackOptionsReceived, prometheus.CounterValue, s.Statistics.Tcp.SackOptionsReceived, l...) - ch <- prometheus.MustNewConstMetric(tcpSackOptionsSent, prometheus.CounterValue, s.Statistics.Tcp.SackOptionsReceived, l...) - ch <- prometheus.MustNewConstMetric(tcpSackScoreboardOverflow, prometheus.CounterValue, s.Statistics.Tcp.SackScoreboardOverflow, l...) - ch <- prometheus.MustNewConstMetric(tcpAcksSentInResponseButNotExactRsts, prometheus.CounterValue, s.Statistics.Tcp.AcksSentInResponseButNotExactRsts, l...) - ch <- prometheus.MustNewConstMetric(tcpAcksSentInResponseToSynsOnEstablishedConnections, prometheus.CounterValue, s.Statistics.Tcp.AcksSentInResponseToSynsOnEstablishedConnections, l...) - ch <- prometheus.MustNewConstMetric(tcpRcvPacketsDroppedDueToBadAddress, prometheus.CounterValue, s.Statistics.Tcp.RcvPacketsDroppedDueToBadAddress, l...) - ch <- prometheus.MustNewConstMetric(tcpOutOfSequenceSegmentDrops, prometheus.CounterValue, s.Statistics.Tcp.OutOfSequenceSegmentDrops, l...) - ch <- prometheus.MustNewConstMetric(tcpRstPackets, prometheus.CounterValue, s.Statistics.Tcp.RstPackets, l...) - ch <- prometheus.MustNewConstMetric(tcpIcmpPacketsIgnored, prometheus.CounterValue, s.Statistics.Tcp.IcmpPacketsIgnored, l...) - ch <- prometheus.MustNewConstMetric(tcpSendPacketsDropped, prometheus.CounterValue, s.Statistics.Tcp.SendPacketsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpRcvPacketsDropped, prometheus.CounterValue, s.Statistics.Tcp.RcvPacketsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpOutgoingSegmentsDropped, prometheus.CounterValue, s.Statistics.Tcp.OutgoingSegmentsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedSynfinDropped, prometheus.CounterValue, s.Statistics.Tcp.ReceivedSynfinDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedIpsecDropped, prometheus.CounterValue, s.Statistics.Tcp.ReceivedIpsecDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedMacDropped, prometheus.CounterValue, s.Statistics.Tcp.ReceivedMacDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedMinttlExceeded, prometheus.CounterValue, s.Statistics.Tcp.ReceivedMinttlExceeded, l...) - ch <- prometheus.MustNewConstMetric(tcpListenstateBadflagsDropped, prometheus.CounterValue, s.Statistics.Tcp.ListenstateBadflagsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpFinwaitstateBadflagsDropped, prometheus.CounterValue, s.Statistics.Tcp.FinwaitstateBadflagsDropped, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedDosAttack, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDosAttack, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedBadSynack, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadSynack, l...) - ch <- prometheus.MustNewConstMetric(tcpSyncacheZoneFull, prometheus.CounterValue, s.Statistics.Tcp.SyncacheZoneFull, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedRstFirewallfilter, prometheus.CounterValue, s.Statistics.Tcp.ReceivedRstFirewallfilter, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedNoackTimewait, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNoackTimewait, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedNoTimewaitState, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNoTimewaitState, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedRstTimewaitState, prometheus.CounterValue, s.Statistics.Tcp.ReceivedRstTimewaitState, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedTimewaitDrops, prometheus.CounterValue, s.Statistics.Tcp.ReceivedTimewaitDrops, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedBadaddrTimewaitState, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadaddrTimewaitState, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedAckoffInSynSentrcvd, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAckoffInSynSentrcvd, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedBadaddrFirewall, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadaddrFirewall, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedNosynSynSent, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNosynSynSent, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedBadrstSynSent, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadrstSynSent, l...) - ch <- prometheus.MustNewConstMetric(tcpReceivedBadrstListenState, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadrstListenState, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionMaxsegmentLength, prometheus.CounterValue, s.Statistics.Tcp.OptionMaxsegmentLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionWindowLength, prometheus.CounterValue, s.Statistics.Tcp.OptionWindowLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionTimestampLength, prometheus.CounterValue, s.Statistics.Tcp.OptionTimestampLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionMd5Length, prometheus.CounterValue, s.Statistics.Tcp.OptionMd5Length, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionAuthLength, prometheus.CounterValue, s.Statistics.Tcp.OptionAuthLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionSackpermittedLength, prometheus.CounterValue, s.Statistics.Tcp.OptionSackpermittedLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionSackLength, prometheus.CounterValue, s.Statistics.Tcp.OptionSackLength, l...) - ch <- prometheus.MustNewConstMetric(tcpOptionAuthoptionLength, prometheus.CounterValue, s.Statistics.Tcp.OptionAuthoptionLength, l...) + ch <- prometheus.MustNewConstMetric(tcpPacketsSentDesc, prometheus.CounterValue, s.Statistics.Tcp.PacketsSent, l...) + ch <- prometheus.MustNewConstMetric(tcpSentDataPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentDataPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpDataPacketsBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.DataPacketsBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpSentDataPacketsRetransmittedDesc, prometheus.CounterValue, s.Statistics.Tcp.SentDataPacketsRetransmitted, l...) + ch <- prometheus.MustNewConstMetric(tcpRetransmittedBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.RetransmittedBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpSentDataUnnecessaryRetransmittedDesc, prometheus.CounterValue, s.Statistics.Tcp.SentDataUnnecessaryRetransmitted, l...) + ch <- prometheus.MustNewConstMetric(tcpSentResendsByMtuDiscoveryDesc, prometheus.CounterValue, s.Statistics.Tcp.SentResendsByMtuDiscovery, l...) + ch <- prometheus.MustNewConstMetric(tcpSentAckOnlyPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentAckOnlyPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpSentPacketsDelayedDesc, prometheus.CounterValue, s.Statistics.Tcp.SentPacketsDelayed, l...) + ch <- prometheus.MustNewConstMetric(tcpSentUrgOnlyPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentUrgOnlyPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpSentWindowProbePacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentWindowProbePackets, l...) + ch <- prometheus.MustNewConstMetric(tcpSentWindowUpdatePacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentWindowUpdatePackets, l...) + ch <- prometheus.MustNewConstMetric(tcpSentControlPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.SentControlPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpPacketsReceivedDesc, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceived, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedAcksDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAcks, l...) + ch <- prometheus.MustNewConstMetric(tcpAcksBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.AcksBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedDuplicateAcksDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDuplicateAcks, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedAcksForUnsentDataDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAcksForUnsentData, l...) + ch <- prometheus.MustNewConstMetric(tcpPacketsReceivedInSequenceDesc, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceivedInSequence, l...) + ch <- prometheus.MustNewConstMetric(tcpInSequenceBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.InSequenceBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedCompletelyDuplicatePacketDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedCompletelyDuplicatePacket, l...) + ch <- prometheus.MustNewConstMetric(tcpDuplicateInBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.DuplicateInBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedOldDuplicatePacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedOldDuplicatePackets, l...) + ch <- prometheus.MustNewConstMetric(tcpSomeDuplicateInBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.SomeDuplicateInBytes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedOutOfOrderPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedOutOfOrderPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedPacketsOfDataAfterWindowDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedPacketsOfDataAfterWindow, l...) + ch <- prometheus.MustNewConstMetric(tcpBytesDesc, prometheus.CounterValue, s.Statistics.Tcp.Bytes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedWindowProbesDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedWindowProbes, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedWindowUpdatePacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedWindowUpdatePackets, l...) + ch <- prometheus.MustNewConstMetric(tcpPacketsReceivedAfterCloseDesc, prometheus.CounterValue, s.Statistics.Tcp.PacketsReceivedAfterClose, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedForBadChecksumDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedForBadChecksum, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedForBadHeaderOffsetDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedForBadHeaderOffset, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedDiscardedBecausePacketTooShortDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDiscardedBecausePacketTooShort, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionRequestsDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionRequests, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionAcceptsDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionAccepts, l...) + ch <- prometheus.MustNewConstMetric(tcpBadConnectionAttemptsDesc, prometheus.CounterValue, s.Statistics.Tcp.BadConnectionAttempts, l...) + ch <- prometheus.MustNewConstMetric(tcpListenQueueOverflowsDesc, prometheus.CounterValue, s.Statistics.Tcp.ListenQueueOverflows, l...) + ch <- prometheus.MustNewConstMetric(tcpBadRstWindowDesc, prometheus.CounterValue, s.Statistics.Tcp.BadRstWindow, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsEstablishedDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsEstablished, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsClosedDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsClosed, l...) + ch <- prometheus.MustNewConstMetric(tcpDropsDesc, prometheus.CounterValue, s.Statistics.Tcp.Drops, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedRttOnCloseDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedRttOnClose, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedVarianceOnCloseDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedVarianceOnClose, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsUpdatedSsthreshOnCloseDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsUpdatedSsthreshOnClose, l...) + ch <- prometheus.MustNewConstMetric(tcpEmbryonicConnectionsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.EmbryonicConnectionsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpSegmentsUpdatedRttDesc, prometheus.CounterValue, s.Statistics.Tcp.SegmentsUpdatedRtt, l...) + ch <- prometheus.MustNewConstMetric(tcpAttemptsDesc, prometheus.CounterValue, s.Statistics.Tcp.Attempts, l...) + ch <- prometheus.MustNewConstMetric(tcpRetransmitTimeoutsDesc, prometheus.CounterValue, s.Statistics.Tcp.RetransmitTimeouts, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsDroppedByRetransmitTimeoutDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsDroppedByRetransmitTimeout, l...) + ch <- prometheus.MustNewConstMetric(tcpPersistTimeoutsDesc, prometheus.CounterValue, s.Statistics.Tcp.PersistTimeouts, l...) + ch <- prometheus.MustNewConstMetric(tcpConnectionsDroppedByPersistTimeoutDesc, prometheus.CounterValue, s.Statistics.Tcp.ConnectionsDroppedByPersistTimeout, l...) + ch <- prometheus.MustNewConstMetric(tcpKeepaliveTimeoutsDesc, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveTimeouts, l...) + ch <- prometheus.MustNewConstMetric(tcpKeepaliveProbesSentDesc, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveProbesSent, l...) + ch <- prometheus.MustNewConstMetric(tcpKeepaliveConnectionsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.KeepaliveConnectionsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpAckHeaderPredictionsDesc, prometheus.CounterValue, s.Statistics.Tcp.AckHeaderPredictions, l...) + ch <- prometheus.MustNewConstMetric(tcpDataPacketHeaderPredictionsDesc, prometheus.CounterValue, s.Statistics.Tcp.DataPacketHeaderPredictions, l...) + ch <- prometheus.MustNewConstMetric(tcpSyncacheEntriesAddedDesc, prometheus.CounterValue, s.Statistics.Tcp.SyncacheEntriesAdded, l...) + ch <- prometheus.MustNewConstMetric(tcpRetransmittedDesc, prometheus.CounterValue, s.Statistics.Tcp.Retransmitted, l...) + ch <- prometheus.MustNewConstMetric(tcpDupsynDesc, prometheus.CounterValue, s.Statistics.Tcp.Dupsyn, l...) + ch <- prometheus.MustNewConstMetric(tcpDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.Dropped, l...) + ch <- prometheus.MustNewConstMetric(tcpCompletedDesc, prometheus.CounterValue, s.Statistics.Tcp.Completed, l...) + ch <- prometheus.MustNewConstMetric(tcpBucketOverflowDesc, prometheus.CounterValue, s.Statistics.Tcp.BucketOverflow, l...) + ch <- prometheus.MustNewConstMetric(tcpCacheOverflowDesc, prometheus.CounterValue, s.Statistics.Tcp.CacheOverflow, l...) + ch <- prometheus.MustNewConstMetric(tcpResetDesc, prometheus.CounterValue, s.Statistics.Tcp.Reset, l...) + ch <- prometheus.MustNewConstMetric(tcpStaleDesc, prometheus.CounterValue, s.Statistics.Tcp.Stale, l...) + ch <- prometheus.MustNewConstMetric(tcpAbortedDesc, prometheus.CounterValue, s.Statistics.Tcp.Aborted, l...) + ch <- prometheus.MustNewConstMetric(tcpBadackDesc, prometheus.CounterValue, s.Statistics.Tcp.Badack, l...) + ch <- prometheus.MustNewConstMetric(tcpUnreachDesc, prometheus.CounterValue, s.Statistics.Tcp.Unreach, l...) + ch <- prometheus.MustNewConstMetric(tcpZoneFailuresDesc, prometheus.CounterValue, s.Statistics.Tcp.ZoneFailures, l...) + ch <- prometheus.MustNewConstMetric(tcpCookiesSentDesc, prometheus.CounterValue, s.Statistics.Tcp.CookiesSent, l...) + ch <- prometheus.MustNewConstMetric(tcpCookiesReceivedDesc, prometheus.CounterValue, s.Statistics.Tcp.CookiesReceived, l...) + ch <- prometheus.MustNewConstMetric(tcpSackRecoveryEpisodesDesc, prometheus.CounterValue, s.Statistics.Tcp.SackRecoveryEpisodes, l...) + ch <- prometheus.MustNewConstMetric(tcpSegmentRetransmitsDesc, prometheus.CounterValue, s.Statistics.Tcp.SegmentRetransmits, l...) + ch <- prometheus.MustNewConstMetric(tcpByteRetransmitsDesc, prometheus.CounterValue, s.Statistics.Tcp.ByteRetransmits, l...) + ch <- prometheus.MustNewConstMetric(tcpSackOptionsReceivedDesc, prometheus.CounterValue, s.Statistics.Tcp.SackOptionsReceived, l...) + ch <- prometheus.MustNewConstMetric(tcpSackOptionsSentDesc, prometheus.CounterValue, s.Statistics.Tcp.SackOptionsReceived, l...) + ch <- prometheus.MustNewConstMetric(tcpSackScoreboardOverflowDesc, prometheus.CounterValue, s.Statistics.Tcp.SackScoreboardOverflow, l...) + ch <- prometheus.MustNewConstMetric(tcpAcksSentInResponseButNotExactRstsDesc, prometheus.CounterValue, s.Statistics.Tcp.AcksSentInResponseButNotExactRsts, l...) + ch <- prometheus.MustNewConstMetric(tcpAcksSentInResponseToSynsOnEstablishedConnectionsDesc, prometheus.CounterValue, s.Statistics.Tcp.AcksSentInResponseToSynsOnEstablishedConnections, l...) + ch <- prometheus.MustNewConstMetric(tcpRcvPacketsDroppedDueToBadAddressDesc, prometheus.CounterValue, s.Statistics.Tcp.RcvPacketsDroppedDueToBadAddress, l...) + ch <- prometheus.MustNewConstMetric(tcpOutOfSequenceSegmentDropsDesc, prometheus.CounterValue, s.Statistics.Tcp.OutOfSequenceSegmentDrops, l...) + ch <- prometheus.MustNewConstMetric(tcpRstPacketsDesc, prometheus.CounterValue, s.Statistics.Tcp.RstPackets, l...) + ch <- prometheus.MustNewConstMetric(tcpIcmpPacketsIgnoredDesc, prometheus.CounterValue, s.Statistics.Tcp.IcmpPacketsIgnored, l...) + ch <- prometheus.MustNewConstMetric(tcpSendPacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.SendPacketsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpRcvPacketsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.RcvPacketsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpOutgoingSegmentsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.OutgoingSegmentsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedSynfinDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedSynfinDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedIpsecDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedIpsecDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedMacDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedMacDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedMinttlExceededDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedMinttlExceeded, l...) + ch <- prometheus.MustNewConstMetric(tcpListenstateBadflagsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.ListenstateBadflagsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpFinwaitstateBadflagsDroppedDesc, prometheus.CounterValue, s.Statistics.Tcp.FinwaitstateBadflagsDropped, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedDosAttackDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedDosAttack, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedBadSynackDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadSynack, l...) + ch <- prometheus.MustNewConstMetric(tcpSyncacheZoneFullDesc, prometheus.CounterValue, s.Statistics.Tcp.SyncacheZoneFull, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedRstFirewallfilterDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedRstFirewallfilter, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedNoackTimewaitDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNoackTimewait, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedNoTimewaitStateDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNoTimewaitState, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedRstTimewaitStateDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedRstTimewaitState, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedTimewaitDropsDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedTimewaitDrops, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedBadaddrTimewaitStateDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadaddrTimewaitState, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedAckoffInSynSentrcvdDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedAckoffInSynSentrcvd, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedBadaddrFirewallDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadaddrFirewall, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedNosynSynSentDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedNosynSynSent, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedBadrstSynSentDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadrstSynSent, l...) + ch <- prometheus.MustNewConstMetric(tcpReceivedBadrstListenStateDesc, prometheus.CounterValue, s.Statistics.Tcp.ReceivedBadrstListenState, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionMaxsegmentLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionMaxsegmentLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionWindowLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionWindowLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionTimestampLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionTimestampLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionMd5LengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionMd5Length, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionAuthLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionAuthLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionSackpermittedLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionSackpermittedLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionSackLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionSackLength, l...) + ch <- prometheus.MustNewConstMetric(tcpOptionAuthoptionLengthDesc, prometheus.CounterValue, s.Statistics.Tcp.OptionAuthoptionLength, l...) } func (c *systemstatisticsCollector) collectSystemStatisticsARP(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { @@ -1523,7 +1523,7 @@ func (c *systemstatisticsCollector) collectSystemStatisticsARP(ch chan<- prometh func (c *systemstatisticsCollector) collectSystemStatisticsICMP(ch chan<- prometheus.Metric, labelValues []string, s SystemStatistics) { labels := append(labelValues, "ICMP") - ch <- prometheus.MustNewConstMetric(icmpDropsDueToRateLimitDesc, prometheus.CounterValue, s.Statistics.Icmp.DropsDueToRateLimit, labels...) + ch <- prometheus.MustNewConstMetric(icmpDropsDueToRateLimitDesc, prometheus.GaugeValue, s.Statistics.Icmp.DropsDueToRateLimit, labels...) ch <- prometheus.MustNewConstMetric(icmpCallsToIcmpErrorDesc, prometheus.CounterValue, s.Statistics.Icmp.CallsToIcmpError, labels...) ch <- prometheus.MustNewConstMetric(icmpErrorsNotGeneratedBecauseOldMessageWasIcmp, prometheus.CounterValue, s.Statistics.Icmp.ErrorsNotGeneratedBecauseOldMessageWasIcmp, labels...) for _, histogram := range s.Statistics.Icmp.Histogram { @@ -1551,7 +1551,7 @@ func (c *systemstatisticsCollector) collectSystemStatisticsICMP6(ch chan<- prome labels := append(labelValues, "ICMP6") ch <- prometheus.MustNewConstMetric(icmp6CallsToIcmp6ErrorDesc, prometheus.CounterValue, s.Statistics.Icmp6.CallsToIcmp6Error, labels...) ch <- prometheus.MustNewConstMetric(icmp6ErrorsNotGeneratedBecauseOldMessageWasIcmpErrorDesc, prometheus.CounterValue, s.Statistics.Icmp6.ErrorsNotGeneratedBecauseOldMessageWasIcmpError, labels...) - ch <- prometheus.MustNewConstMetric(icmp6ErrorsNotGeneratedBecauseRateLimitationDesc, prometheus.CounterValue, s.Statistics.Icmp6.ErrorsNotGeneratedBecauseRateLimitation, labels...) + ch <- prometheus.MustNewConstMetric(icmp6ErrorsNotGeneratedBecauseRateLimitationDesc, prometheus.GaugeValue, s.Statistics.Icmp6.ErrorsNotGeneratedBecauseRateLimitation, labels...) labels = append(labels, "Output Histogram") ch <- prometheus.MustNewConstMetric(icmp6UnreachableIcmp6PacketsOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.UnreachableIcmp6Packets, labels...) ch <- prometheus.MustNewConstMetric(icmp6Icmp6EchoOutputHistoDesc, prometheus.CounterValue, s.Statistics.Icmp6.OutputHistogram.Icmp6Echo, labels...)