How to configure rSyslog to send all remote logs into LibreNMS
First create the following config inside “/etc/rsyslog.d/”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root@LibreNMS:~# cat /etc/rsyslog.d/30-librenms.conf $ModLoad imudp $UDPServerRun 514 #--------------------------------------------------------- #send remote logs to librenms $template librenms,"%fromhost%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timereported:8:25%||%msg%||%programname%n" $ModLoad omprog $ActionOMProgBinary /opt/librenms/syslog.php :inputname, isequal, "imudp" :omprog:;librenms & ~ # & stop #--------------------------------------------------------- root@LibreNMS:~# |
Restart rSyslog and check the daemon
1 2 3 4 |
# netstat -lapute | grep syslogd | grep LISTEN tcp 0 0 *:shell *:* LISTEN root 9508 1278/rsyslogd tcp 0 0 *:shell *:* LISTEN root 9509 1278/rsyslogd # |