Page 1 of 1
/var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 8:02 am
by bosecorp
the /var/log/messages file has a lot Nagios messages about all the different checks. not only the messages file uses a lot space because of that but also makes it very difficult to troubleshoot any non Nagios related issue because all the messages.
I would like to make it so Nagios doesn't write a lot informational messages about all the check is doing onto the /var/log/message.
I noticed this effort is duplicated. the reason is because almost the same messages are being recorded in /usr/local/Nagios/var/Nagios.log
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 9:00 am
by tmcdonald
You should be able to set
use_syslog=0 in your nagios.cfg and restart Nagios.
https://assets.nagios.com/downloads/nag ... gmain.html
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 9:08 am
by bosecorp
would that stop recording messages in /usr/local/Nagios/var/Nagios.log as well.
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 9:16 am
by tmcdonald
From our config file sample:
# LOGGING OPTIONS
# If you want messages logged to the syslog facility, as well as the
# Nagios log file set this option to 1. If not, set it to 0.
use_syslog=1
https://github.com/NagiosEnterprises/na ... #L249-L253
So setting it to 1 will log to both syslog and to the log file, and setting it to 0 will just log to the Nagios log file.
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 9:27 am
by bosecorp
NIce. thanks that is what I want
thank you
questions, if that is the case what would you want to set 1 in order to have the same messages in Nagios.log and messages file. Unless 1 gives you more detail and at the same times records info in the message file
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 9:43 am
by ssax
It will use the syslog facility, it's the same information but handy if you are offloading your logs to another server and may have different rotate settings.
Re: /var/log/messages has a lot info nagios messages
Posted: Tue Aug 04, 2015 10:03 am
by bosecorp
thanks. you can close the ticket now