Data Query output String to Integer

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

Moderators: Developers, Moderators

Post Reply
semakka
Posts: 20
Joined: Mon Oct 23, 2006 6:37 am

Data Query output String to Integer

Post by semakka »

hi all,

i need a little help.
on a snmp walk i get
Name/OID: .1.3.6.1.4.1.37373.100.1.1.4.0; Value (OctetString): -80 dB

question is how can I use REGEXP in the source of the query to strip the "dB" and show the integer only, in this case "-80"

is this correct?

Code: Select all

<b2268sRSRP>
	<name>RSRP</name>
	<method>walk</method>
	<source>OID/REGEXP:.*\.([0-9]{1,2})$/source>
	<direction>output</direction>
	<oid>.1.3.6.1.4.1.37373.100.1.1.4</oid>
</b2268sRSRP>
will it retrieve "-80" ?

thank you
S
majic
Posts: 2
Joined: Fri Apr 28, 2017 8:09 pm

Re: Data Query output String to Integer

Post by majic »

Your source line has a few problems.

1) <source> is not closed correctly with </
2) Use VALUE/REGEXP instead of OID/REGEXP
3) Try (-?[0-9]{1,3})\s..$ The {1,3} will allow the value to drop to =< -100

The line should look something like this

<source>VALUE/REGEXP:(-?[0-9]{1,3})\s..$</source>
semakka
Posts: 20
Joined: Mon Oct 23, 2006 6:37 am

Re: Data Query output String to Integer

Post by semakka »

OK, thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest