Rsyslog help

I seem to have been able to get the furthest with rsyslog on Cent OS 7.

My 30-librenms.conf

Source : Syslog - LibreNMS Docs

Feed syslog messages to librenms

$ModLoad omprog

$template librenms,“%fromhost%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timereported:8:25%||%msg%||%programname%\n”

:inputname, isequal, “imudp” action(type=“omprog”
binary=“/opt/librenms/syslog.php”
template=“librenms”)
& stop

[root@mgmt j2sw]# rsyslogd -N1
rsyslogd: version 8.23.0, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: End of config validation run. Bye.

if I do: logger test test nothing shows up in libre. It does show up in /var/messages. I do have $config[‘enable_syslog’] = 1; in my libre config.

netstat shows it’s running on port 514.

What am I missing?

Usually the hostname / IP of the syslog doesn’t match what’s in librenms - open syslog.php, uncomment the logfile line, restart rsyslog and then tail -f /opt/librenms/logs/librenms.log see what the data looks like.

Hello,

Has anyone been able to get rsyslog to work with the librenms syslog module.

I have stalked around on this community for hints and ideas and still can not get it to work -

here is my conf file - I have 3 versions of trying to get this to work with no success -

$ModLoad /usr/lib64/rsyslog/omprog.so

$template librenms,“%fromhost%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timegenerated:8:25%||%msg%||%programname%\n”

#:inputname, isequal, “imudp” action(type=“omprog”
#binary=“/opt/librenms/syslog.php”
#template=“librenms”)
#& stop

#. action(type=“omprog”
#binary=“/opt/librenms/syslog.php”
#template=“librenms”)
##& stop

$ActionOMProgBinary /opt/librenms/syslog.php
.,local7.!info :omprog:;librenms

all 3 versions, only 1 active at a time, clear the rsyslog config check.

Ideas?

-Mike

Yes! We can only get it working if the first value is an IP address, not a hostname. So, if you change the $template to say:

$template librenms,"%fromhost-ip%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timegenerated:8:25%||%msg%||%programname%\n"

It will work.

1 Like