Alex Burger writes:
 > Don Cohen wrote:
 > > Andre wrote:
 > > Here's a demo of the problem.  I enter these commands:
 > >  snmptrapd
 > >  snmptrap -v 1 -c private 10.0.0.1 TRAP-TEST-MIB::asante 10.0.0.1 6
 > >   117 '' SNMPv2-MIB::sysLocation.0 s $'XXX' .1.2.3.4 i 1234
 > >  snmptrap -v 1 -c private 10.0.0.1 TRAP-TEST-MIB::asante 10.0.0.1 6
 > >   117 '' SNMPv2-MIB::sysLocation.0 s $'XXX, iso.2.3.4 = INTEGER: 1234'
 > > 
 > > The output is the same.  The input is different.  I should be able to
 > > determine the input from the output. 

 > The single quote is removed by the shell (assuming you using *nix).

I'm really not talking about the input to the shell but the input
to snmptrapd.  In one case it got a string and in the other case a
string and an integer.  It could tell the difference.  But the
distinction was lost in the output it generated.

The reason for the $'...' is that this allows me to enter characters
such as tab and newline, which are used to separate arguments in other
forms of snmptrapd output.  The result is that, as far as I can tell,
there is no set of arguments that can be passed to snmptrapd that will
always allow the input to be reconstructed from the output.

 > You will need to put in the backslashes yourself so it is passed as 
 > one  argument:
 > snmptrap -v 1 -c private 10.0.0.1 TRAP-TEST-MIB::asante 10.0.0.1 6117 '' 
 > SNMPv2-MIB::sysLocation.0 s $\'XXX, iso.2.3.4 = INTEGER: 1234\'
My goal is not to put a ' into the output file.
My goal is to be able to determine what arguments were actually sent
to snmptrapd.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to