From ea599342db0e119245f8cb60c68b8ab1dd826cc5 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Wed, 24 Jul 2013 14:43:12 +0200 Subject: Fixing new style config format issues from bugid #468 See http://bugzilla.adiscon.com/show_bug.cgi?id=468 Removed CNFPARAM_REQUIRED from all optional parameters. --- plugins/omsnmp/omsnmp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index 79e555b3..5fa98515 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -112,15 +112,15 @@ static configSettings_t cs; /* action (instance) parameters */ static struct cnfparamdescr actpdescr[] = { { "server", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "port", eCmdHdlrInt, CNFPARAM_REQUIRED }, - { "transport", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "version", eCmdHdlrInt, CNFPARAM_REQUIRED }, - { "community", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "enterpriseoid", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "trapoid", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "messageoid", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "traptype", eCmdHdlrInt, CNFPARAM_REQUIRED }, - { "specifictype", eCmdHdlrInt, CNFPARAM_REQUIRED }, + { "port", eCmdHdlrInt, 0 }, + { "transport", eCmdHdlrString, 0 }, + { "version", eCmdHdlrInt, 0 }, + { "community", eCmdHdlrString, 0 }, + { "enterpriseoid", eCmdHdlrString, 0 }, + { "trapoid", eCmdHdlrString, 0 }, + { "messageoid", eCmdHdlrString, 0 }, + { "traptype", eCmdHdlrInt, 0 }, + { "specifictype", eCmdHdlrInt, 0 }, { "template", eCmdHdlrGetWord, 0 } }; static struct cnfparamblk actpblk = -- cgit v1.2.3 From c05e0e76e8ab6fb61d854902662be4ae067d7838 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Wed, 24 Jul 2013 14:53:54 +0200 Subject: Another fix for bugid# 468 Using OMSRsetEntry now to set the default action template when using new-style config. See here for more: http://bugzilla.adiscon.com/show_bug.cgi?id=468 --- plugins/omsnmp/omsnmp.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index 5fa98515..8ad424e6 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -429,14 +429,10 @@ CODESTARTnewActInst } } - if(pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) "RSYSLOG_FileFormat", - OMSR_NO_RQD_TPL_OPTS)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, - (uchar*) strdup((char*) pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - } + CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? + "RSYSLOG_ForwardFormat" : (char*)pData->tplName), + OMSR_NO_RQD_TPL_OPTS)); + CODE_STD_FINALIZERnewActInst cnfparamvalsDestruct(pvals, &actpblk); ENDnewActInst -- cgit v1.2.3