Skip to content

Commit

Permalink
Merge pull request #317 from jzwlqx/feature/ip_metrics
Browse files Browse the repository at this point in the history
add ip metrics from snmp
  • Loading branch information
Lyt99 authored Sep 26, 2024
2 parents 57d8df7 + 44ee8f3 commit 91c3330
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions pkg/exporter/probe/procsnmp/procsnmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,25 @@ const (
UDPIgnoredMulti = "ignoredmulti"

//metrics of ip
IPInNoRoutes = "innoroutes"
IPInTruncatedPkts = "intruncatedpkts"
IPForwarding = "forwarding"
IPDefaultTTL = "defaultttl"
IPInReceives = "inreceives"
IPInHdrErrors = "inhdrerrors"
IPInAddrErrors = "inaddrerrors"
IPForwDatagrams = "forwdatagrams"
IPInUnknownProtos = "inunknownprotos"
IPInDiscards = "indiscards"
IPInDelivers = "indelivers"
IPOutRequests = "outrequests"
IPOutDiscards = "outdiscards"
IPOutNoRoutes = "outnoroutes"
IPReasmTimeout = "reasmtimeout"
IPReasmReqds = "reasmreqds"
IPReasmOKs = "reasmoks"
IPReasmFails = "reasmfails"
IPFragOKs = "fragoks"
IPFragFails = "fragfails"
IPFragCreates = "fragcreates"

TCP = "tcp"
UDP = "udp"
Expand All @@ -67,7 +84,7 @@ const (
var (
TCPStatMetrcis = []string{TCPActiveOpens, TCPPassiveOpens, TCPRetransSegs, TCPAttemptFails, TCPEstabResets, TCPCurrEstab, TCPInSegs, TCPOutSegs, TCPInErrs, TCPOutRsts}
UDPStatMetrics = []string{UDPInDatagrams, UDPNoPorts, UDPInErrors, UDPOutDatagrams, UDPRcvbufErrors, UDPSndbufErrors, UDPInCsumErrors, UDPIgnoredMulti}
IPMetrics = []string{IPInNoRoutes, IPInTruncatedPkts}
IPMetrics = []string{IPForwarding, IPDefaultTTL, IPInReceives, IPInHdrErrors, IPInAddrErrors, IPForwDatagrams, IPInUnknownProtos, IPInDiscards, IPInDelivers, IPOutRequests, IPOutDiscards, IPOutNoRoutes, IPReasmTimeout, IPReasmReqds, IPReasmOKs, IPReasmFails, IPFragOKs, IPFragFails, IPFragCreates}

metricsMap = map[string][]string{
TCP: TCPStatMetrcis,
Expand Down

0 comments on commit 91c3330

Please sign in to comment.