This is a discussion on Problem in receiving a DateAndTime type object in notification within the SNMP Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============1691796497== Content-class: urn:content-classes:message Content-Type: multipart/alternative; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
--===============1691796497== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C88303.6B4B5710" This is a multi-part message in MIME format. ------_=_NextPart_001_01C88303.6B4B5710 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 I'm using Release 5.3.1; and got a problem in receiving notifications which includes a DateAndTime type object.=20 =20 The routine send_v2trap(var_list) is called. To build the var_list, the snmp_varlist_add_variable( ) is called as below: snmp_varlist_add_variable(&var_list, =20 notificationEventTime_oid, =20 OID_LENGTH(notificationEventTime_oid), ASN_OCTET_STR, notif->time, 8); =20 The notf->time is define as char time[12]. =20 It works fine when the hours and minutes are non-zero values. For example, when notif->time is assigned 0x07, 0xd8, 0x03, 0x0a, 0x0c, 0x0e, 0x0a, 0x0, the notificationEventTime in the notification message received by manager (MG-SOFT) is: 2008-3-10,12:14:10.0. It's coorect. =20 However, if the hours =3D 0, {0x07, 0xd8, 0x03, 0x0a, 0x0, 0x0e, 0x0a, 0x0} then the notificationEventTime in the notification message received by the manager becomes: 2008-3-10,0:0:0.0; i.e., the minutes and seconds incorrectly become 0, Similar situation happens to the minutes: if minutes is 0, the seconds incorrectly becomes 0. =20 I used Ethereal to capture the data, it's the same as MG-SOFT got. =20 I'll appreciate any help. =20 John Wang =20 =20 =20 ------_=_NextPart_001_01C88303.6B4B5710 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:x=3D"urn:schemas-microsoft-com:office:excel" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} h1 {margin-top:12.0pt; margin-right:0in; margin-bottom:3.0pt; margin-left:.5in; text-indent:-.5in; page-break-after:avoid; mso-list:l1 level1 lfo2; font-size:12.0pt; font-family:Arial; color:red;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} p.mynumbered1, li.mynumbered1, div.mynumbered1 {margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:.5in; margin-bottom:.0001pt; text-indent:-.5in; mso-list:l0 level1 lfo1; font-size:10.0pt; font-family:Arial;} span.EmailStyle18 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:317154457; mso-list-type:simple; mso-list-template-ids:-105580578;} @list l0:level1 {mso-level-style-link:my_numbered_1; mso-level-tab-stop:.25in; mso-level-number-position:left; text-indent:-.5in;} @list l1 {mso-list-id:1647277635; mso-list-type:hybrid; mso-list-template-ids:1079406224 765738918 67698713 67698715 67698703 = 67698713 67698715 67698703 67698713 67698715;} @list l1:level1 {mso-level-style-link:"Heading 1"; mso-level-tab-stop:.25in; mso-level-number-position:left; text-indent:-.5in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Hi,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I’m using Release 5.3.1; and got a problem in receiving notifications which includes a DateAndTime type object. = <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>The routine send_v2trap(var_list) is called. To build = the var_list, the snmp_varlist_add_variable( ) is called as = below:<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = = snmp_varlist_add_variable(&var_list,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; &n bsp; &= nbsp; = notificationEventTime_oid,<o: p></o:p></span></font></p>= <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &n bsp; &= nbsp; &nb sp; &n= bsp; OID_LENGTH(notificatio nEventTime_oid),<o:p></= o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; &n bsp; &= nbsp; &nb sp;ASN_OCTET_STR,<o:p><= /o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &n bsp; &= nbsp; &nb sp; &n= bsp; notif->time,<o:p></o:p></span></font= ></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = &n bsp; &= nbsp; &n bsp; &= nbsp; &nb sp; 8);<o:p></o:p>= </span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>The notf->time is define as char = time[12].<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>It works fine when the hours and minutes are non-zero = values. For example, when notif->time is assigned 0x07, 0xd8, 0x03, 0x0a, = 0x0c, 0x0e, 0x0a, 0x0, the notificationEventTime in the notification message = received by manager (MG-SOFT) is: 2008-3-10,12:14:10.0. It’s = coorect.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>However, if the hours =3D 0, {0x07, 0xd8, 0x03, 0x0a, = 0x0, 0x0e, 0x0a, 0x0} then the notificationEventTime in the notification = message received by the manager becomes: 2008-3-10,0:0:0.0; i.e., the minutes and seconds incorrectly become 0, Similar situation happens to the minutes: if = minutes is 0, the seconds incorrectly becomes 0.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I used Ethereal to capture the data, it’s the = same as MG-SOFT got.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I’ll appreciate any = help.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>John Wang <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> </div> </body> </html> ------_=_NextPart_001_01C88303.6B4B5710-- --===============1691796497== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --===============1691796497== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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/...net-snmp-users --===============1691796497==-- |