On Tue, 2008-06-17 at 14:54 -0400, Zack Little wrote: > I have defined a custom MIB for queries and that is working fine. I > now want to have my device send some traps that I have created in my > custom MIB file. Right now what I'm doing is having an application > that runs on my device fork off a child process to handle the sending > of the trap. The child calls snmptrap via an execvp call and then the > child exits. > > This is working great for standard data types (integer, ip address, > string, etc.). I can't seem to get this to work with my DateAndTime > object. I used the function date_n_time() to transform my timestamp > into a binary string and passed it as an arg with "s" for the type. I > added a trace message and found that snmptrap is being called with my > binary string. However, snmptrap must be blowing up somewhere before > the trap is sent. > > Before I spend any time debugging snmptrap I wanted to make sure I > wasn't taking the completely wrong approach to this.
As you descrie it it sounds like you are having trouble with \0-terminated strings and/or shell quoting. I'd say you are taking the wrong approach, the right approach would be to use something like the netsnmp_send_traps call. /MF ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
