Syslog Integration
Observium supports collection of syslog from devices using rsyslogd or syslog-ng. Syslog capture is achieved by directing the syslog daemon to run Observium's syslog.php
script and send syslog messages to it via stdin.
Observium compares the IP address or hostname of the received message to its database to associate it with a device. If no association can be made, the message is discarded. Manual hostname/ip associations can be made via configuration options.
When using Enterprise Edition's distributed and partitioned features, syslog messages can be ingested via syslog.php on any Observium install operating as a poller or web UI.
rsyslogd
Ubuntu 24.04 and greater
Ubuntu 24.04 made changes to AppArmor and are “enforcing” it by default for Rsyslog daemon.
-
disable AppArmor enforcing for rsyslogd in Ubuntu 24.04 and greater:
-
Check rsyslogd version:
Text Only
To enable remote logging in rsyslog uncomment or add these two lines in /etc/rsyslog.conf:
To redirect logs from rsyslog to Observium:
- create file (as root):
Text Only
Add the following to /etc/rsyslog.d/30-observium.conf
Severity Level
The example above sets the minimum log severity level to 5, meaning logs of severity 6 and 7 will be discarded.
Add the following to /etc/rsyslog.d/30-observium.conf
This enables module omprog
, sets the $template
like syslog-ng and redirect output to observium's syslog.php
.
NOTE, for rsyslog version v7 you may see this warning:
rsyslogd: warning: ~ action is deprecated, consider using the 'stop' statement instead [try http://www.rsyslog.com/e/2307 ]
To solve this you should replace '& ~' with stop:
Text Only | |
---|---|
-
Then restart rsyslog:
Text Only -
Don't forget to enable syslog in Observium's
config.php
:Text Only
Match syslog hostname/ip with device
- FQDN hostname
NOTE, by default rsyslog uses non-FQDN hostnames, but observium requires FQDN names. To enable FQND hostnames add to the main rsyslog config /etc/rsyslog.conf
:
- Match by IP
In case your DNS PTR records don't match actual hostname, or you to want associate devices by IP, you may want to replace the $template
variable %fromhost%
with %fromhost-ip%
.
To correctly matching device by IP, make sure that IPs discovered exist for device on page: device -> Ports -> IPv4 (or IPv6) addresses.
- Mapping unknown hosts
To map unknown syslog hosts with devices, add host_map into your config as in the below example. Where key
is syslog unknown host, value
is device_id
or a hostname known by Observium.
Text Only | |
---|---|
Warning
After changing any rsyslog configs or syslog related configs in Observium you must reload (or restart) the rsyslog service to apply the changes.
sudo service rsyslog reload
Syslog-ng
Make sure these options are set :
Use this as destination in syslog-ng.conf, change syslog.php path to match yours
Text Only | |
---|---|
Don't forget to enable syslog in observium config.php:
Text Only | |
---|---|
1 |
|
Restart your syslog-ng server
Text Only | |
---|---|
1 |
|
Troubleshooting and debugging
To collect raw syslog messages from hosts, follow these steps:
-
Add syslog debug to
config.php
:PHP -
Make the logs directory writable for everyone (or at least give write permission to the syslog service user):
Text Only -
Restart the syslog service:
Text Only
After that, syslog messages from all hosts will be written to the logs directory (default /opt/observium/logs
) with filenames in the format <hostname>.syslog
.
Wait some time (or simulate syslog messages on the target device) to collect messages from the required host.
Don’t forget to disable debugging the same way — either remove or comment out the syslog debug config line and restart the rsyslog service.