Rsyslog not starting from CentOS VM image

Hi,

I’ve been using the CentOS VM image for LibreNMS monitoring.

I started to want to test syslog, so as documented here:

https://docs.librenms.org/Extensions/Syslog/

I first made the changes to /etc/rsyslog.conf:

# Listen for syslog messages on UDP:514
$ModLoad imudp
$UDPServerRun 514

then I created the file:

/etc/rsyslog.d/30-librenms.conf

with contents:

# Feed syslog messages to librenms
$ModLoad omprog

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

*.* action(type="omprog" binary="/opt/librenms/syslog.php" template="librenms")

& stop

When I restarted rsyslog via:

systemctl restart rsyslog

I received:

Job for rsyslog.service failed because the control process exited with error code. See "systemctl status rsyslog.service" and "journalctl -xe" for details.

I tried to find out why but couldn’t, so I removed:

/etc/rsyslog.d/30-librenms.conf

and recommented:

# Listen for syslog messages on UDP:514
#$ModLoad imudp
#$UDPServerRun 514

Restarted rsyslog and still won’t start up.

I rebooted, rsyslog still won’t start up.

I’m baffled, as it’s back to the way it was yet rsyslog refuses to start up.

Any ideas? this is just the CentOS VM image downloaded from the site, yet patched to the latest CentOS 7 packages.

Thanks.

Michael.

Hi. I just realised that the CentOS VM comes with syslog-ng, which is why rsyslog fails to start.

Michael.

Just use syslog-ng …but most likely the rsylog has something in the conf file it doesn’t like. I can help you with that but if you are cool with syslog-ng. Then no worries :smile:

Hi Kevin. Yeah I’m cool with syslog-ng.

I just thought with the CentOS 7 VM it would have used rsyslog which is what comes default with the OS. I’m just testing syslog stuff now to see what I can do with it.

Thanks.

Cool happy testing :wink:

I use Rsyslog on centos 6.9 so it may not be the same as 7.

Are you getting any errors on your logs about why it’s not starting up?

Hi ACL. This ended up being a non-issue. I use rsyslog on many CentOS boxes, but the issue was I thought that the CentOS VM image online available for download did the same, but in fact it is configured by default to use syslog-ng.

If you install CentOS from scratch, yes it comes with rsyslog out of the box, but it’s obvious the LibreNMS people responsible for packaging the CentOS VM image for download customised the CentOS there for syslog-ng.

So there was no issue, because I was trying to start rsyslog with syslog-ng running, which was the problem. Technically speaking, the CentOS VM image should have rsyslog removed, since it’s replaced with syslog-ng. This would stop further confusion in future for people using that image.

Michael.