Page 1 of 1

Extend log history

Posted: Fri Mar 18, 2016 7:56 am
by jriker1
I am using the latest version of Nagios and am curious if there is a way to have more logs than what shows? I had a server go down and unfortunately in the morning when I went to check the logs only errors I had were what looks like knee deep in the middle of a bunch of messages you would expect when the system was down. No messages specific to right before it happened and what caused it, just resulting services not responding. Do I have to install some kind of database or something on top of what I have in order to have extended logs? Look like they are just same day entries or something. Know I had a MySQL DB behind Nagios before at my old job, just don't recall what I did since I didn't take my documentation with me.

Thanks.

JR

Re: Extend log history

Posted: Fri Mar 18, 2016 8:47 am
by rhassing
Which log file are you looking at? Is this your nagios.log or do you mean your syslog?

Re: Extend log history

Posted: Fri Mar 18, 2016 8:51 am
by jriker1
If you mean by syslog the CentOS logs obviously not those as I wouldn't expect Nagios to manage that. I'm talking like the log of what events happened on each host and what errors were sent out by each service, etc.

Thanks.

JR

Re: Extend log history

Posted: Fri Mar 18, 2016 8:59 am
by rhassing
Aren't there any files in the archive directory?

Re: Extend log history

Posted: Fri Mar 18, 2016 9:38 am
by jriker1
Looks like there is all kinds of stuff in there but when I sort the history from oldest to newest it's just for the last 12 hours or so.

Thanks.

JR

Re: Extend log history

Posted: Fri Mar 18, 2016 9:41 am
by jriker1
SO I select a host, click View Alert History for this host. It shows data for two hours ago. Click the arrow that says "Latest Archive". It says "No history information was found for this host in this archived log file". Oh wow. Do I have to keep clicking back? I noticed when I click on earlier archive again and again it keeps cycling thru each log file one at a time showing me what's relevant for this host.

Re: Extend log history

Posted: Fri Mar 18, 2016 9:51 am
by rhassing
You could also try and change the date in the top of the screen and set the start date back a few days.

Re: Extend log history

Posted: Fri Mar 18, 2016 9:56 am
by jriker1
Brutal. Does it work any differently if you install ndoutils? Though I've tried that a few times and although successful keeps complaining "Support for the specified database server is either not yet supported, or was not found on your system." even though DB is running. If that's how it works all good just thought it would show more per file since I don't have a lot going on in each day. How frequently does it switch to a new log file and can that be controlled?

Funny, if ndoutils is a good answer, there are all these docs on installing it on nagios 4 with Centos 7 and talk about installing MySQL-server which isn't used anymore so curious how they got it working with a simple yum statement like all the docs say.

Thanks.

JR

Re: Extend log history

Posted: Fri Mar 18, 2016 2:55 pm
by tmcdonald
jriker1 wrote:Does it work any differently if you install ndoutils?
I might have answered this indirectly in your other thread: https://support.nagios.com/forum/viewto ... 95#p176268

But basically, Core does not read from NDO, so no.
jriker1 wrote:How frequently does it switch to a new log file and can that be controlled?
That would be configured in nagios.cfg by setting the log_rotation_method directive.

https://assets.nagios.com/downloads/nag ... ion_method
jriker1 wrote:Funny, if ndoutils is a good answer, there are all these docs on installing it on nagios 4 with Centos 7 and talk about installing MySQL-server which isn't used anymore so curious how they got it working with a simple yum statement like all the docs say.
I think you can basically replace "MySQL" with "MariaDB" and get the same results. The underlying protocols are the same.