nagios.log invalid mode

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.
Locked
linuser
Posts: 102
Joined: Fri Sep 18, 2015 9:53 am

nagios.log invalid mode

Post by linuser »

Hello all,

I've got Nagios Core 4.3.2 running on RHEL 6.10.

We've been having a strange problem with the nagios log file where it just stops logging data. It happens about once every couple weeks or so.

We are harvesting the data from the nagios.log file to send to our NMS. The data in the log file is collected via a bash script that runs every night. What it does is create a hard link on the file that is duplicated to another folder so the "NMS" user can scp in and retrieve the log file data.

This is the only thing I can think of that could be causing a problem is having the log file hard-linked where it shares the same inode with another file, and nagios does not like it. But, I can't confirm that.

Then, today I was running a nagios verify ( nagios -v /etc/nagios/nagios.cfg ) and noticed this in the output:

Warning: log file '/var/log/nagios/nagios.log' has an invalid mode

Now, I'm wondering if that's related to the nagios.log file being hard-linked.

Are there any known issues with hard links on the nagios.log file? If not what first steps can I take to figure out why nagios stops logging but otherwise continues to run OK?

And, BTW, what I've been doing to "fix" this problem is stop nagios, remove nagios.log, touch a new nagios.log, restart nagios and re-run the NMS script to create the hard link.
bolson

Re: nagios.log invalid mode

Post by bolson »

The first thing I would try would be to just use a regular file for nagios.log (what nagios expects) and create a symbolic link to it for your user. Is there a reason why this approach wouldn't work for you?
Locked