Hi Vu, Thanks for the information. I think your suggested information must go in README file. Ack from me.
Thanks, Praveen On 10-Aug-16 8:46 AM, Vu Minh Nguyen wrote: > Hi Praveen, > > The notification and notifying objects are truncated because we did not > change default attribute values before running test. > > Following changes should be done before running test: > 1) The field size of @No and @Ng tokens in `saLogStreamLogFileFormat` > In default, the field-size value is 30. Means, the notification and > notifying objects are limited to 30 characters. > For long DN test, we should remove the <field-size>. E.g: change default > "@No30" to "@No". > > 2) The fixed log record size - `saLogStreamFixedLogRecordSize` > In default, its value is 200. A whole log record is limited to this number > of characters. > We should change it to 0, means variable log record size. > > 3) Max log record size - `logMaxLogrecsize` in class ` OpenSafLogConfig` > In default, max log record size is limited to 1024 characters. > We should change it to a bigger number. Max value is 65535. > > Example: > # immcfg -a saLogStreamFixedLogRecordSize=0 -a saLogStreamLogFileFormat="@Cr > @Ct @Nt @Ne6 @No @Ng \"@Cb\"" safLgStrCfg=saLogAlarm,safApp=safLogService > # immcfg -a logMaxLogrecsize=65535 logConfig=1,safApp=safLogService > > We can consider to put these information into the ~/tests/ntfsv/README file. > > Regards, Vu > >> -----Original Message----- >> From: praveen malviya [mailto:praveen.malv...@oracle.com] >> Sent: Tuesday, August 9, 2016 6:46 PM >> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'minh chau' >> <minh.c...@dektech.com.au>; 'Lennart Lund' <lennart.l...@ericsson.com> >> Cc: opensaf-devel@lists.sourceforge.net >> Subject: Re: [PATCH 1 of 1] ntfsv: refactor logging long dn notification >> [#1585] >> >> Hi Vu, >> >> This patch is doing that. My question was any truncation being done from >> log service after taking a long Dn notificaion from NTF. >> >> For example: When executed first ntf long dn test: ntftest 36 1 >> >> LOG service logs these notification in saLogAlarm_20160809_165614.log as: >> 10 0x146920b67187c6f0 0x146920b67187c6f0 0x4001 >> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA >> BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB "this is >> additional text info" >> 11 0x146920b67187c6f0 0x146920b67187c6f0 0x4001 AMF BLABLA >> Component >> AMF BLABLA Entity "this is additional text info" >> >> In the first notification above, notification and notifying objects are >> truncated. Do we need to increase the size of log service record? >> >> Thanks, >> Praveen >> >> On 05-Aug-16 8:40 AM, Vu Minh Nguyen wrote: >>> Hi Praveen, >>> >>> Truncation is removed as LOG supports Long DN now. Means, NTF would >> not get >>> INVALID_PARAM if logging longdn-contained notifications. >>> >>> Regards, Vu >>> >>>> -----Original Message----- >>>> From: praveen malviya [mailto:praveen.malv...@oracle.com] >>>> Sent: Thursday, August 4, 2016 8:24 PM >>>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; minh chau >>>> <minh.c...@dektech.com.au>; Lennart Lund >> <lennart.l...@ericsson.com> >>>> Cc: opensaf-devel@lists.sourceforge.net >>>> Subject: Re: [PATCH 1 of 1] ntfsv: refactor logging long dn > notification >>>> [#1585] >>>> >>>> Hi Vu, >>>> >>>> TWith this patch Ntf will not perform any truncation on long dn while >>>> saflogging alrams.Is it with the log service (after supporting long dn) >>>> also or log service is performing any truncation before logging? >>>> >>>> >>>> Thanks, >>>> Praveen >>>> >>>> On 22-Jul-16 4:46 PM, Vu Minh Nguyen wrote: >>>>> osaf/services/saf/ntfsv/ntfs/NtfLogger.cc | 51 >>> +++++++---------------------- >>>> - >>>>> 1 files changed, 13 insertions(+), 38 deletions(-) >>>>> >>>>> >>>>> Remove the part of code that truncates the long DN. >>>>> >>>>> diff --git a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc >>>> b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc >>>>> --- a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc >>>>> +++ b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc >>>>> @@ -21,6 +21,7 @@ >>>>> */ >>>>> #include <sys/poll.h> >>>>> >>>>> +#include "osaf_utility.h" >>>>> #include "saAis.h" >>>>> #include "saLog.h" >>>>> #include "NtfAdmin.hh" >>>>> @@ -232,48 +233,22 @@ SaAisErrorT NtfLogger::logNotification(N >>>>> notif->getNotificationId(), >>>>> SA_LOG_RECORD_WRITE_ACK, >>>>> &logRecord); >>>>> - if (SA_AIS_OK != errorCode) { >>>>> - LOG_NO("Failed to log an alarm or security alarm notification >>> (%d)", >>>> errorCode); >>>>> - if (errorCode == SA_AIS_ERR_LIBRARY || errorCode == >>>> SA_AIS_ERR_BAD_HANDLE) { >>>>> - LOG_ER("Fatal error SA_AIS_ERR_LIBRARY or >>>> SA_AIS_ERR_BAD_HANDLE; exiting (%d)...", errorCode); >>>>> - exit(EXIT_FAILURE); >>>>> - } else if (errorCode == SA_AIS_ERR_INVALID_PARAM) { >>>>> - /* Retry to log truncated notificationObject/notifyingObject >>> because >>>>> - * LOG Service has not supported long dn in Opensaf 4.5 >>>>> - */ >>>>> - char short_dn[SA_MAX_UNEXTENDED_NAME_LENGTH]; >>>>> - memset(&short_dn, 0, SA_MAX_UNEXTENDED_NAME_LENGTH); >>>>> - SaNameT shortdn_notificationObject, shortdn_notifyingObject; >>>>> - if (osaf_is_an_extended_name(ntfHeader->notificationObject)) > { >>>>> - strncpy(short_dn, osaf_extended_name_borrow(ntfHeader- >>>>> notificationObject) >>>>> - , SA_MAX_UNEXTENDED_NAME_LENGTH - 1); >>>>> - osaf_extended_name_lend(short_dn, >>> &shortdn_notificationObject); >>>>> - logRecord.logHeader.ntfHdr.notificationObject = >>>> &shortdn_notificationObject; >>>>> - } >>>>> - if (osaf_is_an_extended_name(ntfHeader->notifyingObject)) { >>>>> - strncpy(short_dn, osaf_extended_name_borrow(ntfHeader- >>>>> notifyingObject) >>>>> - , SA_MAX_UNEXTENDED_NAME_LENGTH - 1); >>>>> - osaf_extended_name_lend(short_dn, > &shortdn_notifyingObject); >>>>> - logRecord.logHeader.ntfHdr.notifyingObject = >>>> &shortdn_notifyingObject; >>>>> - } >>>>> - if (short_dn[0] != '\0') { >>>>> - LOG_NO("Retry to log the truncated >>>> notificationObject/notifyingObject"); >>>>> - if ((errorCode = saLogWriteLogAsync(alarmStreamHandle, >>>>> - >>> notif->getNotificationId(), >>>>> - > SA_LOG_RECORD_WRITE_ACK, >>>>> - &logRecord)) != >>> SA_AIS_OK) { >>>>> - LOG_ER("Failed to log the truncated >>>> notificationObject/notifyingObject (%d)" >>>>> - , errorCode); >>>>> - } >>>>> - } >>>>> - } >>>>> - goto end; >>>>> + switch (errorCode) { >>>>> + case SA_AIS_OK: >>>>> + break; >>>>> + >>>>> + /* LOGsv is busy. Put the notification to queue and re-send next >>> time */ >>>>> + case SA_AIS_ERR_TRY_AGAIN: >>>>> + case SA_AIS_ERR_TIMEOUT: >>>>> + TRACE("Failed to log notification (ret: %d). Try next time.", >>>> errorCode); >>>>> + break; >>>>> + >>>>> + default: >>>>> + osaf_abort(errorCode); >>>>> } >>>>> } >>>>> >>>>> -end: >>>>> TRACE_LEAVE(); >>>>> - >>>>> return errorCode; >>>>> } >>>>> >>>>> >>> > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohodev2dev _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel