Question

My scanner has a custom OID for last page scanned. I need to take the HEX value and remove all the spacing. So I need to do an instr look up and manipulate my string from there so the only results are "FF08FE and so on" instead of the multi-line when I do the snmpget. I know how to put this in a a variable by:

LastPageScanned= snmpget MyScannerIp -c MyCommunityString -v Version enterprise.4.2.1

Reply from scanner:

enterprise.4.2.1 = Hex-STRING: FF 08 FE 00 FF 64 00 52 00 9B 00 FC FF EF FF A9 00 0A 00 FD 00 0D FF 1F 01 03 02 4B FE 5B FA D5 7F B3 00 00 01 60 FC F1 FD D9 FE 56 00 EF FC F4 FE EC 00 DA 00 6A 00 59 FE BF FF FF FF 52 00 4A FF E5 00 B2 FF C5 00 9F FF 7C 01 01 00 28 00 3B 00 80 00 49 FF C9 FF 40 00 54 FF D3 00 05 FF A0 00 C7 FF BD

Thanks for taking the time to assist!!!!!!

Was it helpful?

Solution

OUTPUT=`snmpget MyScannerIp -c MyCommunityString -v Version enterprise.4.2.1`    
echo "${OUTPUT#*:}" | tr -d ' '
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top