Page 1 of 1

Questions about nagios.log

Posted: Wed Aug 07, 2024 10:36 am
by gregbeyer
I have my nagios.cfg set to rotate my nagios.log daily. And the logs appear to be rotating, at any rate new .log files are being placed in /usr/local/nagios/var/archives

However, my current nagios.log file continues to grow in size daily. While my archived logs are in the 200MB size range, nagios.log is now up to 410MB. I would expect that as the log are rotated daily, that the nagios.log file would start from 0, increasing to include only events of this 24 hour period. That's the way syslog rotation works. Also when I less nagios.log (and the archived logs as well) they all start with:

[1718110604] Nagios 4.4.13 starting... (PID=369602)
[1718110604] Local time is Tue Jun 11 08:56:44 EDT 2024

Which seems to say to me they all are starting June 11. Or rotation isn't really occurring. Why wouldn't they start on the new date of rotation?

Final question: How can I get a human readable date/time stamp on events? Stamps like "[1723036003]" (if they are timestamps) don't help me with when events occurred, and don't help with ensuring I'm looking in the .log file I intend.

Thanks much.

Re: Questions about nagios.log

Posted: Wed Aug 07, 2024 2:11 pm
by jmichaelson
What happens if you run diff on a pair of log files? in the event that they are different, you may want to pipe it through less or head to get a snippet of the output.

As far as a human readable timestamp, you can use https://www.epochconverter.com/ or there are several possible solutions here from a command line https://unix.stackexchange.com/question ... on-the-cli

Re: Questions about nagios.log

Posted: Wed Aug 07, 2024 3:47 pm
by gregbeyer
diff does show extensive differences between archived files.

So those stamps are epoch time, I take it from your suggestions. No way to configure nagios to log with human readable time stamps? Have to use utilities to convert individual stamps on a one-off basis?

Re: Questions about nagios.log

Posted: Thu Aug 08, 2024 9:53 am
by jsimon
Agreed that this is a pretty reasonable feature. I've logged a request to add the ability to configure this.

Re: Questions about nagios.log

Posted: Thu Aug 15, 2024 11:08 am
by gregbeyer
Any idea why archives are bing created, but still the nagios.log file keeps growing in size?