I'm using snmp-walk to get a value from oid and save it to files as text file
then the script I'm using to extract the value is:
Code: Select all
:global content [/file get [/file find name=out.txt] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line "";
:global lastEnd 0;
:do {
:set lineEnd [:find $content "\n" $lastEnd ] ;
:set line [:pick $content $lastEnd $lineEnd ] ;
:set lastEnd ( $lineEnd +2 ) ;
:global entry [:pick $line 0 $lineEnd ]
} while ($lastEnd < ( $contentLen -2 ) )
:global raw [:pick $line 47 51 ]
:log info message=$raw
My problem is I need to multiply the output value and devide it etc...
I used this
Code: Select all
:global cap [:put ($raw *2) ]
:log info message=$cap
How can I convert the $raw var to a number that can be multiplied?
I'm not expert in scripting .
Thanks