You are here

Using Syslog

4 posts / 0 new
Last post
stephen4440
stephen4440's picture
Using Syslog

After enabling the use_syslog=1 option in nagios.cfg and opsview.defaults after a reload from the web UI these settings are reverted to use_syslog=0 and messages stop being written to /var/log/message (RH/CentOS).

To temporary fix after each UI reload or service restart

cd /usr/local/nagios/
sed -i 's/use_syslog=0/use_syslog=1/g' configs/Master\ Monitoring\ Server/nagios.cfg
sed -i 's/use_syslog=0/use_syslog=1/g' etc/nagios.cfg
/opt/opsview/watchdog/bin/opsview-monit restart nagios

To confirm the changes have been applied

grep -ri use_syslog /usr/local/nagios/*
tail -f /var/log/messages

Duncan Ferguson
dferguson's picture
As you say, his setting will

As you say, his setting will be removed every time you do a reload.

The correct way to do this is to add the following into opsview.conf (not opsview.defaults - this will be overwritten on every upgrade)

$overrides = <<'EOF';
nagios_use_syslog=1
EOF

This should be added before the final line '1;'

See https://knowledge.opsview.com/articles/7974/3274-config-files.html for more details

  Duncs

stephen4440
stephen4440's picture
thaks that appears to be

thaks that appears to be working now, one question does it need to be nagios_use_syslog or just use_syslog

Stephen

Duncan Ferguson
dferguson's picture
When adding to the overrides

When adding to the overrides section of opsview.conf, it needs to be "nagios_use_syslog = ..."

Please see '$overrides' section on https://knowledge.opsview.com/articles/opsview-monitor-502/3274-config-f...

  Duncs