Thank you. I'm not sure how I overlooked the "x" string type.
I determined what the printable hex string would be for the timestamp
(07d8061212372d002d0400). I then changed snmptrapd to use "x" instead of "s"
for the type.
I thought that I must be doing something wrong because my trap receiver
(iReasoning's MIBBrowser) reported the field as follows instead of displaying a
timestamp:
(OctetString)0x07 0xd8 0x06 0x12 0x12 0x37 0x2d 0x00 0x2d 0x04 0x00
However, I used a sniffer view how another DateAndTime object (hrSystemDate) is
returned in a GET and the data appeared to be in the same format as what I'm
now sending. So I started snmptrapd and then called snmptrap again with exact
same timestamp and sent the trap to localhost. Here's what appeared in the
syslog trace:
myStartDateAndTime = STRING: 2008-6-18,18:55:45.0,-4:0
So it appears that I've gotten snmptrap to send the binary time string. I'm
not sure why my listener isn't translating it properly since it handles
standard DateAndTime objects (such as hrSystemDate) just fine.
Thank you for the assistance.> Date: Wed, 18 Jun 2008 09:42:58 +0100> From:
[EMAIL PROTECTED]> To: [EMAIL PROTECTED]> Subject: Re: problem using snmptrap
with a DateAndTime object> CC: [email protected]> >
2008/6/17 Zack Little <[EMAIL PROTECTED]>:> > .... 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 suspect Magnus is right, and the
shell is choking on the binary> string value. You might have better luck
converting this string> into a (printable) hex equivalent, and use the "x"
string type.> > > Alternatively, use the normal agent trap API to send these
traps to the> defined trap destinations, or use the code from 'snmptrap.c' as
a> template to send these traps directly.> > Dave
_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008
-------------------------------------------------------------------------
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