mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
69 lines
1.4 KiB
Markdown
69 lines
1.4 KiB
Markdown
# 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.
|