From 44ee8f378d7ba35510efb6e32d86b40630c06a90 Mon Sep 17 00:00:00 2001 From: "jizhong.jiangjz" Date: Tue, 24 Sep 2024 10:35:55 +0800 Subject: [PATCH] add ip metrics from snmp --- pkg/exporter/probe/procsnmp/procsnmp.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkg/exporter/probe/procsnmp/procsnmp.go b/pkg/exporter/probe/procsnmp/procsnmp.go index 642c6176..5233c213 100644 --- a/pkg/exporter/probe/procsnmp/procsnmp.go +++ b/pkg/exporter/probe/procsnmp/procsnmp.go @@ -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" @@ -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,