Stop Nagios logs to be logged at /var/log/messages

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
s.diwakar1
Posts: 44
Joined: Thu Feb 27, 2020 9:45 am

Stop Nagios logs to be logged at /var/log/messages

Post by s.diwakar1 »

Hi All,

Hope you are doing well !!!

I have configured below parameter in nagios.cfg to stop the logs to be logged in messages file at /var/log/messages location. But still logs are being logged there. Please suggest.

Code: Select all

use_syslog=0
Thanks in advance !!!
Thanks & Regards,
Diwakar Sharma
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Stop Nagios logs to be logged at /var/log/messages

Post by gormank »

Did you restart nagios?
Maybe it's check_nrpe or ncpa that's logging now and not nagios?
s.diwakar1
Posts: 44
Joined: Thu Feb 27, 2020 9:45 am

Re: Stop Nagios logs to be logged at /var/log/messages

Post by s.diwakar1 »

Hi @gormank,

Thanks for your reply.

Yes, I restarted the nagios after making the changes in nagios.cfg file.

If they are of check_nrpe or something else, then how to check and stop them to be logged at /var/log/messages. Also let me know if they are important to have for any troubleshooting. Because the weekly log file is consuming 20GB of space.
Thanks & Regards,
Diwakar Sharma
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Stop Nagios logs to be logged at /var/log/messages

Post by gormank »

You may want to paste examples of the log messages you want disabled, as well as let us know which agent you're using.
s.diwakar1
Posts: 44
Joined: Thu Feb 27, 2020 9:45 am

Re: Stop Nagios logs to be logged at /var/log/messages

Post by s.diwakar1 »

There are tons of logs generated as below:
check_nrpe: Remote x.x.x.x does not support Version 3 Packets
I am using NRPE and NSClient++. Also FYI, on Nagios server, NRPE version 3.2.1 is installed and target servers have below versions installed.

NRPE v2.15
NRPE v3.2.1
NRPE v4.0.2
NRPE v4.0.3
NRPE v4.1.0

So, above error logs are generated because of different versions of NRPE installed on Nagios and target servers?
Thanks & Regards,
Diwakar Sharma
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Stop Nagios logs to be logged at /var/log/messages

Post by gormank »

Try running check_nrpe -h and change the command in nagios to use v2 packets.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Stop Nagios logs to be logged at /var/log/messages

Post by gormank »

Oh, and disable logging in /etc/xinetd.d/nrpe ir nrpe.cfg depending on how you start it.
s.diwakar1
Posts: 44
Joined: Thu Feb 27, 2020 9:45 am

Re: Stop Nagios logs to be logged at /var/log/messages

Post by s.diwakar1 »

Tried below command but still getting the same logs.

Code: Select all

check_nrpe -H $HOSTADDRESS$ -2 -c $ARG1$ -t 20
Thanks & Regards,
Diwakar Sharma
MasaNagios
Posts: 12
Joined: Thu Sep 16, 2021 6:39 am

Re: Stop Nagios logs to be logged at /var/log/messages

Post by MasaNagios »

Is this issue resolved? I am facing the same issue. Any help/guidance would be appreciated please.

Kind Regards,

s.diwakar1 wrote: Tue Oct 25, 2022 12:07 pm Tried below command but still getting the same logs.

Code: Select all

check_nrpe -H $HOSTADDRESS$ -2 -c $ARG1$ -t 20
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

Re: Stop Nagios logs to be logged at /var/log/messages

Post by kg2857 »

Probably, since nobody has posted about it in a while. Maybe try doing what was suggested.
Post Reply