From f8342ced6f7c17ecd2f043254151c786257b3fbb Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 5 Aug 2011 14:56:20 +0200 Subject: - imudp&imtcp now report error if no listener at all was defined Thanks to Marcin for suggesting this error message --- ChangeLog | 4 +++- plugins/imtcp/imtcp.c | 5 +++++ plugins/imudp/imudp.c | 5 +++++ runtime/rsyslog.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 86520526..458ae483 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- -Version 6.3.5 [DEVEL] (al), 2011-??-?? +Version 6.3.5 [DEVEL] (rgerhards/al), 2011-??-?? +- imudp&imtcp now report error if no listener at all was defined + Thanks to Marcin for suggesting this error message. - bugfix: potential misadressing in property replacer --------------------------------------------------------------------------- Version 6.3.4 [DEVEL] (rgerhards), 2011-08-02 diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index 4fd717d7..98f49051 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -332,6 +332,11 @@ CODESTARTcheckCnf for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { std_checkRuleset(pModConf, inst); } + if(pModConf->root == NULL) { + errmsg.LogError(0, RS_RET_NO_LISTNERS , "imtcp: module loaded, but " + "no listeners defined - no input will be gathered"); + iRet = RS_RET_NO_LISTNERS; + } ENDcheckCnf diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 161223fd..b5cae4df 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -655,6 +655,11 @@ CODESTARTcheckCnf for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { std_checkRuleset(pModConf, inst); } + if(pModConf->root == NULL) { + errmsg.LogError(0, RS_RET_NO_LISTNERS , "imudp: module loaded, but " + "no listeners defined - no input will be gathered"); + iRet = RS_RET_NO_LISTNERS; + } ENDcheckCnf diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index c2dbc2b2..cc1044a1 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -365,6 +365,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_MOD_UNKNOWN = -2209,/**< module (config name) is unknown */ RS_RET_CONFOBJ_UNSUPPORTED = -2210,/**< config objects (v6 conf) are not supported here */ RS_RET_MISSING_CNFPARAMS = -2211, /**< missing configuration parameters */ + RS_RET_NO_LISTNERS = -2212, /**< module loaded, but no listeners are defined */ /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ -- cgit