Merge pull request #3912 from florianbeer/patch-1

Add rsyslog 5 example to syslog documentation
This commit is contained in:
Daniel Preussker
2016-07-31 17:32:04 +00:00
committed by GitHub

View File

@@ -112,6 +112,17 @@ $template librenms,"%fromhost%||%syslogfacility%||%syslogpriority%||%syslogsever
Ancient versions of rsyslog may require different syntax.
This is an example for rsyslog 5 (default on Debian 7):
```bash
# Feed syslog messages to librenms
$ModLoad omprog
$template librenms,"%FROMHOST%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$YEAR%-%$MONTH%-%$DAY% %timereported:8:25%||%msg%||%programname%\n"
$ActionOMProgBinary /opt/librenms/syslog.php
*.* :omprog:;librenms
```
If your rsyslog server is recieving messages relayed by another syslog server, you may try replacing `%fromhost%` with `%hostname%`, since `fromhost` is the host the message was received from, not the host that generated the message. The `fromhost` property is preferred as it avoids problems caused by devices sending incorrect hostnames in syslog messages.
Add the following to your LibreNMS `config.php` file to enable the Syslog extension: