This is a discussion on Problem in receiving a DateAndTime type object in notification - SNMP ; This is a multi-part message in MIME format. --===============0639730478== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8830F.C8858B92" This is a multi-part message in MIME format. ------_=_NextPart_001_01C8830F.C8858B92 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable =20 Hi, =20 I'm using Release 5.3.1; and got a problem in ...
This is a multi-part message in MIME format.=3D"urn:schemas-microsoft-com
--===============0639730478==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C8830F.C8858B92"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C8830F.C8858B92
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
=20
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_01C8830F.C8858B92
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
ffice
ffice" =
ffice:word" =
ffice:excel" =
face=3D"Times New Roman">
style=3D'font-size:12.0pt'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>Hi,
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
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.
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
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:
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
snmp_varlist_add_variable(&var_list,
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;  =
; =
&=
nbsp;
notificationEventTime_oid,
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;  =
;
&=
nbsp; &n=
bsp; OID_LENGTH(notificationEventTime_oid),
o
>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;  =
; =
&=
nbsp; ASN_OCTET_STR,
/o
>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;  =
;
&=
nbsp; &n=
bsp; notif->time,
>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;  =
;
&=
nbsp; 8);
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>The notf->time is define =
as char
time[12].
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
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.
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
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.
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>I used Ethereal to capture =
the data,
it’s the same as MG-SOFT got.
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>I’ll appreciate any =
help.
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>John Wang =
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>