From f57cf36f4e5a94167cdb82787d66e7959b4959e2 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 5 Apr 2015 02:01:06 +0100 Subject: [PATCH 1/2] Added new doc showing syslog setup --- doc/Extensions/Syslog.md | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 doc/Extensions/Syslog.md diff --git a/doc/Extensions/Syslog.md b/doc/Extensions/Syslog.md new file mode 100644 index 000000000..b4bae13ee --- /dev/null +++ b/doc/Extensions/Syslog.md @@ -0,0 +1,68 @@ +# Setting up syslog support + +This document will explain how to send syslog data to LibreNMS. + +### Syslog server installation + +For Debian / Ubuntu: +```ssh +apt-get install syslog-ng +``` + +For CentOS / RedHat +```ssh +yum install syslog-ng +``` + +Once syslog-ng is installed, edit the relevant config file (most likely /etc/syslog-ng/syslog-ng.conf) and paste the following: + +```ssh +# First, set some global options. +options { + chain_hostnames(0); + flush_lines(0); + use_dns(1); # Search name with DNS of the machine + use_fqdn(1); # Use all FQDN name of the machine + perm(0640); + stats_freq(0); + keep_hostname(0); + log_fifo_size (1000); + time_reopen (10); + create_dirs (no); +}; + + +source s_sys { + system(); + internal(); +}; + + +source s_net { + udp(port(514) flags(syslog-protocol)); + tcp(port(514) flags(syslog-protocol)); +}; + + +destination d_librenms { + program("/opt/librenms/syslog.php" template ("$HOST||$FACILITY||$PRIORITY||$LEVEL||$TAG||$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC||$MSG||$PROGRAM\n") template-escape(yes)); +}; + + +log { + source(s_net); + source(s_sys); + destination(d_librenms); +}; + + +@include "/etc/syslog-ng/conf.d/" +``` + +Next start syslog-ng: + +```ssh +service syslog-ng restart +``` + +If you have permitted udp and tcp 514 through any firewall then that should be all you need. Logs should start appearing and displayed within the LibreNMS web ui. From 80582fed756e8379ea56482e7da9ed1e63033132 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 5 Apr 2015 12:08:42 +0100 Subject: [PATCH 2/2] Updated syslog with client examples --- doc/Extensions/Syslog.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/Extensions/Syslog.md b/doc/Extensions/Syslog.md index b4bae13ee..f0f9621fd 100644 --- a/doc/Extensions/Syslog.md +++ b/doc/Extensions/Syslog.md @@ -65,4 +65,44 @@ Next start syslog-ng: service syslog-ng restart ``` +### Client configuration + +Below are sample configurations for a variety of clients. You should understand the config before using it as you may want to make some slight changes. + +Replace librenms.ip with IP or hostname of your LibreNMS install. + +Replace any variables in with the relevant information. + +#### syslog +```config +*.* @librenms.ip +``` + +#### rsyslog +```config +*.* @librenms.ip:514 +``` + +#### Cisco ASA +```config +logging enable +logging timestamp +logging buffer-size 200000 +logging buffered debugging +logging trap notifications +logging host librenms.ip +``` + +#### Cisco IOS +```config +logging trap debugging +logging facility local6 +logging librenms.ip +``` + +#### Cisco NXOS +```config +logging server librenms.ip 5 use-vrf default facility local6 +``` + If you have permitted udp and tcp 514 through any firewall then that should be all you need. Logs should start appearing and displayed within the LibreNMS web ui.