summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--Makefile.am6
-rw-r--r--conf.c2
-rw-r--r--configure.ac23
-rw-r--r--doc/imrelp.html52
-rw-r--r--doc/omrelp.html54
-rw-r--r--doc/rsyslog_conf.html4
-rw-r--r--doc/rsyslog_ng_comparison.html178
-rw-r--r--modules.c10
-rw-r--r--plugins/imrelp/Makefile.am4
-rw-r--r--plugins/omrelp/Makefile.am4
-rw-r--r--relputil.c113
-rw-r--r--rsyslog.conf.549
-rw-r--r--rsyslog.h5
-rw-r--r--syslogd.c42
15 files changed, 344 insertions, 227 deletions
diff --git a/ChangeLog b/ChangeLog
index ac04af2b..bd2b9b28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,28 @@
---------------------------------------------------------------------------
+Version 3.15.1 (rgerhards), 2008-04-??
+- bugfix: some messages were emited without hostname
+- disabled atomic operations for the time being because they introduce some
+ cross-platform trouble - need to see how to fix this in the best
+ possible way
+- bugfix: zero-length strings were not supported in object
+ deserializer
+- added librelp check via PKG_CHECK thanks to Michael Biebl's patch
+- file relputil.c deleted, is not actually needed
+- added more meaningful error messages to rsyslogd (when some errors
+ happens during startup)
+- bugfix: memory leaks in script engine
+- bugfix: $hostname and $fromhost in RainerScript did not work
+---------------------------------------------------------------------------
+Version 3.15.0 (rgerhards), 2008-04-01
+- major new feature: imrelp/omrelp support reliable delivery of syslog
+ messages via the RELP protocol and librelp (http://www.librelp.com).
+ Plain tcp syslog, so far the best reliability solution, can lose
+ messages when something goes wrong or a peer goes down. With RELP,
+ this can no longer happen. See imrelp.html for more details.
+- bugfix: rsyslogd was no longer build by default; man pages are
+ only installed if corresponding option is selected. Thanks to
+ Michael Biebl for pointing these problems out.
+---------------------------------------------------------------------------
Version 3.14.2 (rgerhards), 2008-04-??
- bugfix: segfault with expression-based filters
- bugfix: omsnmp did not deref errmsg object on exit (no bad effects caused)
@@ -36,6 +60,7 @@ Version 3.14.1 (rgerhards), 2008-04-04
the full size, but will modify the outputs so that only 32 characters
max are used by default. If you need large tags in the output, you need
to provide custom templates.
+- bugfix: some memory leak when queue is runing in disk mode
---------------------------------------------------------------------------
Version 3.14.0 (rgerhards), 2008-04-02
An interim version was accidently released to the web. It was named 3.14.0.
diff --git a/Makefile.am b/Makefile.am
index 4b6602b1..f97687c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,12 +167,6 @@ lmgssutil_la_LDFLAGS = -module -avoid-version
lmgssutil_la_LIBADD = $(gss_libs)
endif
-#
-# relp support
-#
-if ENABLE_RELP
-endif
-
EXTRA_DIST = \
redhat/rsyslog.conf \
redhat/rsyslog.init \
diff --git a/conf.c b/conf.c
index 65d76d63..f87ab992 100644
--- a/conf.c
+++ b/conf.c
@@ -1205,7 +1205,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG
CHKiRet(objUse(ctok_token, CORE_COMPONENT));
CHKiRet(objUse(module, CORE_COMPONENT));
CHKiRet(objUse(errmsg, CORE_COMPONENT));
- CHKiRet(objUse(net, LM_NET_FILENAME));
+ CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */
ENDObjClassInit(conf)
/* vi:set ai:
diff --git a/configure.ac b/configure.ac
index e2bda201..c58c2173 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[3.14.2],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[3.15.1],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([syslogd.c])
AC_CONFIG_HEADERS([config.h])
@@ -466,26 +466,11 @@ AC_ARG_ENABLE(relp,
[enable_relp=no]
)
if test "x$enable_relp" = "xyes"; then
- AC_CHECK_HEADERS(
- [librelp.h],,
- [AC_MSG_FAILURE([RELP library is missing (no headers)])]
- )
-# I don't know how to tell that librelp needs -lrt, so I disable
-# this check for now - the header check should work well enough...
-# rgerhards, 2008-03-25
-# AC_CHECK_LIB(
-# [relp],
-# [relpEngineGetVersion],
-# [relp_cflags=""
- relp_libs="-lrelp"
-# ],
-# [AC_MSG_FAILURE([RELP library is missing])]
-# )
+ PKG_CHECK_MODULES(RELP, relp)
fi
AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes)
-AC_SUBST(relp_cflags)
-AC_SUBST(relp_libs)
-
+AC_SUBST(RELP_CFLAGS)
+AC_SUBST(RELP_LIBS)
# RFC 3195 support
# WARNING: THIS IS NOT REALLY PRESENT YET - needs to be build manually!
diff --git a/doc/imrelp.html b/doc/imrelp.html
new file mode 100644
index 00000000..b6f1f2bc
--- /dev/null
+++ b/doc/imrelp.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Language" content="en"><title>RELP Input Module</title>
+
+</head>
+<body>
+<h1>RELP Input Module</h1>
+<p><b>Module Name:&nbsp;&nbsp;&nbsp; imrelp</b></p>
+<p><b>Author: Rainer Gerhards</b></p>
+<p><b>Description</b>:</p>
+<p>Provides the ability to receive syslog messages via the
+reliable RELP protocol. This module requires <a href="http://www.librelp.com">librelp</a> to be
+present on the system. From the user's point of view, imrelp works much
+like imtcp or imgssapi, except that no message loss can occur. Please
+note that with the currently supported relp protocol version, a minor
+message duplication may occur if a network connection between the relp
+client and relp server breaks after the client could successfully send
+some messages but the server could not acknowledge them. The window of
+opportunity is very slim, but in theory this is possible. Future
+versions of RELP will prevent this. Please also note that rsyslogd may
+lose a few messages if rsyslog is shutdown while a network conneciton
+to the server is broken and could not yet be recovered. Future version
+of RELP support in rsyslog will prevent that. Please note that both
+scenarios also exists with plain tcp syslog. RELP, even with the small
+nits outlined above, is a much more reliable solution than plain tcp
+syslog and so it is highly suggested to use RELP instead of plain tcp.
+Clients send messages to the RELP server via omrelp.</p>
+<p><b>Configuration Directives</b>:</p>
+<ul>
+<li>InputRELPServerRun &lt;port&gt;<br>
+Starts a RELP server on selected port</li>
+</ul>
+<b>Caveats/Known Bugs:</b>
+<ul>
+<li>see description</li>
+</ul>
+<p><b>Sample:</b></p>
+<p>This sets up a RELP server on port 2514.<br>
+</p>
+<textarea rows="15" cols="60">$ModLoad imrelp # needs to be done just once
+$InputRELPServerRun 2514
+</textarea>
+<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>]
+[<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
+<p><font size="2">This documentation is part of the
+<a href="http://www.rsyslog.com/">rsyslog</a>
+project.<br>
+Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer
+Gerhards</a> and
+<a href="http://www.adiscon.com/">Adiscon</a>.
+Released under the GNU GPL version 3 or higher.</font></p>
+</body></html> \ No newline at end of file
diff --git a/doc/omrelp.html b/doc/omrelp.html
new file mode 100644
index 00000000..0952cc71
--- /dev/null
+++ b/doc/omrelp.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="Content-Language" content="en"><title>RELP Output Module (omrelp)</title>
+
+</head>
+<body>
+<h1>RELP Output Module (omlibdbi)</h1>
+<p><b>Module Name:&nbsp;&nbsp;&nbsp; omrelp</b></p>
+<p><b>Author: </b>Rainer Gerhards
+&lt;rgerhards@adiscon.com&gt;</p>
+<p><b>Description</b>:</p>
+<p>This module supports sending syslog messages over the reliable
+RELP protocol. For RELP's advantages over plain tcp syslog, please see
+the documentation for <a href="imrelp.html">imrelp</a>
+(the server counterpart).&nbsp;</p>
+<span style="font-weight: bold;">Setup</span>
+<p>Please note the <a href="http://www.librelp.com">librelp</a>
+is required for imrelp (it provides the core relp protocol
+implementation).</p>
+<p><b>Configuration Directives</b>:</p>
+<p>This module uses old-style action configuration to keep
+consistent with the forwarding rule. So far, no additional
+configuration directives can be specified. To send a message via RELP,
+use</p>
+<p>*.*
+&nbsp;:omrelp:&lt;sever&gt;:&lt;port&gt;;&lt;template&gt;</p>
+<p>just as you use&nbsp;</p>
+<p>*.*
+&nbsp;@@&lt;sever&gt;:&lt;port&gt;;&lt;template&gt;</p>
+<p>to forward a message via plain tcp syslog.</p>
+<b>Caveats/Known Bugs:</b>
+<p>See <a href="imrelp.html">imrelp</a>,
+which documents them.&nbsp;</p>
+<p><b>Sample:</b></p>
+<p>The following sample sends all messages to the central server
+"centralserv" at port 2514 (note that that server must run imrelp on
+port 2514). Rsyslog's high-precision timestamp format is used, thus the
+special "RSYSLOG_ForwardFormat" (case sensitive!) template is used.<br>
+</p>
+<textarea rows="15" cols="60">$ModLoad omrelp
+# forward messages to the remote server "myserv" on
+# port 2514
+*.* :omrelp:centralserv:2514;RSYSLOG_ForwardFormat
+</textarea>
+<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>]
+[<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
+<p><font size="2">This documentation is part of the
+<a href="http://www.rsyslog.com/">rsyslog</a>
+project.<br>
+Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer
+Gerhards</a> and
+<a href="http://www.adiscon.com/">Adiscon</a>.
+Released under the GNU GPL version 3 or higher.</font></p>
+</body></html> \ No newline at end of file
diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html
index 5931a241..2a0f0c60 100644
--- a/doc/rsyslog_conf.html
+++ b/doc/rsyslog_conf.html
@@ -26,7 +26,7 @@ number of modules. Here is the entry point to their documentation and
what they do (list is currently not complete)</p>
<ul>
<li><a href="omsnmp.html">omsnmp</a> - SNMP
-trap output module</li><li>omrelp - RELP output module</li>
+trap output module</li><li><a href="omrelp.html">omrelp</a> - RELP output module</li>
<li>omgss - output module for GSS-enabled syslog</li>
<li>ommysql - output module for MySQL</li>
<li>ompgsql - output module for PostgreSQL</li>
@@ -34,7 +34,7 @@ trap output module</li><li>omrelp - RELP output module</li>
generic database output module (Firebird/Interbase, MS SQL, Sybase,
SQLLite, Ingres, Oracle, mSQL)</li>
<li><a href="imfile.html">imfile</a>
--&nbsp; input module for text files</li><li>imrelp - RELP input module</li>
+-&nbsp; input module for text files</li><li><a href="imrelp.html">imrelp</a> - RELP input module</li>
<li>imudp - udp syslog message input</li>
<li><a href="imtcp.html">imtcp</a> - input
plugin for plain tcp syslog</li>
diff --git a/doc/rsyslog_ng_comparison.html b/doc/rsyslog_ng_comparison.html
index 547501af..2a1d15bd 100644
--- a/doc/rsyslog_ng_comparison.html
+++ b/doc/rsyslog_ng_comparison.html
@@ -1,6 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
-<meta content="de" http-equiv="Content-Language"><title>rsyslog vs. syslog-ng - a comparison</title></head>
+<meta content="de" http-equiv="Content-Language"><title>rsyslog vs. syslog-ng - a comparison</title>
+
+</head>
<body>
<h1>rsyslog vs. syslog-ng</h1>
<p><small><i>Written by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a>
@@ -25,56 +27,72 @@ comparison sheet, so please don't be shy ;)</p>
<td valign="top"><b>rsyslog</b></td>
<td valign="top"><b>syslog-ng</b></td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Input Sources</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Input Sources</b><br>
+</td>
</tr>
-<tr><td valign="top">UNIX domain socket</td>
+<tr>
+<td valign="top">UNIX domain socket</td>
+<td valign="top">yes</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td></td>
+</tr>
<tr>
<td valign="top">UDP</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">TCP</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
+<tr>
+<td valign="top"><a href="http://www.librelp.com">RELP</a></td>
+<td valign="top">yes</td>
+<td valign="top">no</td>
+<td></td>
+</tr>
<tr>
<td valign="top">RFC 3195/BEEP</td>
<td valign="top">yes (needs separate build process)</td>
-<td valign="top">no</td><td>
-</td></tr>
+<td valign="top">no</td>
+<td></td>
+</tr>
<tr>
<td valign="top">kernel log</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">file</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
-<td valign="top">mark message generator as an optional input</td>
+<td valign="top">mark message generator as an
+optional input</td>
<td valign="top">yes</td>
-<td valign="top">no (?)</td><td>
-</td></tr>
+<td valign="top">no (?)</td>
+<td></td>
+</tr>
<tr>
<td valign="top">Windows Event Log</td>
<td valign="top">via <a href="http://www.eventreporter.com">EventReporter</a>
or <a href="http://www.mwagent.com">MonitorWare Agent</a>
(both commercial software)</td>
-<td valign="top">via separate Windows agent, paid edition only</td>
+<td valign="top">via separate Windows agent, paid
+edition only</td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><b><br>Network (Protocol) Support</b><br></td>
+<td colspan="3" valign="top"><b><br>
+Network (Protocol) Support</b><br>
+</td>
</tr>
<tr>
<td valign="top">support for (plain) tcp based syslog</td>
@@ -104,6 +122,11 @@ based framing on syslog/tcp connections</td>
<td valign="top">yes</td>
</tr>
<tr>
+<td valign="top">syslog over RELP<br>this is a truely reliable solution (plain tcp syslog can lose messages!)</td>
+<td valign="top">yes</td>
+<td valign="top">no</td>
+</tr>
+<tr>
<td valign="top">on the wire (zlib) message
compression</td>
<td valign="top">yes</td>
@@ -146,38 +169,46 @@ hostname in NAT environments and relay chains</td>
<td valign="top">yes</td>
<td valign="top">yes</td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Message Filtering</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Message Filtering</b><br>
+</td>
</tr>
-<tr><td valign="top">Filtering for syslog facility and priority</td>
+<tr>
+<td valign="top">Filtering for syslog facility and
+priority</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">Filtering for hostname</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">Filtering for application</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">Filtering for message contents</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">Filtering for sending IP address</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
-<td valign="top">ability to filter on any other message
-field not mentioned above
+<td valign="top">ability to filter on any other
+message
+field not mentioned above
(including substrings and the like)</td>
<td valign="top">yes</td>
<td valign="top">no</td>
@@ -210,8 +241,9 @@ in filters</td>
<td valign="top">support for discarding messages
based on filters</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">powerful BSD-style hostname and
program name blocks for easy multi-host support</td>
@@ -223,10 +255,10 @@ program name blocks for easy multi-host support</td>
<td></td>
<td></td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Supported Database Outputs</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Supported Database Outputs</b><br>
+</td>
</tr>
<tr>
<td valign="top">MySQL</td>
@@ -274,10 +306,10 @@ program name blocks for easy multi-host support</td>
<td valign="top">yes (<a href="omlibdbi.html">omlibdbi</a>)</td>
<td valign="top">no (?)</td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Enterprise Features</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Enterprise Features</b><br>
+</td>
</tr>
<tr>
<td valign="top">support for on-demand on-disk
@@ -292,7 +324,8 @@ by spool files</td>
<td valign="top">yes</td>
</tr>
<tr>
-<td valign="top">each action can use its own, independant
+<td valign="top">each action can use its own,
+independant
set of spool files</td>
<td valign="top">yes</td>
<td valign="top">no</td>
@@ -314,10 +347,10 @@ syslog/database servers </td>
<td><a href="professional_support.html">yes</a></td>
<td>yes</td>
</tr>
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Config File</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Config File</b><br>
+</td>
</tr>
<tr>
<td valign="top">config file format</td>
@@ -338,37 +371,40 @@ existing in a specific directory</td>
<td height="25" valign="top">yes</td>
<td height="25" valign="top">no</td>
</tr>
-
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Extensibility</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Extensibility</b><br>
+</td>
</tr>
<tr>
-<td valign="top">Functionality split in separately loadable
+<td valign="top">Functionality split in separately
+loadable
modules</td>
<td valign="top">yes</td>
<td valign="top">no</td>
</tr>
<tr>
-<td valign="top">Support for third-party input plugins</td>
+<td valign="top">Support for third-party input
+plugins</td>
<td valign="top">yes</td>
<td valign="top">no</td>
</tr>
<tr>
</tr>
-<tr><td valign="top">Support for third-party output plugins</td>
+<tr>
+<td valign="top">Support for third-party output
+plugins</td>
<td valign="top">yes</td>
<td valign="top">no</td>
</tr>
-
-
-
<tr>
-<td colspan="3" valign="top"><br><b>Other Features</b><br></td>
+<td colspan="3" valign="top"><br>
+<b>Other Features</b><br>
+</td>
+</tr>
+<tr>
</tr>
<tr>
-</tr><tr>
<td valign="top">ability to generate file names and
directories (log targets) dynamically</td>
<td valign="top">yes</td>
@@ -440,8 +476,9 @@ reduction ("last message repeated n times") on a per selector-line basis</td>
<td valign="top">supports multiple actions per
selector/filter condition</td>
<td valign="top">yes</td>
-<td valign="top">yes</td><td>
-</td></tr>
+<td valign="top">yes</td>
+<td></td>
+</tr>
<tr>
<td valign="top">web interface</td>
<td valign="top"><a href="http://www.phplogcon.org">phpLogCon</a><br>
@@ -469,8 +506,11 @@ system stress</td>
<tr>
<td height="43" valign="top">flow control
(slow down message reception when system is busy)</td>
-<td height="43" valign="top">yes (advanced, with multiple ways to slow down inputs depending on individual input capabilities, based on watermarks)</td>
-<td height="43" valign="top">yes (limited? "stops accepting messages")</td>
+<td height="43" valign="top">yes (advanced,
+with multiple ways to slow down inputs depending on individual input
+capabilities, based on watermarks)</td>
+<td height="43" valign="top">yes (limited?
+"stops accepting messages")</td>
</tr>
<tr>
<td valign="top">rewriting messages</td>
@@ -504,8 +544,6 @@ Solaris; compilation and basic testing done on HP UX</td>
<td valign="top">no</td>
<td valign="top">yes</td>
</tr>
-
-
</tbody>
</table>
<p>While the <span style="font-weight: bold;">rsyslog</span>
diff --git a/modules.c b/modules.c
index b6164f91..86ee64a5 100644
--- a/modules.c
+++ b/modules.c
@@ -594,7 +594,7 @@ Load(uchar *pModName)
} else {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName);
free(pModNameDup);
- ABORT_FINALIZE(RS_RET_ERR);
+ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_PATHLEN);
}
}
}
@@ -619,24 +619,24 @@ Load(uchar *pModName)
if(iPathLen + strlen((char*) pModName) >= sizeof(szPath)) {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName);
- ABORT_FINALIZE(RS_RET_ERR);
+ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_PATHLEN);
}
/* complete load path constructed, so ... GO! */
dbgprintf("loading module '%s'\n", szPath);
if(!(pModHdlr = dlopen((char *) szPath, RTLD_NOW))) {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', dlopen: %s\n", szPath, dlerror());
- ABORT_FINALIZE(RS_RET_ERR);
+ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_DLOPEN);
}
if(!(pModInit = dlsym(pModHdlr, "modInit"))) {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', dlsym: %s\n", szPath, dlerror());
dlclose(pModHdlr);
- ABORT_FINALIZE(RS_RET_ERR);
+ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_NO_INIT);
}
if((iRet = doModInit(pModInit, (uchar*) pModName, pModHdlr)) != RS_RET_OK) {
errmsg.LogError(NO_ERRCODE, "could not load module '%s', rsyslog error %d\n", szPath, iRet);
dlclose(pModHdlr);
- ABORT_FINALIZE(RS_RET_ERR);
+ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_INIT_FAILED);
}
finalize_it:
diff --git a/plugins/imrelp/Makefile.am b/plugins/imrelp/Makefile.am
index 167065b0..53c9322c 100644
--- a/plugins/imrelp/Makefile.am
+++ b/plugins/imrelp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imrelp.la
imrelp_la_SOURCES = imrelp.c
-imrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(relp_cflags)
+imrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS)
imrelp_la_LDFLAGS = -module -avoid-version
-imrelp_la_LIBADD = $(relp_libs)
+imrelp_la_LIBADD = $(RELP_LIBS)
diff --git a/plugins/omrelp/Makefile.am b/plugins/omrelp/Makefile.am
index edec5de9..dfc2111f 100644
--- a/plugins/omrelp/Makefile.am
+++ b/plugins/omrelp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omrelp.la
omrelp_la_SOURCES = omrelp.c
-omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(relp_cflags)
+omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS)
omrelp_la_LDFLAGS = -module -avoid-version
-omrelp_la_LIBADD = $(relp_libs)
+omrelp_la_LIBADD = $(RELP_LIBS)
diff --git a/relputil.c b/relputil.c
deleted file mode 100644
index e90cb5a3..00000000
--- a/relputil.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* relputil.c
- *
- * This is a miscellaneous helper class for RELP features.
- *
- * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
- *
- * This file is part of rsyslog.
- *
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Rsyslog is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
- */
-#include "config.h"
-#include "rsyslog.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <librelp.h>
-#include "syslogd.h"
-#include "syslogd-types.h"
-#include "srUtils.h"
-#include "net.h"
-#include "omfwd.h"
-#include "template.h"
-#include "msg.h"
-#include "tcpsyslog.h"
-#include "module-template.h"
-#include "obj.h"
-#include "errmsg.h"
-#include "relputil.h"
-
-MODULE_TYPE_LIB
-
-/* static data */
-DEFobjStaticHelpers
-DEFobjCurrIf(errmsg)
-
-
-/* queryInterface function
- * rgerhards, 2008-02-29
- */
-BEGINobjQueryInterface(relputil)
-CODESTARTobjQueryInterface(relputil)
- if(pIf->ifVersion != relputilCURR_IF_VERSION) { /* check for current version, increment on each change */
- ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED);
- }
-
- /* ok, we have the right interface, so let's fill it
- * Please note that we may also do some backwards-compatibility
- * work here (if we can support an older interface version - that,
- * of course, also affects the "if" above).
- */
-
-finalize_it:
-ENDobjQueryInterface(relputil)
-
-
-/* exit our class
- * rgerhards, 2008-03-10
- */
-BEGINObjClassExit(relputil, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MACRO! */
-CODESTARTObjClassExit(relputil)
- /* release objects we no longer need */
- objRelease(errmsg, CORE_COMPONENT);
-ENDObjClassExit(relputil)
-
-
-/* Initialize our class. Must be called as the very first method
- * before anything else is called inside this class.
- * rgerhards, 2008-02-29
- */
-BEGINAbstractObjClassInit(relputil, 1, OBJ_IS_LOADABLE_MODULE) /* class, version - CHANGE class also in END MACRO! */
- /* request objects we use */
- CHKiRet(objUse(errmsg, CORE_COMPONENT));
-ENDObjClassInit(relputil)
-
-
-/* --------------- here now comes the plumbing that makes as a library module --------------- */
-
-
-BEGINmodExit
-CODESTARTmodExit
- relputilClassExit();
-ENDmodExit
-
-
-BEGINqueryEtryPt
-CODESTARTqueryEtryPt
-CODEqueryEtryPt_STD_LIB_QUERIES
-ENDqueryEtryPt
-
-
-BEGINmodInit()
-CODESTARTmodInit
- *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
-
- /* Initialize all classes that are in our module - this includes ourselfs */
- CHKiRet(relputilClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */
-ENDmodInit
diff --git a/rsyslog.conf.5 b/rsyslog.conf.5
index 3c42288c..4fa98ef2 100644
--- a/rsyslog.conf.5
+++ b/rsyslog.conf.5
@@ -17,7 +17,7 @@
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
.\"
-.TH RSYSLOG.CONF 5 "03 April 2008" "Version 3.14.0" "Linux System Administration"
+.TH RSYSLOG.CONF 5 "07 April 2008" "Version 3.15.1" "Linux System Administration"
.SH NAME
rsyslog.conf \- rsyslogd(8) configuration file
.SH DESCRIPTION
@@ -55,6 +55,15 @@ Output module for GSS-enabled syslog
.I ommysql
Output module for MySQL
.TP
+.I omprelp
+Output module for the reliable RELP protocol (prevents message loss).
+For details, see below at imrelp and the html documentation.
+It can be used like this:
+.IP
+*.* :omrelp:server:port
+.IP
+*.* :omrelp:192.168.0.1:2514 # actual sample
+.TP
.I ompgsql
Output module for PostgreSQL
.TP
@@ -81,6 +90,20 @@ $ModLoad imtcp
.IP
$InputTCPServerRun 514
.TP
+.TP
+.I imtcp
+Input plugin for the RELP protocol. RELP can be used instead
+of UDP or plain TCP syslog to provide reliable delivery of
+syslog messages. Please note that plain TCP syslog does NOT
+provide truly reliable delivery, with it messages may be lost
+when there is a connection problem or the server shuts down.
+RELP prevents message loss in those cases.
+It can be used like this:
+.IP
+$ModLoad imrelp
+.IP
+$InputRELPServerRun 2514
+.TP
.I imgssapi
Input plugin for plain TCP and GSS-enable syslog
.TP
@@ -169,9 +192,14 @@ the mkfifo(1) command before rsyslogd(8) is started.
If the file you specified is a tty, special tty-handling is done, same with /dev/console.
.SS Remote machine
-To forward messages to another host, prepend the hostname with the at sign ("@"). A single at
-sign means that messages will be forwarded via UDP protocol (the standard for syslog). If you
-prepend two at signs ("@@"), the messages will be transmitted via TCP.
+There are three ways to forward message: the traditional UDP transport, which is extremely
+lossy but standard, the plain TCP based transport which loses messages only during certain
+situations but is widely available and the RELP transport which does not lose messages
+but is currently available only as part of rsyslogd 3.15.0 and above.
+
+To forward messages to another host via UDP, prepend the hostname with the at sign ("@").
+To forward it via plain tcp, prepend two at signs ("@@"). To forward via RELP, prepend the
+string ":omrelp:" in front of the hostname.
.B Example:
.RS
@@ -179,7 +207,18 @@ prepend two at signs ("@@"), the messages will be transmitted via TCP.
.RE
.sp
In the example above, messages are forwarded via UDP to the machine 192.168.0.1, the destination
-port defaults to 514.
+port defaults to 514. Due to the nature of UDP, you will probably lose some messages in transit.
+If you expect high traffic volume, you can expect to lose a quite noticable number of messages
+(the higher the traffic, the more likely and severe is message loss).
+
+.B If you would like to prevent message loss, use RELP:
+.RS
+*.* :omrelp:192.168.0.1:2514
+.RE
+.sp
+Note that a port number was given as there is no standard port for relp.
+
+Keep in mind that you need to load the correct input and output plugins (see "Modules" above).
Please note that rsyslogd offers a variety of options in regarding to remote
forwarding. For full details, please see the html documentation.
diff --git a/rsyslog.h b/rsyslog.h
index 01329aaf..9fe162d5 100644
--- a/rsyslog.h
+++ b/rsyslog.h
@@ -162,6 +162,11 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_OBJ_ALREADY_REGISTERED = -2061, /**< object (name) is already registered */
RS_RET_OBJ_REGISTRY_OUT_OF_SPACE = -2062, /**< the object registry has run out of space */
RS_RET_HOST_NOT_PERMITTED = -2063, /**< a host is not permitted to perform an action it requested */
+ RS_RET_MODULE_LOAD_ERR = -2064, /**< module could not be loaded */
+ RS_RET_MODULE_LOAD_ERR_PATHLEN = -2065, /**< module could not be loaded - path to long */
+ RS_RET_MODULE_LOAD_ERR_DLOPEN = -2066, /**< module could not be loaded - problem in dlopen() */
+ RS_RET_MODULE_LOAD_ERR_NO_INIT = -2067, /**< module could not be loaded - init() missing */
+ RS_RET_MODULE_LOAD_ERR_INIT_FAILED = -2068, /**< module could not be loaded - init() failed */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */
diff --git a/syslogd.c b/syslogd.c
index 4265bd45..26dd35ca 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2833,12 +2833,17 @@ static rsRetVal
InitGlobalClasses(void)
{
DEFiRet;
+ char *pErrObj; /* tells us which object failed if that happens (useful for troubleshooting!) */
+ pErrObj = "obj";
CHKiRet(objClassInit(NULL)); /* *THIS* *MUST* always be the first class initilizer being called! */
CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */
/* the following classes were intialized by objClassInit() */
+ pErrObj = "errmsg";
CHKiRet(objUse(errmsg, CORE_COMPONENT));
+ pErrObj = "module";
CHKiRet(objUse(module, CORE_COMPONENT));
+ pErrObj = "var";
CHKiRet(objUse(var, CORE_COMPONENT));
/* initialize and use classes. We must be very careful with the order of events. Some
@@ -2849,35 +2854,61 @@ InitGlobalClasses(void)
* class immediately after it is initialized. And, of course, we load those classes
* first that we use ourselfs... -- rgerhards, 2008-03-07
*/
+ pErrObj = "datetime";
CHKiRet(datetimeClassInit(NULL));
CHKiRet(objUse(datetime, CORE_COMPONENT));
+ pErrObj = "msg";
CHKiRet(msgClassInit(NULL));
+ pErrObj = "str,";
CHKiRet(strmClassInit(NULL));
+ pErrObj = "wti";
CHKiRet(wtiClassInit(NULL));
+ pErrObj = "wtp";
CHKiRet(wtpClassInit(NULL));
+ pErrObj = "queue";
CHKiRet(queueClassInit(NULL));
+ pErrObj = "vmstk";
CHKiRet(vmstkClassInit(NULL));
+ pErrObj = "sysvar";
CHKiRet(sysvarClassInit(NULL));
+ pErrObj = "vm";
CHKiRet(vmClassInit(NULL));
CHKiRet(objUse(vm, CORE_COMPONENT));
+ pErrObj = "vmop";
CHKiRet(vmopClassInit(NULL));
+ pErrObj = "vmprg";
CHKiRet(vmprgClassInit(NULL));
+ pErrObj = "ctok_token";
CHKiRet(ctok_tokenClassInit(NULL));
+ pErrObj = "ctok";
CHKiRet(ctokClassInit(NULL));
+ pErrObj = "expr";
CHKiRet(exprClassInit(NULL));
CHKiRet(objUse(expr, CORE_COMPONENT));
+ pErrObj = "conf";
CHKiRet(confClassInit(NULL));
CHKiRet(objUse(conf, CORE_COMPONENT));
/* dummy "classes" */
+ pErrObj = "action";
CHKiRet(actionClassInit());
+ pErrObj = "template";
CHKiRet(templateInit());
+ pErrObj = "str";
CHKiRet(strInit());
/* TODO: the dependency on net shall go away! -- rgerhards, 2008-03-07 */
+ pErrObj = "net";
CHKiRet(objUse(net, LM_NET_FILENAME));
finalize_it:
+ if(iRet != RS_RET_OK) {
+ /* we know we are inside the init sequence, so we can safely emit
+ * messages to stderr. -- rgerhards, 2008-04-02
+ */
+ fprintf(stderr, "Error during class init for object '%s' - failing...\n", pErrObj);
+ }
+
RETiRet;
}
@@ -3001,7 +3032,13 @@ int realMain(int argc, char **argv)
if (isupper((int) *p))
*p = (char)tolower((int)*p);
- CHKiRet(InitGlobalClasses());
+ CHKiRet_Hdlr(InitGlobalClasses()) {
+ fprintf(stderr, "rsyslogd initializiation failed - global classes could not be initialized.\n"
+ "Did you do a \"make install\"?\n"
+ "Suggested action: run rsyslogd with -d -n options to see what exactly "
+ "fails.\n");
+ FINALIZE;
+ }
/* doing some core initializations */
if((iRet = modInitIminternal()) != RS_RET_OK) {
@@ -3301,7 +3338,8 @@ int realMain(int argc, char **argv)
finalize_it:
if(iRet != RS_RET_OK)
- fprintf(stderr, "rsyslogd run failed with error %d.\n", iRet);
+ fprintf(stderr, "rsyslogd run failed with error %d\n(see rsyslog.h "
+ "or http://www.rsyslog.com/errcode to learn what that number means)\n", iRet);
ENDfunc
return 0;