SNMP query : snmp walk with regular expression

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
kawin
Posts: 1
Joined: Thu Jun 22, 2017 11:49 pm

SNMP query : snmp walk with regular expression

Post by kawin »

How can I get The average of RTTs using data query ?

OID The average of RTTs = .1.3.6.1.4.1.2011.5.25.111.4.3.1.46

SNMP walk sample
snmpwalk -On -v 2c -c public 10.242.0.16 .1.3.6.1.4.1.2011.5.25.111.4.3.1.46
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.56.52.57.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1345 = Gauge32: 6
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.57.54.48.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1345 = Gauge32: 5
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.48.55.49.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1345 = Gauge32: 6
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.49.56.50.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1345 = Gauge32: 6

snmpwalk -On -v 2c -c public 10.242.0.16 .1.3.6.1.4.1.2011.5.25.111.4.3.1.46
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.56.52.57.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1346 = Gauge32: 5
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.57.54.48.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1346 = Gauge32: 6
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.48.55.49.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1346 = Gauge32: 6
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.49.56.50.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1346 = Gauge32: 7

snmpwalk -On -v 2c -c public 10.242.0.16 .1.3.6.1.4.1.2011.5.25.111.4.3.1.46
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.56.52.57.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1347 = Gauge32: 7
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.48.57.54.48.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1347 = Gauge32: 6
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.48.55.49.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1347 = Gauge32: 5
.1.3.6.1.4.1.2011.5.25.111.4.3.1.46.7.49.48.50.49.49.56.50.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50.1347 = Gauge32: 6

number in red that increase every 5 minutes.

snmpwalk -On -v 2c -c public 10.242.0.16 .1.3.6.1.4.1.2011.5.25.111.2.1.1.3
.1.3.6.1.4.1.2011.5.25.111.2.1.1.3.7.49.48.50.48.56.52.57.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50 = STRING: "siteA to siteB"
.1.3.6.1.4.1.2011.5.25.111.2.1.1.3.7.49.48.50.48.57.54.48.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50 = STRING: "siteA to siteC"
.1.3.6.1.4.1.2011.5.25.111.2.1.1.3.7.49.48.50.49.48.55.49.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50 = STRING: "siteA to siteD"
.1.3.6.1.4.1.2011.5.25.111.2.1.1.3.7.49.48.50.49.49.56.50.15.112.109.115.46.117.50.107.105.112.114.97.110.115.49.50 = STRING: "siteA to siteE"

I try this XML, but It doesn't work.

Code: Select all

<query>
	<name>Huawei NQA Statistics</name>
	<oid_index>.1.3.6.1.4.1.2011.5.25.111.4.3.1.46</oid_index>
	<oid_index_parse>OID/REGEXP:^.{35}(.*)</oid_index_parse>
	<fields>
		<index>
			<name>index</name>
			<source>index</source>
			<direction>input</direction>
		</index>
		
		<tag>
			<name>tag</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.2011.5.25.111.2.1.1.3</oid>
		</tag>

		<rttAvg>
			<name>rttAvg</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.4.1.2011.5.25.111.4.3.1.46</oid>
		</rttAvg>
		<rttAvgDisplay>
			<name>rttAvg</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.2011.5.25.111.4.3.1.46</oid>
		</rttAvgDisplay>
			
	</fields>
</query>
Thanks in advance,
Kawin
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: SNMP query : snmp walk with regular expression

Post by rony »

Such an odd SNMP implementation... It is out of specifications...
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests