Community discussions

MikroTik App
 
jacsa
just joined
Topic Author
Posts: 11
Joined: Wed Sep 14, 2005 10:37 am

Parsing octet string into integer to draw graph

Sun Nov 23, 2008 12:47 pm

Hello,

I tried to create datasource from the processor temperature.
My problem is that the temperature returns as octet string, like
" 25 Centigrade". See the picture.
Is there any way to parse/convert such strings to integers using functions?

Thanks in advance,
Jacsa
You do not have the required permissions to view the files attached to this post.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Parsing octet string into integer to draw graph

Wed Nov 26, 2008 6:02 pm

Sorry for the lack of detail but you can create a function and in the function you can use things like string_substring to pull the number out of the string... Then attach that function to a probe.

Here is a function that returns 6 characters from the system name

if (string_size(oid("iso.org.dod.internet.mgmt.mib-2.system.sysName.0")), string_substring((oid("iso.org.dod.internet.mgmt.mib-2.system.sysName.0"),0 ),6 ), "")
 
balintos
just joined
Posts: 5
Joined: Fri Nov 18, 2011 11:00 am
Location: Hungary, Bekescsaba

Re: Parsing octet string into integer to draw graph

Sun Dec 29, 2013 8:42 pm

Who better to discuss How should the information be given?
This is my beer, you always give of 0:
iso.org.dod.internet.private.enterprises.lan-module.4.4.0

Thank's lot

Who is online

Users browsing this forum: No registered users and 2 guests