Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Post general support questions here that do not specifically fall into the Linux or Windows categories.
Moderators: Developers , Moderators
semakka
Posts: 20 Joined: Mon Oct 23, 2006 6:37 am
Post
by semakka » Thu Nov 24, 2016 8:58 am
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
Post
by majic » Fri Dec 15, 2017 9:13 pm
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
Post
by semakka » Mon Dec 18, 2017 3:42 am
OK, thanks.
Users browsing this forum: No registered users and 1 guest