Re: How to prevent line wrapping of hex data?

This is a discussion on Re: How to prevent line wrapping of hex data? within the SNMP Coders forums, part of the Networking and Network Related category; I knew there was a way to do this, but I couldn't remember the details. After some searching I ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-25-2005
Alex Burger
 
Posts: n/a
Default Re: How to prevent line wrapping of hex data?


I knew there was a way to do this, but I couldn't remember the details.
After some searching I found that 5.2 has an "snmp.conf" directive
"hexOutputLength" which you can use to set where to break the line.
Setting it to 0 will have it print everything on one line.

It doesn't look like the docs were updated when it was added, but the
feature is there. I'll update the man page for the next release.

Alex


> Check the snmpcmd man page. There maybe be a from of the -O option that
> does what you want, although I couldn't find specific mention of it.
> Aside from hacking snmpwalk you could also write a wrapper script to
> strip newlines from the hex output.
>
> Regards,
> Andy
>
> Yusuf Kürşat Tuncel wrote:
>> Hi All,
>>
>> Searching through the google returned no result, so I'm asking directly
>> to the list. I think net-snmp-coders list would be appropriate for this
>> question.
>>
>> Is there any way to prevent line wrapping of hex data from the output of
>> snmpwalk?
>>
>> I'm writing a script based on a mib var, the output is like this:
>>
>> snmpwalk -v1 -c public -OQbxv [ip_address] [relevant_mib_var_here]
>>
>> "01 00 00 00 03 6B 75 72 73 61 74 2D 72 61 64 69
>> 75 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 00 00 00 00 01 00 01 01 56 52 D2 78 21 80 01 78
>> 21 80 01 03 00 00 64
>> "
>> (wrapped exactly at 16th octet of the returned value)
>>
>> What I want is to display this data in one line (for easier parsing)
>> "01 00 00 00 03 6B 75 72 73 61 74 2D 72 61 64 69 75 73 00 00 00 00 00 00
>> 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 01 56 52 D2 78 21 80 01 78
>> 21 80 01 03 00 00 64"
>>
>> Is there anyway to prevent this line wrapping behaviour of snmpwalk via
>> option switches or do I need to "hack" the source code to get the
>> desired effect?
>>
>> best regards,
>> kursat.





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:44 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0